3

I need three item lists next to each other, with a centered heading for each list. Using the multicol-package doesn't seem to fit my needs as it doesn't allow me to fill my columns independently, does it?

Putting everything into a table, does not seem to be appropriate neither.

I came up with a solution using minipage, though it feels like overkill, it's quite close to what I want. But I can't manage to arrange the minipages side by side with some spacing between the columns. How to get the three minipages to use 100% of the space, let's say:

30% column one, 5% space, 30% column two, 5% space, 30% column three

I tried it with \hspace but it didn't worked out.

\documentclass[11pt,a4paper]{article}%
\usepackage{enumitem}

\begin{document}

\begin{minipage}[t]{0.30\textwidth}
{\centering \subsection*{Header 1}}
\begin{itemize}[align=left,leftmargin=*,labelsep=1ex]
\item one one one one one one
\item two
\item three
\item four
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.30\textwidth}
{\centering \subsection*{Header 2}}
\begin{itemize}[align=left,leftmargin=*,labelsep=1ex]
\item one one one one one one
\item two.one \\ two.two
\item three
\item four
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.30\textwidth}
{\centering \subsection*{Header 3}}
\begin{itemize}[align=left,leftmargin=*,labelsep=1ex]
\item one one one one one one
\item two
\item three
\end{itemize}
\end{minipage}

\end{document}

enter image description here

Is there anything much easier to achieve what I want?

  • Please see revision. David pointed out that I had two extra spaces, which needed to be removed with the addition of several strategically placed percent symbols. – Steven B. Segletes Oct 1 '14 at 14:36
1

You needed not only the intercolumn space added, but also a \noindent before the first minipage. Elsewise, you exceeded the column width. Indeed, minipages are a good way to handle this sort of multicolumn problem.

REVISED to remove 2 stray spaces that David pointed out, by inserting line-end percent signs.

\documentclass[11pt,a4paper]{article}%
\usepackage{enumitem}

\begin{document}

\noindent\begin{minipage}[t]{0.30\textwidth}
{\centering \subsection*{Header 1}}
\begin{itemize}[align=left,leftmargin=*,labelsep=1ex]
\item one one one one one one
\item two
\item three
\item four
\end{itemize}
\end{minipage}%
\kern.05\textwidth%
\begin{minipage}[t]{0.30\textwidth}
{\centering \subsection*{Header 2}}
\begin{itemize}[align=left,leftmargin=*,labelsep=1ex]
\item one one one one one one
\item two.one \\ two.two
\item three
\item four
\end{itemize}
\end{minipage}%
\kern.05\textwidth%
\begin{minipage}[t]{0.30\textwidth}
{\centering \subsection*{Header 3}}
\begin{itemize}[align=left,leftmargin=*,labelsep=1ex]
\item one one one one one one
\item two
\item three
\end{itemize}
\end{minipage}

\end{document}

enter image description here

  • 2
    Overfull \hbox (4.87216pt too wide) in paragraph at lines 6--34 (.3+.3+.3+.05+.05)\textwidth+2 word spaces is two word spaces too much:-) \end{minipage}%%%%%%%%%%%%%% – David Carlisle Oct 1 '14 at 13:26
  • @DavidCarlisle Ooops. Fixed. – Steven B. Segletes Oct 1 '14 at 14:35
  • @StevenB.Segletes Good to know! I finally got what purpose actually have the often seen % at the end of various commands. – thewaywewalk Oct 1 '14 at 14:44
  • 1
    @thewaywewalk Indeed, see tex.stackexchange.com/questions/7453/… – Steven B. Segletes Oct 1 '14 at 14:55
2

Just in order to show a table solution:

% arara: pdflatex

\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage[inline]{enumitem}
\newcommand*\myTableHeader[1]{\multicolumn{1}{c}{\large\textbf{#1}}}

\begin{document}
\noindent\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}@{}}
    \myTableHeader{Header 1} & \myTableHeader{Header 2} & \myTableHeader{Header 3} \\\addlinespace
    \begin{itemize*}[itemjoin={\newline}]
        \item one one one one one one
        \item two
        \item three
        \item four
    \end{itemize*}
    &
    \begin{itemize*}[itemjoin={\newline}]
        \item one one one one one one
        \item two.one \newline two.two
        \item three
        \item four
    \end{itemize*}
    &
    \begin{itemize*}[itemjoin={\newline}]
        \item one one one one one one
        \item two
        \item three
    \end{itemize*}\\
\end{tabular*}
\end{document}

enter image description here


Update:

You can still use your old itemize definitions here. But for this, you have to manipulate the height of the white space in front of the second row. The image shows the result without correction. The code already contains a \vspace{-10pt} which would look quite well.

\documentclass{article}
\usepackage{array}
\usepackage{enumitem}
\newcommand*\myTableHeader[1]{\multicolumn{1}{c}{\large\textbf{#1}}}

\begin{document}
\noindent\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}@{}}
    \myTableHeader{Header 1} & \myTableHeader{Header 2} & \myTableHeader{Header 3} \vspace{-10pt}\\
    \begin{itemize}[align=left, leftmargin=*,labelsep=1ex]
        \item one one one one one one
        \item two
        \item three
        \item four
    \end{itemize}
    &
    \begin{itemize}[align=left, leftmargin=*,labelsep=1ex]
        \item one one one one one one
        \item two.one \newline two.two
        \item three
        \item four
    \end{itemize}
    &
    \begin{itemize}[align=left, leftmargin=*,labelsep=1ex]
        \item one one one one one one
        \item two
        \item three
    \end{itemize}\\
\end{tabular*}
\end{document}

enter image description here

  • \\ does not work for a new line within an item, \newline does not really what it should in this case and even if there is no forced linebreak, it's not aligned. Do you see a solution for that? – thewaywewalk Oct 1 '14 at 11:36
  • 1
    @thewaywewalk Yes, \\ will not work, as this is something else in a table. But \newline should be easy to read as well. Please see my update! – LaRiFaRi Oct 1 '14 at 11:45

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.