嗨,我是 Latex 新手,有一张表不断出现错误,并出现“错位 \omit”错误。有人能帮我找出问题所在吗?代码如下。谢谢
\begin{table}
\TABLE
{Return Lag and Return Rate Descriptive Statistics for Electronics Dataset \label{tab:testa}}
{\begin{tabular}{lccccccc} \hline
\up \down & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & Total Observations \\ \cline{2-8}
\up \down \multicolumn{1}{c}{Category} & Average & Std. Dev. & Coeff. of Var. & Average & Std. Dev. & Coeff. of Var. \\ \hline
\up Audio & 12\% & 0.32 & 2.76 & 12.9 & 20.0 & 1.6 & 11,367 \\
Auto Parts & 14\% & 0.35 & 2.44 & 21.9 & 54.1 & 2.5 & 7,211 \\
Cable & 11\% & 0.31 & 2.91 & 10.9 & 19.8 & 1.8 & 9,398 \\
Computer & 11\% & 0.31 & 2.90 & 11.1 & 23.0 & 2.1 & 21,811 \\
Imaging & 11\% & 0.31 & 2.92 & 11.8 & 19.9 & 1.7 & 7,823 \\
Mobile Phone & 16\% & 0.37 & 2.27 & 28.9 & 74.4 & 2.6 & 3,126 \\
Phone & 14\% & 0.35 & 2.47 & 16.1 & 30.6 & 1.9 & 5,777 \\
TV & 8\% & 0.28 & 3.28 & 11.3 & 21.5 & 1.9 & 9,413 \\
TV Box & 14\% & 0.34 & 2.52 & 14.7 & 28.5 & 1.9 & 9,799 \\
\down \textbf{Sample Average} & \textbf{12\%} & \textbf{0.33} & \textbf{2.72} & \textbf{15.5} & \textbf{32.4} & \textbf{2.0} & \textbf{1,201.05} \\ \hline
\end{tabular}}%
{}
\end{table}%
答案1
不能将文本与 放在同一个单元格中\multicolumn
。将此文本移到里面,即转换
\up \down \multicolumn{1}{c}{Category}
进入
\multicolumn{1}{c}{\up \down Category}
\documentclass{article}
\newcommand\up{?}
\newcommand\down{??}
\begin{document}
\begin{tabular}{lccccccc} \hline
\up \down & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & Total Observations \\ \cline{2-8}
\multicolumn{1}{c}{\up \down Category} & Average & Std. Dev. & Coeff. of Var. & Average & Std. Dev. & Coeff. of Var. \\ \hline
\up Audio & 12\% & 0.32 & 2.76 & 12.9 & 20.0 & 1.6 & 11,367 \\
Auto Parts & 14\% & 0.35 & 2.44 & 21.9 & 54.1 & 2.5 & 7,211 \\
Cable & 11\% & 0.31 & 2.91 & 10.9 & 19.8 & 1.8 & 9,398 \\
Computer & 11\% & 0.31 & 2.90 & 11.1 & 23.0 & 2.1 & 21,811 \\
Imaging & 11\% & 0.31 & 2.92 & 11.8 & 19.9 & 1.7 & 7,823 \\
Mobile Phone & 16\% & 0.37 & 2.27 & 28.9 & 74.4 & 2.6 & 3,126 \\
Phone & 14\% & 0.35 & 2.47 & 16.1 & 30.6 & 1.9 & 5,777 \\
TV & 8\% & 0.28 & 3.28 & 11.3 & 21.5 & 1.9 & 9,413 \\
TV Box & 14\% & 0.34 & 2.52 & 14.7 & 28.5 & 1.9 & 9,799 \\
\down \textbf{Sample Average} & \textbf{12\%} & \textbf{0.33} & \textbf{2.72} & \textbf{15.5} & \textbf{32.4} & \textbf{2.0} & \textbf{1,201.05} \\ \hline
\end{tabular}
\end{document}