我正在 LaTeX 文档中使用longtabu
它作为表格。它在分页符处给出连线结果。请注意,表格的“继续”部分卡在分页符之前的页面中。
图片中显示的第 14 页除了下页内容外没有表格内容。这是我用来创建表格的代码。有什么建议可以解决这个问题吗?
\documentclass[a4paper,12pt, oneside]{book}
%enable linespacing commands%
\usepackage{setspace}
%used to import graphics%
\usepackage{graphicx}
%used for referencing%
\usepackage{harvard}
%customise chapter styles%
\usepackage{titlesec}
\titleformat{\chapter}{}{}{0em}{\bf\LARGE}
%set bibliography listing style to agsm%
\bibliographystyle{agsm}
%set margins%
\usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
%keep only the page number%
\pagestyle{plain}
%allows to create tables with different column widths%
\usepackage{tabularx}
%allows to create tables that can span accross pages%
\usepackage{longtable}%dependency of longtabu
\usepackage{tabu}%contains longtabu
\begin{document}
% begining of the table
\begin{longtabu} to \textwidth { l X[1 , l ] }
\label{table:cg_box_prop_types}\\
\caption{CG box properties}\\
% -----------------headings----------------------%
\hline
\textbf{Property}
&
\textbf{Variable type}
\\
\hline
\endfirsthead
%headings for next page columns
\hline
\textbf{Property}
&
\textbf{Variable type}
\\
\hline
\endhead
%this is printed before the table is broken into the next page
\multicolumn{2}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline
\endlastfoot
% ---------------headings end--------------------%
L, T, R, B, W, H, bg, ANG, AX, AY
&
CGuiNumber
\\
\hline
img, txt
&
CGuiString
\\
\end{longtabu}
% end of the table
\end{document}
编辑:我没有发布表格上方的内容。(我无法在此处发布它们)。我尝试通过在表格上方填充转储文本来重现该问题。但使用这些文本我无法重现该问题。
答案1
我不明白你的问题是什么。删除 MWE 中与禁忌长表无关的所有包后,我获得了预期结果:
我的 MWE:
\documentclass[a4paper,12pt,oneside]{book}
\usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{longtable,tabu}
\usepackage{lipsum}
\begin{document}
\pagestyle{plain}
\begin{longtabu} to \textwidth {l X[1,l]}
\caption{CG box properties}
\label{table:cg_box_prop_types} \\
% -----------------headings----------------------%
\hline
\textbf{Property} & \textbf{Variable type} \\
\hline
\endfirsthead
%headings for next page columns
\hline
\textbf{Property} & \textbf{Variable type} \\
\hline
\endhead
%this is printed before the table is broken into the next page
\multicolumn{2}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline
\endlastfoot
% ---------------headings end--------------------%
L, T, R, B, W, H, bg, ANG, AX, AY
& \lipsum[2-3] \\
\hline
img, txt
& \lipsum[4]
\end{longtabu}
\end{document}
该包lispum
用于生成第二列的虚拟文本。