\documentclass{article} \usepackage{setspace} \usepackage{amssymb} \usepackage[margin=1.45in]{geometry} \usepackage{microtype} \usepackage{fancyvrb} \usepackage{bussproofs} \usepackage[oxford]{logictools} \usepackage[svgnames]{xcolor} \usepackage{tabularx} \usepackage{nicematrix,tikz} \usetikzlibrary{patterns.meta, patterns, decorations.markings,fadings} \tikzset{->-/.style={decoration={ markings, mark=at position #1 with {\arrow[line width=1.25pt]{>}}},postaction={decorate}}} %----------------------------------------------------- \title{The logictools Package} \author{Miles Min Yin Cheang} %----------------------------------------------------- %\usepackage[bitstream-charter,expert]{mathdesign} \usepackage{XCharter} \SetMathAlphabet{\mathcal}{normal}{OMS}{cmsy}{m}{n} \usepackage{hyperref} \hypersetup{ colorlinks, citecolor=black, filecolor=black, linkcolor=black, urlcolor=black } % Super easy proof annotations in the style that Volker likes, with good(ish) kerning. \newcommand{\andlabel}[1]{ \RightLabel{\scriptsize($\land$\hspace{1px}#1)} } \newcommand{\orlabel}[1]{ \RightLabel{\scriptsize($\lor\hspace{1px}\text{#1}$)} } \newcommand{\implieslabel}[1]{ \RightLabel{\scriptsize($\rightarrow$\hspace{0.5px}#1)} } \newcommand{\ifflabel}[1]{ \RightLabel{\scriptsize($\leftrightarrow$\hspace{0.5px}#1)} } \newcommand{\neglabel}[1]{ \RightLabel{\scriptsize($\neg$\hspace{0.5px}#1)} } \newcommand{\foralllabel}[1]{ \RightLabel{\scriptsize($\forall$\hspace{1px}#1)} } \newcommand{\existslabel}[1]{ \RightLabel{\scriptsize($\exists$\hspace{0.5px}#1)} } \makeatletter \def\shorteq{\@ltoolsshorteq} \makeatother \fboxsep=0pt \fboxrule=1sp \begin{document} \maketitle \setstretch{1.4} \tableofcontents \newpage \section{Purpose of this package} The star of the show here is the formallogic environment. Prior to the development of this environment, spending way too much time fiddling around with spacing commands was a familiar experience for every logician. Most of the spacing you need in a logical statement is context sensitive, so only so much can be done through basic macros. Furthermore, using too many macros destroys the readability of the code, and slows down writing to a crawl. In an effort to change this, I wrote an environment that both \emph{speeds up} writing formal logic (by offering shorter syntax) and improves the output considerably. The details of how this works will be presented in the upcoming sections. The default settings were made with \LaTeX's default math font in mind, with the intention that the user come up with a preset that matches their preferences. The options can be changed on the fly, so more than one preset can be used in different parts of the document. Other than this, the option `oxford' will load a few neat macros that might be of particular interest to those studying logic at the University of Oxford; they provide shortcuts to notations that are commonly used in the first-year courses. It is likely that this section of the package will be updated with more content as I go through my degree. \newpage \section{The formallogic environment} \subsection{Introduction} This interface, accessed through the environment named \verb|formallogic|, or the command \verb|\fmllgc{}|, helps to type formal logic in \LaTeX. Here are some of its uses: \logictoolsoptions{partype=single,italiccorrection=1mu, quantskip=5mu,lastquantskip=5mu} \begin{center} \begin{tabular}{c|c} Code: & Output: \\ \hline \verb!|forall, x ; exists, y| (Ryx)! & \fmllgc{|forall,x;exists,y| (Ryx)} \\ \verb!|f,x;e,y|(Ryx)! & \fmllgc{|forall,x;exists,y| (Ryx)} \\ \verb|((P \land Q) \liff R)|& \logictoolsoptions{partype=double,italiccorrection=1mu, quantskip=5mu,lastquantskip=5mu,parinnerpad=5mu,parvoffset=0.17ex} \fmllgc{((P \land Q) \liff R))}\\ \verb|((P \land Q) \liff R)|& \logictoolsoptions{partype=single,italiccorrection=1mu, quantskip=5mu,lastquantskip=5mu,parinnerpad=1mu,parstackkern=-3mu, parvoffset=0.17ex} \fmllgc{((P \land Q) \liff R))}\\ \verb|((P \land Q) \liff R)|& \logictoolsoptions{partype=single,italiccorrection=1mu, quantskip=5mu,lastquantskip=5mu,parinnerpad=2.5mu,parstackkern=5mu, parvoffset=0.17ex} \fmllgc{((P \land Q) \liff R))} \end{tabular} \end{center} You will be shown how to accomplish every one of these in the following documentation. Note that there are various user-defined parameters controlling the typesetting (e.g. spacing, kerning, parenthesis style); this is how the same code can produce wildly different outputs. Furthermore, the user can control certain parts of the syntax (e.g. the names of quantifiers). \subsection{Quantifier stacks} Quantifier stacks are a concept introduced for typesetting logical quantifiers: \begin{center} \fmllgc{|forall , x ;exists , y ;forall, x_1 ;exists, z\in \mathbb{R}|} \verb!| forall, x ; exists, y ; forall, x_1 ; exists, z\in\mathbb{R} |! \end{center} Quantifier stacks are used by the formallogic environment. They are delimited by `\texttt{|}'. A quantifier stack is made up of quantifiers, written in the form \verb|