7

The paralist package offers the option of typesetting an itemized list with a \topsep length of zero, and this is especially useful in a tabular setting. However, the following minimal example does not seem to remove the space at the top of the second column as would be expected when compiled with pdflatex.

\documentclass{article}
\usepackage{paralist}
\setlength{\pltopsep}{0pt}
\setlength{\plpartopsep}{0pt}

\begin{document}
\begin{tabular}{p{20mm} p{50mm}}
  Itemize: & {%
  \begin{compactitem}
    \item First item
  \end{compactitem}}\\
  Enumerate: & {% 
  \begin{enumerate}
    \item First item
  \end{enumerate}}\\
  Description: & {%
  \begin{description}
    \item[Descriptor] First item
  \end{description}}\\
\end{tabular}
\end{document

Can someone explain how I might get the first line of the second column to line up with the first line of the first column, please?

I can workaround with a negative \vspace before the respective list environments but I want a more elegant solution which I think paralist is supposed to provide.

1 Answer 1

6

Within a minipage this undesired top space would not be inserted. So, similar to the solution in Preventing itemize environment to insert initial vertical space, you could insert \@minipagetrue into the respective cells:

\usepackage{array}
\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother
\begin{tabular}{p{20mm}>{\compress}p{50mm}}
...

Your example code is fixed by this, the lines line up:

list example

Alternatively, you could define a column type for that:

\usepackage{array}
\makeatletter
\newcolumntype{P}[1]{>{\@minipagetrue}p{#1}}
\makeatother
3
  • 2
    I was just going to suggest \newcolumntype{P}[1]{>{\minipage{#1}\arraybackslash}l<{\endminipage\null}}, but this is nicer! However you could post this as \newcolumntype as well. Should be easier to handle this is required more then once. Feb 7, 2011 at 18:33
  • @Martin: Great idea! I added such a type declaration.
    – Stefan Kottwitz
    Feb 7, 2011 at 18:46
  • 3
    If hyperref is loaded for one or other reason it leaves a space before enumerate. Therefor use \newcommand*{\compress}{\@minipagetrue\NoHyper}. See the post How to include enumerate in tabular? tex.stackexchange.com/questions/11541/…
    – Danie Els
    Apr 10, 2011 at 13:42

You must log in to answer this question.

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