9

All the tricks to remove vertical space before and after itemize lists (using enumitem) seem to work well in table/tabular environments, but not in longtable. The following MWE illustrates the difficulty I'm having to get the First bullet at the same level as the Left item.

\documentclass[letterpaper,12pt]{book}

\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother

\usepackage{enumitem}
\usepackage{longtable}

\begin{document}

\begin{table}
\begin{center}
\begin{tabular}{lp{4cm}}
Header1  &  Header2  \\
Left item  &  
\compress\begin{itemize}[leftmargin=1em,noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]
 \item First bullet
 \item Second bullet
 \item Third bullet
\end{itemize}  \\
\end{tabular}
\end{center}
\end{table}

\begin{longtable}[htbp]{lp{12.25cm}}
Header1  &  Header2  \\
Left item  &   
\compress\begin{itemize}[leftmargin=1em,noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]
 \item First bullet
 \item Second bullet
 \item Third bullet
\end{itemize}  \\
\end{longtable}

\end{document}

Here, even the \compress command fails to remove the space in longtable. Note that I need longtable, as some of my lists will be quite long and will need to be split. (Also, I'm not sure why I need to specify a fixed width for the second column ({lp{4cm}}) instead of {ll}.)

Many thanks in advance.

1
  • Have you tried the paralist package? I personally use the inparaitem to solve that problem. Jan 17, 2013 at 6:38

1 Answer 1

8
Left item  &
\noindent\par
\vspace{-\baselineskip}
\compress\begin{itemize}

It could be better, but that's how it is, sorry.

To answer your second question an l entry is like \mbox so horizontal mode (LR mode in the LaTeX Book) so does not allow line breaking or display environments like lists.

3
  • Thanks for the second point. As for the first, I was hoping for a more elegant solution (a preamble setting that had eluded me), or an admission that this was a known limitation of longtable that would be fixed shortly. Jan 16, 2013 at 21:45
  • Given that you are the author of longtable, I'll take your solution to my main point as definitive. :) Jan 16, 2013 at 21:52
  • 3
    It's not a longtable feature it comes from the underlying tabular implementation you'll see the same putting a standard latex enumerate in a standard tabular. It's actually quite hard to fix automatically although of course the mess could be hidden in a better looking macro (much as \arraybackslash makes the nasty mis-match between tabular and \raggedright almost documentable. (short version: it:s not my fault) Jan 16, 2013 at 22:41

You must log in to answer this question.

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