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.
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.
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?
\documentclass{article}
\usepackage[a5paper]{geometry}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{longtable}
\pagestyle{fancy}
\rhead{\thepage}
\lhead{\thepage}
\begin{document}
\lipsum[2]
\begin{longtable}{|p{0.4\textwidth}|p{0.4\textwidth}|}
\hline
Header & Header \\
%\endhead %% Uncomment this line for table with head
\hline
\lipsum[2] & \lipsum[2] \\
\hline
\lipsum[2] & \lipsum[2] \\
\hline
\end{longtable}
\end{document}





\topskipto 0pt doesn't solve the problem. Actually, we should reduce\topskipby 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
\topskiplater will be reduced by 0.4pt, the thickness of top border.I think, it can be somehow implemented in
longtable.sty. – Alexander Balyuk Jan 31 '18 at 05:18\hlineand 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\endfirstheadthen it should work I think. You don't need to have a head on the later pages. – David Carlisle Jan 31 '18 at 07:47\hline. But\endfirstheadwithout\endheaddoesn't solve problem. – Alexander Balyuk Jan 31 '18 at 09:31\topskip=1.6pt. But it is too simple. ;-) – Alexander Balyuk Jan 31 '18 at 09:34