![Latex 弹出错误“!在文档类别 Elsevier {cas-sc} 中的表中插入了 \endgroup。我该如何解决这个问题?](https://linux22.com/image/428974/Latex%20%E5%BC%B9%E5%87%BA%E9%94%99%E8%AF%AF%E2%80%9C%EF%BC%81%E5%9C%A8%E6%96%87%E6%A1%A3%E7%B1%BB%E5%88%AB%20Elsevier%20%7Bcas-sc%7D%20%E4%B8%AD%E7%9A%84%E8%A1%A8%E4%B8%AD%E6%8F%92%E5%85%A5%E4%BA%86%20%5Cendgroup%E3%80%82%E6%88%91%E8%AF%A5%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%EF%BC%9F.png)
\documentclass[a4paper,fleqn]{cas-sc}
%\usepackage{float}
%\usepackage{flafter}
\newlength\bibsep % ??
\newcommand\theadb[1]{\multicolumn{1}{c}{\bfseries #1}}
\usepackage{booktabs,siunitx}
\begin{document}
\begin{table*}%[!htbp]
\centering
\caption{The 95\% prediction interval nominal.}
\label{tab:CI}
\begin{tabular}{@{} l *{16}{c} @{}}
\toprule
Hours &
\multicolumn{8}{c}{US utility GEFCOM-2012} &
\multicolumn{8}{c@{}}{ISO-NE control area} \\
\cmidrule(lr){2-9} \cmidrule(l){10-17}
&
\multicolumn{2}{c}{ANN} &
\multicolumn{2}{c}{LSTM} &
\multicolumn{2}{c}{CRBM} &
\multicolumn{2}{c}{FCDBN} &
\multicolumn{2}{c}{ANN} &
\multicolumn{2}{c}{LSTM} &
\multicolumn{2}{c}{CRBM} &
\multicolumn{2}{c@{}}{FCDBN} \\
\cmidrule(lr){2-3} \cmidrule(l){4-5} \cmidrule(l){6-7} \cmidrule(l){8-9} \cmidrule(l){10-11} \cmidrule(l){12-13} \cmidrule(l){14-15} \cmidrule(l){16-17}
& \theadb{Lower\\ bound} & \theadb{Upper\\ bound} & \theadb{Lower\\ bound} & \theadb{Upper\\ bound} & \theadb{Lower\\ bound} & \theadb{Upper\\ bound} & \theadb{Lower\\ bound} & \theadb{Upper\\ bound} & \theadb{Lower\\ bound} & \theadb{Upper\\ bound} & \theadb{Lower\\ bound} & \theadb{Upper\\ bound} & \theadb{Lower\\ bound} & \theadb{Upper\\ bound} & \theadb{Lower\\ bound} & \theadb{Upper\\ bound} \\
\midrule
01&4.4&6.0 &3.2 &3.9 &3.0 &3.9 &1.9 &2.5 &4.5&6.4 &3.1 &3.7 &3.1 &3.9 &1.7 &2.4 \\
02&4.6&6.1 &4.5 &5.1 &4.1 &4.5 &1.6 &1.9 &4.3&6.5 &4.3 &5.2 &4.3 &4.5 &1.5 &1.8\\
\bottomrule
\end{tabular}
\end{table*}
\end{document}
答案1
我建议
\newcommand\theadb[1]{\multicolumn{1}{c}{\bfseries #1}}
在之前的答案中,它符合您给出的示例,但c
列是单行。
这里使用多行输入,因此使用类似
\newcommand\theadb[1]{%
\multicolumn{1}{c}{\bfseries\begin{tabular}{@{}c@{}} #1\end{tabular}}}
因此该单元格是一个嵌套的表格,并将\\
按您的预期工作。