Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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
share|improve this answer
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. –  Martin Scharrer Feb 7 '11 at 18:33
    
@Martin: Great idea! I added such a type declaration. –  Stefan Kottwitz Feb 7 '11 at 18:46
2  
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 '11 at 13:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.