6

I'm trying to create two side-by-side bullet point lists in a document, where each point lines up with the corresponding point in the other list, even when one of the points has multiple lines.

So far I use a minipage environment and \\ the items to where they are side-by-side, but this seems like a major kludge.

As an example, I have something like this:

\documentclass{article}
\begin{document}
\begin{minipage}[t]{0.5\textwidth}
\begin{itemize}
\item Mary had a little lamb,
\item Old MacDonald had a farm,
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\begin{itemize}
\item Her fleece was white as snow. And everywhere that Mary went, the lamb was sure to go.
\item E-I-E-I-O! And on this farm he had a cow, E-I-E-I-O! With a moo moo here, and a moo moo there.
\end{itemize}
\end{minipage}
\end{document}

Result of the code snippet above

and then to align them I add \\s as appropriate

\documentclass{article}
\begin{document}
\begin{minipage}[t]{0.5\textwidth}
\begin{itemize}
\item Mary had a little lamb, \\ \\
\item Old MacDonald had a farm,
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\begin{itemize}
\item Her fleece was white as snow. And everywhere that Mary went, the lamb was sure to go.
\item E-I-E-I-O! And on this farm he had a cow, E-I-E-I-O! With a moo moo here, and a moo moo there.
\end{itemize}
\end{minipage}
\end{document}

Items aligned with backslashes

But is there a more sane way to do this? Notably this stops working whenever I use \raggedright.

Werner
  • 603,163

3 Answers3

7

You can try with the multienum package, by defining a new multiitem environment

\newenvironment{multiitem}{%
  \multienumerate\renewcommand{\labelname}{\textbullet}%
}{%
  \endmultienumerate%
}

No need for minipages or tabulars with it.

MWE

\documentclass{article}
\usepackage{multienum}

\newenvironment{multiitem}{%
  \multienumerate\renewcommand{\labelname}{\textbullet}%
}{%
  \endmultienumerate%
}

\begin{document}
\begin{multiitem}
\mitemxx{Mary had a little lamb,}{Her fleece was white as snow. And everywhere that Mary went, the lamb was sure to go.}
\mitemxx{Old MacDonald had a farm,}{E-I-E-I-O! And on this farm he had a cow, E-I-E-I-O! With a moo moo here, and a moo moo there.}
\end{multiitem}
\end{document} 

Output

enter image description here

karlkoeller
  • 124,410
4

If you're not concerned about page breaking, I'd just set this in a tabularx. It's all about the column specification:

enter image description here

\documentclass{article}
\usepackage{tabularx}% Loads the array package
\begin{document}

\noindent
\begin{tabularx}{\textwidth}{
    @{\hspace{1.5em}}% Space for left bullet
    >{\leavevmode\llap{\textbullet~}\raggedright}% Left bullet + formatting of column
    X% Left column specification
    @{\quad\hspace{1.5em}}% Space between columns + right bullet space
    >{\leavevmode\llap{\textbullet~}\raggedright\arraybackslash}% Right bullet + formatting of column
    X% Right column specification
    @{}% No column space on right
  }
  Mary had a little lamb, & 
    Her fleece was white as snow. And everywhere that Mary went, the lamb was sure to go. \\
  Old MacDonald had a farm, & 
    E-I-E-I-O! And on this farm he had a cow, E-I-E-I-O! With a moo moo here, and a moo moo there.
\end{tabularx}

\end{document}

As mentioned, the column specification is the important thing here. Technically we only have 2 X-columns, each of which have a space of 1.5em on the left of it that is used to place a \textbullet inside. The look is similar to that of an itemize. The two columns have an additional \quad between them.

With the correct setup, the code for your construction should be fairly easy to read/interpret, and therefore be easily maintained.


Content can also be stretched vertically by adjusting \arraystretch accordingly. Headings and other tabular-related constructions are also easy to add, for example, the use of booktabs:

enter image description here

\documentclass{article}
\usepackage{tabularx,booktabs}
\newcommand{\fakeleft}{\multicolumn{1}{X}{}}
\let\fakeright\fakeleft
\begin{document}

\renewcommand{\arraystretch}{1.5}% Vertically stretch tabular constructions
\noindent
\begin{tabularx}{\textwidth}{
    @{\hspace{1.5em}}% Space for left bullet
    >{\leavevmode\llap{\textbullet~}\raggedright}% Left bullet + formatting of column
    X% Left column specification
    @{\quad\hspace{1.5em}}% Space between columns + right bullet space
    >{\leavevmode\llap{\textbullet~}\raggedright\arraybackslash}% Right bullet + formatting of column
    X% Right column specification
    @{}% No column space on right
  }
  \toprule
  \multicolumn{1}{X}{\centering\bfseries Left heading} &
    \multicolumn{1}{X}{\centering\bfseries Right heading} \\
  \midrule
  Mary had a little lamb, & 
    Her fleece was white as snow. And everywhere that Mary went, the lamb was sure to go. \\
  \fakeleft & 
    This is a right bullet without a left counterpart. \\
  Old MacDonald had a farm, & 
    E-I-E-I-O! And on this farm he had a cow, E-I-E-I-O! With a moo moo here, and a moo moo there. \\
  \bottomrule
\end{tabularx}

\end{document}

\fakeleft/\fakeright can be used interchangeably to produce a bullet without its opposite counterpart.

Werner
  • 603,163
  • It looks like the entire table is indented, relative to text. How can I get it to line up?
  • – Roger Filmyer Jan 28 '15 at 20:46
  • 1
    @RogerFilmyer: 1. For the headers left-aligned with text, use \multicolumn{1}{@{\hspace{1.5em}}l}{\bfseries Left heading} & \multicolumn{1}{@{}l}{\bfseries Right heading}. For headers left-aligned with bullets, use \multicolumn{1}{@{}l}{\bfseries Left heading} & \multicolumn{1}{@{\hspace{-1.5em}}l}{\bfseries Right heading} – Werner Jan 28 '15 at 20:55
  • 1
    @RogerFilmyer: 2. You'll note I used \noindent before \begin{tabularx} to avoid any indentation typically inserted by the paragraph. – Werner Jan 28 '15 at 20:56
  • @Werner: loading ltablex, you solution will break across pages. – Bernard Jan 28 '15 at 22:20