3

I am using the paralist package to create very compact lists (for a poster). I'd like to use

\setdefaultleftmargin{0em}{2em}{}{}{}{}

to set the indentation of itemized lists to zero. This works fine unless I have long lines that are wrapped: then the indentation of the wrapped text is too small.

Example code (live example):

\documentclass[a4paper]{article}

\usepackage{paralist}

\begin{document}

\setlength{\parindent}{0em}
\setdefaultleftmargin{0em}{2em}{}{}{}{}

(I have also set the indentation of paragraphs to 0.)
\begin{compactitem}
    \item I want the bullet to be right at the left border.
    \item foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar \textbf{This second line is not properly aligned :(}
    \begin{compactitem}
        \item foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar \textbf{Here it's correct.}
    \end{compactitem}
\end{compactitem}



With non-zero indentation it works as it should:
\setdefaultleftmargin{2em}{2em}{}{}{}{}
\begin{compactitem}
    \item foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar \textbf{correct}
    \begin{compactitem}
        \item foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar \textbf{correct}
    \end{compactitem}
\end{compactitem}


\end{document}

How do I fix this?

2 Answers 2

5

You probably want to use enumitem, which is more powerful than paralist.

\documentclass[a4paper]{article}

\usepackage{enumitem}

\begin{document}

\setlength{\parindent}{0em}

(I have also set the indentation of paragraphs to 0.)
\begin{itemize}[nosep,leftmargin=1em,labelwidth=*,align=left]

\item I want the bullet to be right at the left border.

\item foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar
foobar foobar \textbf{This second line is properly aligned}

\end{itemize}
Some text follows.

\end{document}

enter image description here

1

Based on egreg's answer, I am now using this code as a replacement for the compactlist defined in the paralist package:

\usepackage{enumitem}
\newlist{compactitem}{itemize}{3} % 3 is max-depth
\setlist[compactitem]{label=\textbullet, nosep}

To make nosep work, I had to download the latest version of the enumitem package.

(Before upgrading enumitem I had tried without nosep:

\setlist[compactitem]{label=\textbullet, leftmargin=1em, labelindent=0.1em, itemsep=0em, parsep=0em}

but that left some separation between the list and the preceding paragraph.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .