![此代码对于 IEEE ACCESS 文档类 \documentclass{ieeeaccess} 不可执行。生成如下错误:1.23}?](https://linux22.com/image/406789/%E6%AD%A4%E4%BB%A3%E7%A0%81%E5%AF%B9%E4%BA%8E%20IEEE%20ACCESS%20%E6%96%87%E6%A1%A3%E7%B1%BB%20%5Cdocumentclass%7Bieeeaccess%7D%20%E4%B8%8D%E5%8F%AF%E6%89%A7%E8%A1%8C%E3%80%82%E7%94%9F%E6%88%90%E5%A6%82%E4%B8%8B%E9%94%99%E8%AF%AF%EF%BC%9A1.23%7D%EF%BC%9F.png)
\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{algorithmic}
\begin{document}
\begin{table}
\centering
\caption{Evaluation of the proposed FA-HELF model and the benchmark}
\label{tab:Y_Forecast}
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\columnwidth}{
@{\extracolsep{\fill}}
l
S[table-format=1.4]
S[table-format=1.4]
S[table-format=1.4]
S[table-format=1.4]
S[table-format=1.4]
@{}
}
\toprule
& \multicolumn{5}{c}{Proposed} \\
\cmidrule{2-6}
\thead{Months}
& {\thead{SDPSO-ELM \\ MAPE \\(\%)}}
& {\thead{F-RBF-CNN\\ MAPE \\(\%)}}
& {\thead{SSA-SVM-CS\\ MAPE \\(\%)}}
& {\thead{FA-HELF \\ MAPE\\(\%)}} \\
\midrule
Jan & 2.22 & 1.67 & 1.55 & 0.414\\
\midrule
Avg.& 2.12 & 1.79 & 1.44 & 0.410\\
\bottomrule
\end{tabular*}
\end{table}
\EOD
\end{document}
答案1
在你的 MWE 中
- 丢失包裹
siunitx, \booktabs
,makecell
从而导致您的错误 - 该包
amssymb
包含/加载amsmath
包,因此不需要(再次)加载它 - 您加载
algorithmic
两次 - 在表中您定义了 6 列,但只使用了 5 列(因此需要更正
\cmidrule
) - 列中的数字最多为三位小数,因此没有必要占用四位小数的空间,甚至更多,因为所有数字都有相同的单位(百分比),所以将所有数字四舍五入为两位小数是合理的。
在纠正了上述缺陷的 MWE 之后,您的 MWE 可以是:
\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb} % <---
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{siunitx} % <---
\usepackage{booktabs, makecell} % <---
\usepackage{lipsum} % for dummy text
\begin{document}
\lipsum[11]
\begin{table}[ht]
\centering
\caption{Evaluation of the proposed FA-HELF model and the benchmark}
\label{tab:Y_Forecast}
\setlength{\tabcolsep}{0pt}
\sisetup{round-mode=places,
round-precision=2,
table-format=1.2,
}
\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}} l *{4}{S} }
\toprule
& \multicolumn{4}{c}{Proposed} \\
\cmidrule{2-5}
\thead{Months}
& {\thead{SDPSO-ELM \\ MAPE \\(\%)}}
& {\thead{F-RBF-CNN\\ MAPE \\(\%)}}
& {\thead{SSA-SVM-CS\\ MAPE \\(\%)}}
& {\thead{FA-HELF \\ MAPE\\(\%)}} \\
\midrule
Jan & 2.22 & 1.67 & 1.55 & 0.414 \\
Avg. & 2.12 & 1.79 & 1.44 & 0.410 \\
\bottomrule
\end{tabular*}
\end{table}
\EOD
\end{document}
工作正常并给出预期结果:
附录:我不知道您表格的背景,但请查看以下修改是否不会改变其含义:
上表的代码为:
\begin{table}[ht]
\centering
\caption{Evaluation of the proposed FA-HELF model and the benchmark}
\label{tab:Y_Forecast}
\setlength{\tabcolsep}{0pt}
\sisetup{round-mode=places,
round-precision=2,
table-format=1.2,
}
\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}} l *{4}{S} }
\toprule
& \multicolumn{4}{c}{MAPE of the proposed methods} \\
\cmidrule{2-5}
\thead{Months}
& {\thead{SDPSO-ELM\\ (\%)}}
& {\thead{F-RBF-CNN \\ (\%)}}
& {\thead{SSA-SVM-CS\\ (\%)}}
& {\thead{FA-HELF\\ (\%)}} \\
\midrule
Jan & 2.22 & 1.67 & 1.55 & 0.414 \\
Avg. & 2.12 & 1.79 & 1.44 & 0.410 \\
\bottomrule
\end{tabular*}
\end{table}