0

I'm trying to make a list of three columns where the first column is on the left hand side of the page, the second column runs down the middle and the third column is on the right hand side. A table is far too compact for what I want to do. I have used multicols but it doesn't align the rows if I have to display and equation with \[ \].

Here is an example of what I'm trying to achieve.

Here is what I tried, but the displayed equation is not aligned.

\documentclass[12pt,a4paper,bothsides]{article}

\usepackage{multicol}

\begin{document}
\begin{multicols}{3}
\begin{itemize}
    \item[] First equation
    \item[] Second equation
    \item[] Third equation
    \item[] $a+b=c$
    \item[] \[\int_0^1 x^2 \ \mathrm{d}x\]
    \item[] $u+v=w$
    \item[] Adding
    \item[] Integrating
    \item[] Adding
\end{itemize}
\end{multicols}
\end{document}
  • Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Mar 23 '14 at 11:57
  • @ChristianH I don't have a working example. As I said: table is too compact and multicols doesn't align the rows. I need someone to suggest a formatting package that I don't yet know exists. I have supplied an example of what I need to do. – Fly by Night Mar 23 '14 at 12:01
  • What do you mean by too compact? If you use columns with the number of items not multiple of 3 you will get a problem. – Sigur Mar 23 '14 at 12:18
  • @FlybyNight: Your posted MWE is a good starting point – user31729 Mar 23 '14 at 12:22
  • @Sigur Tables compress all of the information together. I want the information spreading out, as in my example. – Fly by Night Mar 23 '14 at 12:22
2

Don't you want one of these two displays — without multicolumns? The flalign*`environment is the key tool here:

    \documentclass[12pt,a4paper,bothsides]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[showframe, nomarginpar]{geometry}
    \usepackage{amsmath}


    \begin{document}

    \begin{flalign*}
        &  \text{First equation: } & a+b & =c  &  & \text{(Adding)} \\
        &  \text{Second equation: } & \int_0^1 x^2 \ \mathrm{d}x &  = \dfrac{1}{3}  &  & \text{(Integrating)}\\
        & \text{Third equation; }  & u+v & =w  &  & \text{(Adding)}
    \end{flalign*}

    \begin{flalign*}
        &  \text{First equation: } & a+b & =c  &  \text{(Adding)}& \\
        &  \text{Second equation: } & \int_0^1 x^2 \ \mathrm{d}x &  = \dfrac{1}{3}  &  \text{(Integrating)}&\\
        & \text{Third equation; }  & u+v & =w  &  \text{(Adding)}&
    \end{flalign*}

    \end{document} 

enter image description here

  • This is excellent. How do you centrally align the middle column? – Fly by Night Mar 23 '14 at 12:42
  • This is essentially flalign(*)'s job: as there are 2n – 1 = 5 ampersands, they correspond to n = 3 groups of equations. Odd numbered ampersands denote the beginning of a group, the next (even numbered) ampersand denotes the alignment point inside that group. I suppose the left and right groups are placed first, then flalign computes the white space that is left for the middle group, computes its width and places it accordingly. – Bernard Mar 23 '14 at 12:59
  • Oops! Sorry for having mingled in my explanations: actually odd numbered ampersands denote the alignment point of the current group, and the 2n (even) numbered mark the beginning of the (n +1)-th group — of course the 0th & is only virtual! – Bernard Mar 23 '14 at 14:52
2

You can achieve the prettier display of \[ \] with \displaystyle command.

\documentclass[12pt,a4paper,bothsides]{article}

\usepackage{multicol}

\begin{document}
\begin{multicols}{3}
\begin{itemize}
    \item[] First equation
    \item[] Second equation
    \item[] Third equation
    \item[] $a+b=c$
    \item[] \( \displaystyle{\int_0^1 x^2 \ \mathrm{d}x} \)
    \item[] $u+v=w$
    \item[] Adding
    \item[] Integrating
    \item[] Adding
\end{itemize}
\end{multicols}
\end{document}

enter image description here

  • This is perfect! Thank you very much. Can I ask you two more questions: If I have nine items them the first three fill the first column, the second three fill the middle column, etc. Is there an option to fill them horizontally? Also, is there a way of adding extra spaces between rows? (Except by adding empty rows) – Fly by Night Mar 23 '14 at 12:24
  • You mean like transposing a matrix? Making column content to rows? – user31729 Mar 23 '14 at 12:29
  • Yes, basically. The output will be read by the reader row-by-row and not column by column. At the moment I have to enter the content column-by-column which is a bit of a pain and I keep putting things in the wrong place. – Fly by Night Mar 23 '14 at 12:35
  • At the moment I have no immediate answer (if there is any) to your additional question – user31729 Mar 23 '14 at 12:36
2

The memoir documentclass (which is in its standard configuration comparable to book) offers the \autocols macro, which might fit your needs.

\documentclass{memoir}
\pagestyle{empty}% for cropping
\begin{document}
\autocols{c}{3}{l}{
    First equation,
    Second equation,
    Third equation,
    $a+b=c$,
    $\displaystyle \int_0^1 x^2 \ \mathrm{d}x$,
    $u+v=w$,
    Adding,
    Integrating,
    Adding
}
\end{document}

enter image description here


EDIT: Aligning the rows.

\documentclass{memoir}
\pagestyle{empty}% for cropping
\begin{document}
\edef\mystrut{\setbox0=\hbox{$\displaystyle\int_0^1$}\vrule depth \dp0 height \ht0 width 0pt\relax}
\autocols{c}{3}{l}{
    First equation,
    \mystrut Second equation,
    Third equation,
    $a+b=c$,
    $\displaystyle\int_0^1 x^2 \ \mathrm{d}x$,
    $u+v=w$,
    Adding,
    \mystrut Integrating,
    Adding
}
\end{document}

enter image description here


EDIT: Using a tabular might be easier for this purpose.

\documentclass{article}
\pagestyle{empty}% for cropping
\usepackage{array}
\begin{document}
\begin{tabular}{l>{$\displaystyle}l<{$}l}
    First equation  & a+b=c                      & Adding      \cr
    Second equation & \int_0^1 x^2 \ \mathrm{d}x & Integrating \cr
    Third equation  & u+v=w                      &  Adding     \cr
\end{tabular}
\end{document}

enter image description here

  • This is definitely an improvement, but the second row is not aligned. Is there a way to make the text on either side of the integral to sit on the same level as the $x^2\ \mathrm{d}x$? – Fly by Night Mar 23 '14 at 12:20
  • @FlybyNight See my updated answer. – Henri Menke Mar 23 '14 at 12:27
1

Here is a simple solution using only tabular.

\documentclass[12pt,a4paper,bothsides]{article}

\usepackage{lipsum} %% dummy text

\begin{document}

\lipsum[1]
\begin{center}
\begin{tabular}{|@{}p{.3\linewidth}|@{}p{.3\linewidth}|@{}p{.3\linewidth}@{}|}
First equation  & $a+b=c$                                           & Adding      \\ %[7pt]
Second equation & $\displaystyle{\int_0^1 x^2 \ \mathrm{d}x}$       & Integratin  \\ %[7pt]
Third equation  & $u+v=w$                                           & Adding
\end{tabular}
\end{center}
\lipsum[1]
\end{document}

enter image description here

ps. you can remove the rules on the table, if you wish.

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.