22

I am using longtable instead of tabular environment and noticed that it puts some additional whitespace at the top and at the bottom of the table. Is there some way to remove it (something less hacky than \vskip -\baselineskip before the table)?

Small piece of code for illustration:

\documentclass[12pt]{book}
\usepackage{longtable}

\begin{document}

Linelineline

\begin{longtable}{l l} cell1 & cell2 \end{longtable}

Linelineline

\begin{tabular}{l l} cell1 & cell2 \end{tabular}

Linelineline

\end{document}

And that's what I am getting:

tables

Common tabular environment does not have any additional margins, but longtable does.

25

To remove the whitespace before and after a longtable, you may change the lengths \LTpre and \LTpost:

\setlength{\LTpre}{0pt}
\setlength{\LTpost}{0pt}

Their default value is \bigskipamount.

  • Just what I needed, thanks. May I also ask what I have to write to get rid of the top and bottom space when using enumerate? – Leon Nov 7 '11 at 3:00
  • What I needed was actually \setlength{\LTpre}{15pt} and \setlength{\LTpost}{-5pt}, but perhaps that’s due to my usage of ltablex instead of longtable (which is based on the latter, though) and a different document class. When using \the, both were reported as 12.0pt plus 4.0pt minus 4.0pt, though. Strange. – caw Dec 3 '18 at 4:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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