2

I have a multicolumn list and I am a little limited in vertical space, for that reason I used the property leftmargin=* of itemize to get rid of some of the white space between the custom label and the actual text. But for some reason after a line break the indentation is wrong (see the first column). If I leave out leftmargin, then the indentation is right, but the space between label and text is too big. I tried to set everything manually how described in the documentation, but it never applies to the second line.

I try to avoid forced line breaks and the use of empty items item[]. How to solve this problem? Less space but correct indentation?

my minimal example:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\noindent texttexttexttext...
\hfill \\

\noindent\begin{minipage}[t]{0.45\textwidth}
{\centering \subsection*{Header 1}}
\begin{itemize}[align=left,leftmargin=*,labelsep=1ex]
\raggedright
\item[\textbf{foo}] thisisaverylongtext, which doesn't fit on one line
\item[\textbf{foo}] two
\item[\textbf{foo}] three
\item[\textbf{foo}] four
\end{itemize}
\end{minipage}
\kern.1\textwidth
\begin{minipage}[t]{0.45\textwidth}
{\centering \subsection*{Header 2}}
\begin{itemize}[align=left,labelsep=1ex]
\raggedright
\item[\textbf{foo}] thisisaverylongtext, which doesn't fit on one line
\item[\textbf{foo}] two.one \\ two.two
\item[\textbf{foo}] three
\item[\textbf{foo}] four
\end{itemize}
\end{minipage}

\end{document}

enter image description here

2

I guess this is what you want:

\documentclass{article}
\usepackage{enumitem}
\usepackage{showframe} % just for the example

\begin{document}

\noindent\begin{minipage}[t]{0.45\textwidth}
\subsection*{Header 1}
\begin{itemize}[
  align=left,
  leftmargin=2em,
  itemindent=0pt,
  labelsep=0pt,
  labelwidth=2em
]
\raggedright
\item[\textbf{foo}] thisisaverylongtext, which doesn't fit on one line
\item[\textbf{foo}] two.one \\ two.two
\item[\textbf{foo}] three
\item[\textbf{foo}] four
\end{itemize}
\end{minipage}\hfill
\begin{minipage}[t]{0.45\textwidth}
\subsection*{Header 2}
\begin{itemize}[align=left,labelsep=1ex]
\raggedright
\item[\textbf{foo}] thisisaverylongtext, which doesn't fit on one line
\item[\textbf{foo}] two.one \\ two.two
\item[\textbf{foo}] three
\item[\textbf{foo}] four
\end{itemize}
\end{minipage}

\end{document}

enter image description here

Use whatever length you think fit instead of 2em.

|improve this answer|||||
  • Thanks for the fast help. leftmargin and labelwidth need to have the same width, I never considered that before, which was the problem I guess. – thewaywewalk Oct 1 '14 at 12:38
  • If it's always the same label, one could simplify the code with the optional argument label=\textbf{foo}. – Bernard Oct 1 '14 at 12:40
  • @Bernard its a pro and contra list with plus and minus signs, so they all have the same width but are not equal. But thanks for the suggestion. – thewaywewalk Oct 1 '14 at 12:46

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.