3

I'm trying to create a simple cheat sheet using Latex. I'm using multicol to segment the page and the equations on each column.

However, the equations are not aligned to the left despite using flalign and because of the font size, they are cut off by the multicol separator.

enter image description here

\documentclass{article}

  \usepackage{multicol, amsmath, geometry}
    \geometry{
      a4paper,
      margin = 0.4in
    }
    \pagenumbering{gobble}
    \setlength{\columnsep}{0.5in}
    \setlength{\columnseprule}{1pt}

  \begin{document}
  \begin{multicols*}{3}
    \begin{center}
      \textbf{Logical Equivalences}
    \end{center}
    \small
    \begin{flalign*}
      P \wedge T \equiv P\\
      P \vee F \equiv P\\\\
      P \vee T \equiv T\\
      P \wedge F \equiv F\\\\    
      P \wedge P \equiv P\\
      P \vee P \equiv P\\\\ 
      \neg (\neg P) \equiv P\\\\
      P \vee Q \equiv Q \vee P\\
      P \wedge Q \equiv Q \wedge P\\\\
      (P \vee Q) \vee R \equiv P \vee (Q \vee R)\\
      (P \wedge Q) \wedge R \equiv P \wedge (Q \wedge R)\\\\
      P \vee (Q \wedge R) \equiv (P \vee Q) \wedge (P \vee R)\\
      P \wedge (Q \vee R) \equiv (P \wedge Q) \vee (P \wedge R)\\\\
      \neg (P \wedge Q) \equiv \neg P \vee \neg Q\\
      \neg (P \vee Q) \equiv \neg P \wedge \neg Q\\\\  
      P \vee (P \wedge Q) \equiv P\\
      P \wedge (P \vee Q) \equiv P\\\\
      P \vee \neg P \equiv T\\
      P \wedge \neg P \equiv F\\\\ 
      P \implies Q \equiv \neg P \vee Q\\
      P \implies Q \equiv \neg Q \implies \neg Q\\
      P \vee Q \equiv \neg P \implies Q\\
      P \wedge Q \equiv \neg (P \implies \neg Q)\\
      \neg (P \implies Q) \equiv P \wedge \neg Q\\
      (P \implies Q) \wedge (P \implies R) \equiv P \implies (Q \wedge R)\\
      (P \implies Q) \vee (P \implies R) \equiv P \implies (Q \vee R)\\
      (P \implies R) \wedge (P \implies R) \equiv (P \vee Q)\implies R\\
      (P \implies R) \vee (P \implies R) \equiv (P \wedge Q)\implies R\\\\
      P \iff Q \equiv (P \implies Q) \wedge (Q \implies P)\\
      P \iff Q \equiv \neg P \iff \neg \neg Q\\
      P \iff Q \equiv (P \wedge Q) \vee (\neg Q \wedge \neg P)\\
      \neg (P \iff Q) \equiv P \iff \neg Q         
    \end{flalign*}
  \end{multicols*}

  \end{document}

I tried using \small to reduce the size of the equations but they still don't fit. Is there a way to have them aligned left and dynamically sized to the margins of the multicols?

  • Off-topic: In the third-to-last row, is P \iff Q \equiv \neg P \iff \neg \neg Q correct? – Mico Mar 1 '18 at 9:50
7

flalign is not designed to align to the left: use the [fleqn] option to the package (or documentclass) to get left aligned equations. Also the first cell in an alignment structure is aligned to the right so either use an un-aligned environment such as gather or use &\equiv to align the equivalences.

So like this, except that the lines are still too wide

\documentclass[fleqn]{article}

  \usepackage{multicol, amsmath, geometry}
    \geometry{
      a4paper,
      margin = 0.4in
    }
    \pagestyle{empty}
    \setlength{\columnsep}{0.5in}
    \setlength{\columnseprule}{1pt}

  \begin{document}
  \begin{multicols*}{3}
    \begin{center}
      \textbf{Logical Equivalences}
    \end{center}
    \small
    \begin{gather*}
      P \wedge T \equiv P\\
      P \vee F \equiv P\\\\
      P \vee T \equiv T\\
      P \wedge F \equiv F\\\\    
      P \wedge P \equiv P\\
      P \vee P \equiv P\\\\ 
      \neg (\neg P) \equiv P\\\\
      P \vee Q \equiv Q \vee P\\
      P \wedge Q \equiv Q \wedge P\\\\
      (P \vee Q) \vee R \equiv P \vee (Q \vee R)\\
      (P \wedge Q) \wedge R \equiv P \wedge (Q \wedge R)\\\\
      P \vee (Q \wedge R) \equiv (P \vee Q) \wedge (P \vee R)\\
      P \wedge (Q \vee R) \equiv (P \wedge Q) \vee (P \wedge R)\\\\
      \neg (P \wedge Q) \equiv \neg P \vee \neg Q\\
      \neg (P \vee Q) \equiv \neg P \wedge \neg Q\\\\  
      P \vee (P \wedge Q) \equiv P\\
      P \wedge (P \vee Q) \equiv P\\\\
      P \vee \neg P \equiv T\\
      P \wedge \neg P \equiv F\\\\ 
      P \implies Q \equiv \neg P \vee Q\\
      P \implies Q \equiv \neg Q \implies \neg Q\\
      P \vee Q \equiv \neg P \implies Q\\
      P \wedge Q \equiv \neg (P \implies \neg Q)\\
      \neg (P \implies Q) \equiv P \wedge \neg Q\\
      (P \implies Q) \wedge (P \implies R) \equiv P \implies (Q \wedge R)\\
      (P \implies Q) \vee (P \implies R) \equiv P \implies (Q \vee R)\\
      (P \implies R) \wedge (P \implies R) \equiv (P \vee Q)\implies R\\
      (P \implies R) \vee (P \implies R) \equiv (P \wedge Q)\implies R\\\\
      P \iff Q \equiv (P \implies Q) \wedge (Q \implies P)\\
      P \iff Q \equiv \neg P \iff \neg \neg Q\\
      P \iff Q \equiv (P \wedge Q) \vee (\neg Q \wedge \neg P)\\
      \neg (P \iff Q) \equiv P \iff \neg Q         
    \end{gather*}
  \end{multicols*}

  \end{document}

This version fits, if you have good eyesight...

enter image description here

\documentclass[fleqn]{article}

  \usepackage{multicol, amsmath, geometry}
    \geometry{
      a4paper,
      margin = 0.4in
    }
    \pagestyle{empty}
    \setlength{\columnsep}{0.4in}
    \setlength{\columnseprule}{1pt}

  \begin{document}
  \begin{multicols*}{3}
    \begin{center}
      \textbf{Logical Equivalences}
    \end{center}
    \tiny
    \begin{gather*}
      P \wedge T \equiv P\\
      P \vee F \equiv P\\\\
      P \vee T \equiv T\\
      P \wedge F \equiv F\\\\    
      P \wedge P \equiv P\\
      P \vee P \equiv P\\\\ 
      \neg (\neg P) \equiv P\\\\
      P \vee Q \equiv Q \vee P\\
      P \wedge Q \equiv Q \wedge P\\\\
      (P \vee Q) \vee R \equiv P \vee (Q \vee R)\\
      (P \wedge Q) \wedge R \equiv P \wedge (Q \wedge R)\\\\
      P \vee (Q \wedge R) \equiv (P \vee Q) \wedge (P \vee R)\\
      P \wedge (Q \vee R) \equiv (P \wedge Q) \vee (P \wedge R)\\\\
      \neg (P \wedge Q) \equiv \neg P \vee \neg Q\\
      \neg (P \vee Q) \equiv \neg P \wedge \neg Q\\\\  
      P \vee (P \wedge Q) \equiv P\\
      P \wedge (P \vee Q) \equiv P\\\\
      P \vee \neg P \equiv T\\
      P \wedge \neg P \equiv F\\\\ 
      P \implies Q \equiv \neg P \vee Q\\
      P \implies Q \equiv \neg Q \implies \neg Q\\
      P \vee Q \equiv \neg P \implies Q\\
      P \wedge Q \equiv \neg (P \implies \neg Q)\\
      \neg (P \implies Q) \equiv P \wedge \neg Q\\
      (P \implies Q) \wedge (P \implies R) \equiv P \implies (Q \wedge R)\\
      (P \implies Q) \vee (P \implies R) \equiv P \implies (Q \vee R)\\
      (P \implies R) \wedge (P \implies R) \equiv (P \vee Q)\implies R\\
      (P \implies R) \vee (P \implies R) \equiv (P \wedge Q)\implies R\\\\
      P \iff Q \equiv (P \implies Q) \wedge (Q \implies P)\\
      P \iff Q \equiv \neg P \iff \neg \neg Q\\
      P \iff Q \equiv (P \wedge Q) \vee (\neg Q \wedge \neg P)\\
      \neg (P \iff Q) \equiv P \iff \neg Q       
    \end{gather*}
  \end{multicols*}

  \end{document}
| improve this answer | |
2

Another solution consists of using a gather* environment, with two embedded aligned environments. (In each of the two aligned groups, alignment is performed on the \equiv symbols.)

In order to make all equations fit inside the column while using \small -- not \footnotesize, \scriptsize or, shudder, \tiny -- all one needs to do is to assign mathord status to the \implies symbols in the penultimate group of four equations.

enter image description here

\documentclass{article}
\usepackage{multicol, amsmath, geometry}
\geometry{a4paper,margin = 0.4in}
\pagenumbering{gobble}
\setlength{\columnsep}{0.5in}
\setlength{\columnseprule}{0.4pt} % 1pt looks rather heavy...

\begin{document}

\begin{multicols*}{3}

\begin{center}
\textbf{Logical Equivalences}
\end{center}
\small
\begin{gather*}
    P \wedge T \equiv P\\
    P \vee F \equiv P\\[3ex]
    P \vee T \equiv T\\
    P \wedge F \equiv F\\[3ex]    
    P \wedge P \equiv P\\
    P \vee P \equiv P\\[3ex] 
    \neg (\neg P) \equiv P\\[3ex]
    P \vee Q \equiv Q \vee P\\
    P \wedge Q \equiv Q \wedge P\\[3ex]
    (P \vee Q) \vee R \equiv P \vee (Q \vee R)\\
    (P \wedge Q) \wedge R \equiv P \wedge (Q \wedge R)\\[3ex]
    P \vee (Q \wedge R) \equiv (P \vee Q) \wedge (P \vee R)\\
    P \wedge (Q \vee R) \equiv (P \wedge Q) \vee (P \wedge R)\\[3ex]
    \neg (P \wedge Q) \equiv \neg P \vee \neg Q\\
    \neg (P \vee Q) \equiv \neg P \wedge \neg Q\\[3ex]  
    P \vee (P \wedge Q) \equiv P\\
    P \wedge (P \vee Q) \equiv P\\[3ex]
    P \vee \neg P \equiv T\\
    P \wedge \neg P \equiv F\\[3ex]
    \begin{aligned} 
    P \implies Q &\equiv \neg P \vee Q\\
    P \implies Q &\equiv \neg Q \implies \neg Q\\
    P \vee     Q &\equiv \neg P \implies Q\\
    P \wedge   Q &\equiv \neg (P \implies \neg Q)\\
    \neg (P \implies Q) &\equiv P \wedge \neg Q 
    \end{aligned} \\[3ex]
    (P {\implies} Q) \wedge (P {\implies} R) \equiv P {\implies} (Q \wedge R)\\
    (P {\implies} Q) \vee   (P {\implies} R) \equiv P {\implies} (Q \vee   R)\\
    (P {\implies} R) \wedge (P {\implies} R) \equiv (P \vee   Q){\implies} R\\
    (P {\implies} R) \vee   (P {\implies} R) \equiv (P \wedge Q){\implies} R\\[3ex]
    \begin{aligned}
    P \iff Q\phantom{)} &\equiv (P \implies Q) \wedge (Q \implies P)\\
    P \iff Q\phantom{)} &\equiv \neg P \iff \neg Q\\
    P \iff Q\phantom{)} &\equiv (P \wedge Q) \vee (\neg Q \wedge \neg P)\\
    \neg (P \iff Q) &\equiv P \iff \neg Q   
   \end{aligned}
\end{gather*}

\end{multicols*}

\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.