表格名称不符合 IEEEtran 表格标题格式

表格名称不符合 IEEEtran 表格标题格式

我的表格标题不符合 IEEE 期刊格式。我写了以下代码:

\documentclass[10pt,journal]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{float}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{caption,subcaption}
\usepackage{varwidth}
\graphicspath{ {./images/} }
\usepackage{nccmath}
\usepackage{afterpage}
\usepackage{placeins}
   
\begin{table*}
\caption{Comparison of test accuracies of classifiers on different features}
\setlength\tabcolsep{0pt}
\begin{minipage}[t]{0.42\textwidth}
\caption{Confusion Matrix}
\begin{tabular*}{1\textwidth}[t]{@{\extracolsep{\fill}} l *{8}{c}}
\toprule
Original Class & \multicolumn{8}{c}{Class Predicted} \\
\cmidrule{2-9}
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8  \\
\midrule
1 & 30 & 0 & 0 & 0 & 0  & 0  & 0 & 0 \\
2 & 0 & 30 & 0 & 0 & 0 & 0 & 0 & 0 \\
3 & 0 & 0 & 30 & 0 & 0 & 0 & 0 & 0 \\
4 & 0 & 0 & 0 & 30 & 0 & 0 & 0 & 0  \\
5 & 0 & 0 & 0 & 0 & 30 & 0 & 0 & 0  \\
6 & 0 & 0 & 0 & 0 & 3 & 27 & 0 & 0  \\
7 & 0 & 0 & 0 & 0 & 0 & 0 & 30 & 0  \\
8 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 29  \\
\bottomrule
\end{tabular*}

\end{minipage}
\hfill
\begin{minipage}[t]{0.55\textwidth}
\caption{Evaluation Metrics}
\begin{tabular*}{1\textwidth}[t]{@{\extracolsep{\fill}} l *{8}{c}}
\toprule
& \multicolumn{8}{c}{Class} \\
\cmidrule{2-9}
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8  \\
\midrule
TPR & 1 & 1 & 1 & 1 & 1  & 0.9  & 1 & 0.97 \\
TNR & 1 & 1 & 1 & 1 & 0.98 & 1 & 1 & 1 \\
FPR & 0 & 0 & 0 & 0 & 0.02 & 0 & 0 & 0 \\
FNR & 0 & 0 & 0 & 0 & 0 & 0.1 & 0 & 0.03  \\
\bottomrule
\end{tabular*}

\end{minipage}
\end{table*}

输出如下所示:

在此处输入图片描述

答案1

正如我在评论中提到的,包captionsubcaption覆盖文档类的默认设置。如果需要,IEEEtran您应该使用它们:\usepackage[caption=false,font=footnotesize]{subfig}subfig

一个如何更正 MWE 的示例。它现在包含表格的原始呈现形式和带有更有意义的子表的新呈现形式:

\documentclass[journal]{IEEEtran}
\usepackage[english]{babel}
\usepackage{nccmath, amssymb,mathtools}% nccmath had to be loaded before mathtools
\usepackage{graphicx}
\usepackage{booktabs, makecell, multirow}
\usepackage{float}
%\usepackage{caption,subcaption} % they are not compatible with ieeetran
\usepackage[caption=false,font=footnotesize]{subfig}
\usepackage{varwidth}
\graphicspath{ {./images/} }
\usepackage{afterpage}
\usepackage{placeins}

\begin{document}
\begin{table*}
\caption{Comparison of test accuracies of classifiers on different features}
\setlength\tabcolsep{0pt}
\begin{minipage}[t]{0.42\textwidth}
\caption{Confusion Matrix}
\begin{tabular*}{1\textwidth}[t]{@{\extracolsep{\fill}} l *{8}{c}}
\toprule
Original Class & \multicolumn{8}{c}{Class Predicted} \\
\cmidrule{2-9}
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8  \\
\midrule
1 & 30 & 0 & 0 & 0 & 0  & 0  & 0 & 0 \\
2 & 0 & 30 & 0 & 0 & 0 & 0 & 0 & 0 \\
3 & 0 & 0 & 30 & 0 & 0 & 0 & 0 & 0 \\
4 & 0 & 0 & 0 & 30 & 0 & 0 & 0 & 0  \\
5 & 0 & 0 & 0 & 0 & 30 & 0 & 0 & 0  \\
6 & 0 & 0 & 0 & 0 & 3 & 27 & 0 & 0  \\
7 & 0 & 0 & 0 & 0 & 0 & 0 & 30 & 0  \\
8 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 29  \\
\bottomrule
\end{tabular*}
\end{minipage}
\hfill
\begin{minipage}[t]{0.55\textwidth}
\caption{Evaluation Metrics}
\begin{tabular*}{1\textwidth}[t]{@{\extracolsep{\fill}} l *{8}{c}}
\toprule
& \multicolumn{8}{c}{Class} \\
\cmidrule{2-9}
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8  \\
\midrule
TPR & 1 & 1 & 1 & 1 & 1  & 0.9  & 1 & 0.97 \\
TNR & 1 & 1 & 1 & 1 & 0.98 & 1 & 1 & 1 \\
FPR & 0 & 0 & 0 & 0 & 0.02 & 0 & 0 & 0 \\
FNR & 0 & 0 & 0 & 0 & 0 & 0.1 & 0 & 0.03  \\
\bottomrule
\end{tabular*}
\end{minipage}
\end{table*}

\begin{table*}
\caption{Comparison of test accuracies of classifiers on different features}
\setlength\tabcolsep{0pt}
\subfloat[Confusion Matrix]
{
\begin{tabular*}{0.45\linewidth}[t]{@{\extracolsep{\fill}} l *{8}{c}}
    \toprule
\makecell{Original\\ Class} 
  & \multicolumn{8}{c}{Class Predicted} \\
    \cmidrule{2-9}
  & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8  \\
    \midrule
1 & 30 & 0 & 0 & 0 & 0  & 0  & 0 & 0 \\
2 & 0 & 30 & 0 & 0 & 0 & 0 & 0 & 0 \\
3 & 0 & 0 & 30 & 0 & 0 & 0 & 0 & 0 \\
4 & 0 & 0 & 0 & 30 & 0 & 0 & 0 & 0  \\
5 & 0 & 0 & 0 & 0 & 30 & 0 & 0 & 0  \\
6 & 0 & 0 & 0 & 0 & 3 & 27 & 0 & 0  \\
7 & 0 & 0 & 0 & 0 & 0 & 0 & 30 & 0  \\
8 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 29  \\
    \bottomrule
\end{tabular*}
}%
\hfill
\subfloat[Evaluation Metrics]
{
\begin{tabular*}{0.45\linewidth}[t]{@{\extracolsep{\fill}} l *{8}{c}}
\toprule
& \multicolumn{8}{c}{Class} \\
\cmidrule{2-9}
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8  \\
\midrule
TPR & 1 & 1 & 1 & 1 & 1  & 0.9  & 1 & 0.97 \\
TNR & 1 & 1 & 1 & 1 & 0.98 & 1 & 1 & 1 \\
FPR & 0 & 0 & 0 & 0 & 0.02 & 0 & 0 & 0 \\
FNR & 0 & 0 & 0 & 0 & 0 & 0.1 & 0 & 0.03  \\
\bottomrule
\end{tabular*}
}
\end{table*}
\end{document}

在此处输入图片描述

相关内容