我正在尝试在环境memoir
中使用类longtable
,但没有成功:
\documentclass{memoir}
\usepackage{longtable}
\begin{document}
\begin{longtable}
\centering
\caption{Caption of the normal \texttt{table} environment.}
\begin{tabular}{rrrrrrrrr}
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1
\end{tabular}
\label{table}
\end{longtable}
\end{document}
执行错误:
test2.tex:7: Class memoir Error: Illegal pream-token (\centering): `c' used. [ \centering]
更改longtable
bytable
确实可以正常工作,没有任何错误或警告。如何使longtable
to 也能正常工作?
相关问题:
答案1
\centering
对于长表格是自动的,并且标题是环境的一部分。因此请尝试使用以下语法:
\begin{longtable}{*{8}{c}}
\caption{Caption of the normal \texttt{table} environment.}
\label{table}\\
\endfirsthead
\multicolumn{8}{c}{\tablename~\thetable\enspace(continued)}\\
\endhead
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1
\end{longtable}