30

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.

1 Answer 1

33

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.

2
  • 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?
    – Leo
    Nov 7, 2011 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, 2018 at 4:19

You must log in to answer this question.

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