我仍然在为我的表格而苦苦挣扎。我的新问题是我有一个长表,应该分成更多页。我正在尝试使用 longtable 包。到目前为止,我编写的代码是:
\documentclass{article}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{xcolor}
\usepackage[labelfont=bf]{caption}
\usepackage[utf8]{inputenc}
\usepackage{caption, booktabs, makecell, siunitx}
\usepackage{eqparbox}
\pagenumbering{gobble}
\usepackage{booktabs}
\usepackage[referable,para]{threeparttablex}
\usepackage[scale=.75]{geometry}
\captionsetup{font=bf}
\setlength{\textheight}{23.0cm}
\sisetup{group-separator={,}, table-format=1.3, table-space-text-post=***, table-number-alignment =center}
\begin{document}
\begin{longtable}{l*{8}{c}}
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{threeparttable}
\caption{Baseline model \label{table3}}
\centering\small
\hline\hline
&\multicolumn{2}{c}{(a)}&\multicolumn{2}{c}{(b)}&\multicolumn{2}{c}{(c)}&\multicolumn{2}{c}{(d)}\\
&\multicolumn{2}{c}{Fst Stage}&\multicolumn{2}{c}{Snd Stage}&\multicolumn{2}{c}{Fst Stage}&\multicolumn{2}{c}{Snd Stage}\\
\hline
\endfirsthead
\multicolumn{9}{l}
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
&\multicolumn{2}{c}{(a)}&\multicolumn{2}{c}{(b)}&\multicolumn{2}{c}{(c)}&\multicolumn{2}{c}{(d)}\\
&\multicolumn{2}{c}{Fst Stage}&\multicolumn{2}{c}{Snd Stage}&\multicolumn{2}{c}{Fst Stage}&\multicolumn{2}{c}{Snd Stage}\\
\endhead
\hline \multicolumn{9}{l}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011*** \\(0.001)&0.011*** \\(0.001)\\
\hline \hline
\begin{tablenotes}
\item [] abc
\end{table}
\end{threeparttable}
\end{longtable}
\end{document}
但是我收到以下错误消息
tab4_R.tex
20
Misplaced \noalign.
\caption ->\noalign
\bgroup \@ifnextchar [{\egroup \LT@c@ption \@firstofone ...
l.20 \caption
{Baseline model \label{table3}}
我不明白出了什么问题。有人能帮我解决吗?
答案1
如果确实需要,仅使用可以有脚注的环境longtable
。并且可以在 \begin{landscape} ... \end{landscape} 内用于非常宽的表格。需要包 pdflscape。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{xcolor}
\usepackage[labelfont=bf]{caption}
\usepackage{caption, booktabs, makecell, siunitx}
\captionsetup{font=bf}
\usepackage{eqparbox}
\pagenumbering{gobble}
\usepackage{booktabs}
\usepackage[scale=.75,textheight=23cm]{geometry}
\sisetup{group-separator={,}, table-format=1.3, table-space-text-post=***,
table-number-alignment =center}
\begin{document}
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{longtable}{l*{8}{c}}
\caption{Baseline model \label{table3}}\\\hline\hline
&\multicolumn{2}{c}{(a)}&\multicolumn{2}{c}{(b)}&\multicolumn{2}{c}{(c)}&\multicolumn{2}{c}{(d)}\\
&\multicolumn{2}{c}{Fst Stage}&\multicolumn{2}{c}{Snd
Stage}&\multicolumn{2}{c}{Fst Stage}&\multicolumn{2}{c}{Snd Stage}\\\hline
\endfirsthead
\hline
&\multicolumn{2}{c}{(a)}&\multicolumn{2}{c}{(b)}&\multicolumn{2}{c}{(c)}&\multicolumn{2}{c}{(d)}\\
&\multicolumn{2}{c}{Fst Stage}&\multicolumn{2}{c}{Snd
Stage}&\multicolumn{2}{c}{Fst Stage}&\multicolumn{2}{c}{Snd Stage}\\\hline
\endhead
\hline \multicolumn{9}{l}{\textit{Continued on next page}} \\
\endfoot
\hline\hline
\endlastfoot
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
SF & 0.011*** \\(0.001)&0.011*** \\(0.001) &0.011***
\\(0.001)&0.011*** \\(0.001)\\
\end{longtable}
\end{document}