![threeparttable 无法识别的命令](https://linux22.com/image/307415/threeparttable%20%E6%97%A0%E6%B3%95%E8%AF%86%E5%88%AB%E7%9A%84%E5%91%BD%E4%BB%A4.png)
我有以下包裹:
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{miscdoc}
\usepackage{pdflscape}
\usepackage{makeidx}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{longtable}
我有三个这样的表格:
\begin{table}[htbp]
\centering
\begin{threeparttable}
\caption{ML Estimates pre ethanol boom period}
\begin{tabular}{lrrrrrr}
\toprule
& \multicolumn{1}{c}{$\lambda_{1}$ CP} & \multicolumn{1}{c}{$\lambda_{2} $ CP} & \multicolumn{1}{c}{$\lambda_{1} $ EP} & \multicolumn{1}{c}{$\lambda_{2} $ EP} & \multicolumn{1}{c}{$\lambda_{1} $ OP} & \multicolumn{1}{c}{$\lambda_{2} $ OP} \\
\midrule
Estimate & 0.5515** & 0.1946 & 0.7614** & 0.1208 & 0.7325** & 0.1528 \\
Std Error & 0.1494 & 0.0695 & 0.1593 & 0.0573 & 0.1196 & 0.0486 \\
T-Stat & 3.6906 & 2.7995 & 4.7782 & 2.1098 & 6.1242 & 3.1425 \\
\bottomrule
\end{tabular}%
\begin{tablenotes}
\small
\begin{enumerate}
\item Double asterisks (**) represent significance at the 5\% level.
\item Maximized Log-Likelihood = 1071.1
\item $\delta_{1}=0.9409 (0.1014)$ and $\delta_{2}=0.0125 (0.0132)$
\item $df=8.86$
\end{enumerate}
\end{tablenotes}
它显示无法识别的命令,\begin{tablenotes}
并且 \end{tablenotes}
它编译但被标记为错误,并且不允许我在页面之间切换。有人能帮帮我吗
答案1
请勿enumerate
在里面使用tablenotes
。
\documentclass{article}
\usepackage{booktabs}
\usepackage{threeparttable}
\begin{document}
\begin{table}[htbp]
\centering
\begin{threeparttable}
\caption{ML Estimates pre ethanol boom period}
\begin{tabular}{lrrrrrr}
\toprule
& \multicolumn{1}{c}{$\lambda_{1}$ CP} & \multicolumn{1}{c}{$\lambda_{2} $ CP} & \multicolumn{1}{c}{$\lambda_{1} $ EP} & \multicolumn{1}{c}{$\lambda_{2} $ EP} & \multicolumn{1}{c}{$\lambda_{1} $ OP} & \multicolumn{1}{c}{$\lambda_{2} $ OP} \\
\midrule
Estimate & 0.5515** & 0.1946 & 0.7614** & 0.1208 & 0.7325** & 0.1528 \\
Std Error & 0.1494 & 0.0695 & 0.1593 & 0.0573 & 0.1196 & 0.0486 \\
T-Stat & 3.6906 & 2.7995 & 4.7782 & 2.1098 & 6.1242 & 3.1425 \\
\bottomrule
\end{tabular}%
\begin{tablenotes}[flushleft]
\item[1] Double asterisks (**) represent significance at the 5\% level.
\item[2] Maximized Log-Likelihood = 1071.1
\item[3] $\delta_{1}=0.9409 (0.1014)$ and $\delta_{2}=0.0125 (0.0132)$
\item[4] $df=8.86$
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
答案2
正如 @HarishKumar 已经指出的那样,不要将环境\item
的 s嵌入tablenotes
到某个enumerate
部分中。(如果您好奇的话:它们已经嵌入到环境中了itemize
。)此外,由于表格注释似乎没有直接链接到材料的任何特定部分tabular
,因此我将threeparttable
使用选项加载包。最后,我会将数字排列在它们的小数点标记上。这可以通过加载包及其列类型flushleft
来完成。dcolumn
D
\documentclass{article}
%\usepackage{amsmath} % commented out all packages not needed for the MWE
%\usepackage{amssymb}
%\usepackage{textcomp}
%\usepackage{graphicx}
%\usepackage{setspace}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
%\usepackage{miscdoc}
%\usepackage{pdflscape}
%\usepackage{makeidx}
%\usepackage{multirow}
%\usepackage{multicol}
%\usepackage{longtable}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{l@{}}{#1}} % handy shortcut macro
\begin{document}
\begin{table}[htbp]
\centering
\begin{threeparttable}
\caption{ML Estimates pre ethanol boom period}
\begin{tabular}{@{} l *{3}{d{1.6} d{1.4}} @{}}
\toprule
& \mc{$\lambda_{1}$ CP} & \mc{$\lambda_{2}$ CP} & \mc{$\lambda_{1}$ EP}
& \mc{$\lambda_{2}$ EP} & \mc{$\lambda_{1}$ OP} & \mc{$\lambda_{2}$ OP} \\
\midrule
Estimate & 0.5515^{**} & 0.1946 & 0.7614^{**} & 0.1208 & 0.7325^{**} & 0.1528 \\
Std Error & 0.1494 & 0.0695 & 0.1593 & 0.0573 & 0.1196 & 0.0486 \\
T-Stat & 3.6906 & 2.7995 & 4.7782 & 2.1098 & 6.1242 & 3.1425 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\small
\item Double asterisks ($^{**}$) represent significance at the 5\% level.
\item Maximized Log-Likelihood${} = 1071.1$
\item $\delta_{1}=0.9409\ (0.1014)$ and $\delta_{2}=0.0125\ (0.0132)$
\item $df=8.86$
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}