\documentclass[letterpaper]{article}
\usepackage{longtable} % Longtable package
\usepackage[margin=1in]{geometry} % Margins
\usepackage{booktabs} % Nicer horizontal lines
\begin{document}
\begin{longtable}{ l l }
\caption{Heading} \\ \toprule % toprule, midrule, and bottomrule are the horizontal lines
Left Heading & Right Heading \\ \midrule
\endhead
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\ \bottomrule
\end{longtable}
\end{document}
上述代码产生以下结果:
但这是我在第二页想要的(这显然是 MS Paint 的产品,但请耐心等待) :!
那么我该怎么做呢?
答案1
用于\endfirsthead
第一个标题和\endhead
所有其他页面。
\documentclass[letterpaper]{article}
\usepackage{longtable} % Longtable package
\usepackage[margin=1in]{geometry} % Margins
\usepackage{booktabs} % Nicer horizontal lines
\begin{document}
\begin{longtable}{ l l }
\caption{Heading} \\ \toprule % toprule, midrule, and bottomrule are the horizontal lines
Left Heading & Right Heading \\ \midrule
\endfirsthead
\caption{Heading (cont.)} \\ \toprule % toprule, midrule, and bottomrule are the horizontal lines
Left Heading & Right Heading \\ \midrule
\endhead
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\
Left cell & Right cell \\ \bottomrule
\end{longtable}
\end{document}