無頭排長桌

無頭排長桌

longtable沒有標題行不是從頁面頂部開始,而是有偏移。這是一個錯誤還是一個功能?我該如何修復它?

微量元素:

\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}

比較 3 個上頁和 3 個下頁

答案1

此長度\topskip用於將基線從文字區域的頂部向下移動,以便適合第一行文字。顯然 longtable 是在目前基準下啟動的。

\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}

相關內容