1

longtable without the head row starts not from the top of the page, but has offset. Is it a bug or a feature? How can I fix it?

MWE:

\documentclass[twoside]{article}

\usepackage[paper=a5paper,left=10mm,right=15mm,top=15mm,bottom=20mm,
showframe]{geometry}

\usepackage{longtable}

\newcounter{iii}
\setcounter{iii}{1}
\newcommand{\myrow}{\hline\theiii\stepcounter{iii}\\}

\begin{document}
\LTpre=0pt
\raggedbottom
\fontsize{30}{60}\selectfont
\begin{longtable}{|l|}

    \myrow \myrow \myrow \myrow \myrow \myrow \myrow \myrow
    \myrow \myrow \myrow \myrow \myrow \myrow \myrow \myrow
    \myrow \myrow \myrow

\end{longtable}

\newpage
\begin{longtable}{|l|}
\hline numbers\\
\endhead
    \myrow \myrow \myrow \myrow \myrow \myrow \myrow \myrow
    \myrow \myrow \myrow \myrow \myrow \myrow \myrow \myrow
    \myrow \myrow \myrow
\end{longtable}
\end{document}

Compare 3 upper and 3 lower pages

2
  • Maybe the question should be reversed: Is it ever proper to use a longtable environment without providing \endfirsthead, \endhead, \endfoot, and \endlastfoot directives? Put differently, what is supposed to be achieved by creating a table with proper header (and footer) information?
    – Mico
    Commented Apr 25, 2017 at 13:26
  • @Mico What package should I use to get the multipage table without running headers?
    – pantlmn
    Commented Apr 25, 2017 at 15:31

1 Answer 1

2

The length \topskip is used to move the baseline down from the top of the text area so that the first line of text fits. Evidently longtable starts under the current baseline.

\documentclass[twoside]{article}

\usepackage[paper=a5paper,left=10mm,right=15mm,top=15mm,bottom=20mm,
showframe]{geometry}

\usepackage{longtable}

\newcounter{iii}
\setcounter{iii}{1}
\newcommand{\myrow}{\hline\theiii\stepcounter{iii}\\}


\begin{document}
\bgroup
\topskip=0pt
\LTpre=0pt
\raggedbottom
\fontsize{30}{60}\selectfont
\begin{longtable}{|l|}
    \myrow \myrow \myrow \myrow \myrow \myrow \myrow \myrow
    \myrow \myrow \myrow \myrow \myrow \myrow \myrow \myrow
    \myrow \myrow \myrow
\end{longtable}
\egroup

\end{document}
2
  • And what is the default value of \topskip?
    – pantlmn
    Commented Apr 27, 2017 at 5:29
  • About 10pt. Don't worry, it will automatically be restored at \egroup. Commented Apr 27, 2017 at 12:58

You must log in to answer this question.

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