每个人。
为了制作带有子标题的表格,我编写了如下所示的源代码。
但是,无法显示子字幕,如所附屏幕截图所示。
让我知道如何解决它。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}
\begin{subtable}
\centering
\begin{tabular}{lll}
\hline
Land cover classes & Producer's accuracy(\%) & User's accuracy(\%)\\
\hline
UBA & 94 & 92 \\
OFA & 79 & 85 \\
FA & 88 & 81 \\
WA & 76 & 81 \\
Overall accuracy & 87 & \\
Kappa coefficient & 0.853 & \\
\hline
%\caption{1985}
\end{tabular}
\caption{1985}
\end{subtable}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{subtable}
\centering
\begin{tabular}{lll}
\hline
Land cover classes & Producer's accuracy(\%) & User's accuracy(\%)\\
\hline
UBA & 93 & 90 \\
OFA & 81 & 88 \\
FA & 83 & 80 \\
WA & 76 & 76 \\
Overall accuracy & 86 & \\
Kappa coefficient & 0.833 & \\
\hline
\end{tabular}
\caption{1997}
\end{subtable}
\caption{Summary of the results from the classification accuracy assessment conducted}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
答案1
您忘记指定width
for subtable
。应该是
\begin{subtable}{\textwidth} %% change \textwidth suitably
在代码中更改这一点可以解决问题。
\documentclass{article}
\usepackage{subcaption}
\usepackage{booktabs}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}
\begin{subtable}{\textwidth}
\centering
\begin{tabular}{lll}
\toprule
Land cover classes & Producer's accuracy(\%) & User's accuracy(\%) \\ \midrule
UBA & 94 & 92 \\
OFA & 79 & 85 \\
FA & 88 & 81 \\
WA & 76 & 81 \\
Overall accuracy & 87 & \\
Kappa coefficient & 0.853 & \\
\bottomrule
%\caption{1985}
\end{tabular}
\caption{1985}
\end{subtable}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{subtable}{\textwidth}
\centering
\begin{tabular}{lll}
\toprule
Land cover classes & Producer's accuracy(\%) & User's accuracy(\%) \\ \midrule
UBA & 93 & 90 \\
OFA & 81 & 88 \\
FA & 83 & 80 \\
WA & 76 & 76 \\
Overall accuracy & 86 & \\
Kappa coefficient & 0.833 & \\
\bottomrule
\end{tabular}
\caption{1997}
\end{subtable}
\caption{Summary of the results from the classification accuracy assessment conducted}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
我也已经将包中的\hline
s 更改为etc。\toprule
booktabs