With the environment longtable we make a table crossing the page boundary. If a table has a head (\endhead command), longtable works perfectly: the baseline of the first line in a usual text page and the baseline of the first line of text in the table are coinside.

longtable with head

But, if a table doesn't have a head, the baseline of the first line of text in the table is lower then the baseline of the first line in a usual text page.

longtable without head

How to reduce the space between top of a page and a table without head?

Is it possible to slightly modify the longtable package so that all tables in a document would be fixed?






  Header & Header \\
 %\endhead %% Uncomment this line for table with head
  \lipsum[2] & \lipsum[2] \\
  \lipsum[2] & \lipsum[2] \\

  • 1
  • @John, thank you for pointing that. Вut setting \topskip to 0pt doesn't solve the problem. Actually, we should reduce \topskip by some amount of space. In my case, this amount is height of vertical rule, which presents part of left border of the first cell. It depends on the content of the first lines of top table cells. In my case it is always 8.4pt, because font doesn't change and lines contain only letters, and start with capital letters. This \topskip later will be reduced by 0.4pt, the thickness of top border. I think, it can be somehow implemented in longtable.sty. Jan 31, 2018 at 5:18
  • it's not really that it doesn't have a head, more that the first thing is an \hline and so that aligns on the first baseline. Probably the easiest thing is to always have a head, if you put the hline and the first row in \endfirsthead then it should work I think. You don't need to have a head on the later pages. Jan 31, 2018 at 7:47
  • You're right, @David. Space before table is correct without \hline. But \endfirsthead without \endhead doesn't solve problem. Jan 31, 2018 at 9:31
  • @John, in my case the simpliest way is to put \topskip=1.6pt. But it is too simple. ;-) Jan 31, 2018 at 9:34

2 Answers 2


You can use \firsthline from the array package instead of \hline:

 \tikz[overlay,remember picture] \draw[red] ([yshift=-2cm-\topskip]current page.north west) -- ++(\textwidth,0);}

some text


enter image description here enter image description here enter image description here

  • It works only for the second page of a table, but doesn't for the third. Jan 31, 2018 at 9:13
  • If this means that you want to repeat the header line on following pages than setting topskip locally is probably your best option beside patching longtable. An alternative is to check for the first line on a page and draw the header line with tikz instead of using \endhead (see tex.stackexchange.com/a/384925/2388 for a first line check). Jan 31, 2018 at 10:07

The next patch to longtable works for me, assuming that if \hline is present in table, it is present after all \\.

% Adjustment of longtable environment
% Save original definitions
% Remember, there was \hline
% Forget about \hline, store initial value of \topskip
% Adjust \topskip, if there was \hline and wasn't \endhead
  \global\advance\topskip by -\ht\@arstrutbox
% Restore \topskip

You must log in to answer this question.

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