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.

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.

share|improve this question
    
Have you tried the paralist package? I personally use the inparaitem to solve that problem. –  Nathanael Farley Jan 17 '13 at 6:38
add comment

1 Answer

up vote 8 down vote accepted
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.

share|improve this answer
    
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. –  Olivier Drolet Jan 16 '13 at 21:45
    
Given that you are the author of longtable, I'll take your solution to my main point as definitive. :) –  Olivier Drolet Jan 16 '13 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) –  David Carlisle Jan 16 '13 at 22:41
    
+1 David strikes again ;) –  nutty about natty Jul 6 '13 at 20:10
add comment

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.