为什么在以下情况下标题会变成副标题?

为什么在以下情况下标题会变成副标题?
    \documentclass[a4paper]{article} 
    \usepackage{tabularx}
    \usepackage{caption}
    \usepackage{subcaption}
    \newcolumntype{Y}{>{\footnotesize\raggedleft\arraybackslash}X}
    \setlength{\tabcolsep}{0pt}
    \usepackage{booktabs}

    \begin{document} 


    \bigskip

\noindent


\begin{table}\begin{tabularx}{\textwidth}{YYYYYYYYYYYYY}
\toprule
$10^{-2}$ & 5373 & 4248 & 3137 & 2029 & 996 & 651 & 488 & 455 & 481 & 575 & 659 & 491 \\
 (m) & 378 & 299 & 221 & 143 & 70 & 46 & 34 & 32 & 34 & 40 & 46 & 35 \\\midrule
$10^{-5}$ & --- & --- & 93712 & 59616 & 25353 & 9737 & 19597 & 37621 & 55079 & 72379 & 90438 & 84164 \\
 (m) & & & 6591 & 4193 & 1783 & 685 & 1378 & 2646 & 3874 & 5091 & 6361 & 5920 \\\midrule
$10^{-8}$ & --- & --- & --- & --- & --- & 34076 & 69287 & --- & --- & --- & --- & ---\\
 (m) & & & & & & 2397 & 4873 & & & & & \\\bottomrule
\end{tabularx}
\subcaption{a}


 \begin{tabularx}{\textwidth}{YYYYYYYYYYYYY}
\toprule
$10^{-2}$ & 5373 & 4248 & 3137 & 2029 & 996 & 651 & 488 & 455 & 481 & 575 & 659 & 491 \\
 (m) & 378 & 299 & 221 & 143 & 70 & 46 & 34 & 32 & 34 & 40 & 46 & 35 \\\midrule
$10^{-5}$ & --- & --- & 93712 & 59616 & 25353 & 9737 & 19597 & 37621 & 55079 & 72379 & 90438 & 84164 \\
 (m) & & & 6591 & 4193 & 1783 & 685 & 1378 & 2646 & 3874 & 5091 & 6361 & 5920 \\\midrule
$10^{-8}$ & --- & --- & --- & --- & --- & 34076 & 69287 & --- & --- & --- & --- & ---\\
 (m) & & & & & & 2397 & 4873 & & & & & \\\bottomrule
\end{tabularx}
    \subcaption{b}

    \caption{why I am a subcaption.}
    \end{table}
    \bigskip
    \end{document}

答案1

显然,“子浮点数”必须包含在一个组中,这在手册中也是始终如此:

\documentclass[a4paper]{article} 
\usepackage{tabularx}
\usepackage{caption}
\usepackage{subcaption}
\newcolumntype{Y}{>{\footnotesize\raggedleft\arraybackslash}X}
\setlength{\tabcolsep}{0pt}
\usepackage{booktabs}

\begin{document} 


\bigskip

\noindent


\begin{table}
\begingroup
\begin{tabularx}{\linewidth}{YYYYYYYYYYYYY}
\toprule
$10^{-2}$ & 5373 & 4248 & 3137 & 2029 & 996 & 651 & 488 & 455 & 481 & 575 & 659 & 491 \\
 (m) & 378 & 299 & 221 & 143 & 70 & 46 & 34 & 32 & 34 & 40 & 46 & 35 \\\midrule
$10^{-5}$ & --- & --- & 93712 & 59616 & 25353 & 9737 & 19597 & 37621 & 55079 & 72379 & 90438 & 84164 \\
 (m) & & & 6591 & 4193 & 1783 & 685 & 1378 & 2646 & 3874 & 5091 & 6361 & 5920 \\\midrule
$10^{-8}$ & --- & --- & --- & --- & --- & 34076 & 69287 & --- & --- & --- & --- & ---\\
 (m) & & & & & & 2397 & 4873 & & & & & \\\bottomrule
\end{tabularx}
\subcaption{a}
\endgroup

\begingroup
 \begin{tabularx}{\linewidth}{YYYYYYYYYYYYY}
\toprule
$10^{-2}$ & 5373 & 4248 & 3137 & 2029 & 996 & 651 & 488 & 455 & 481 & 575 & 659 & 491 \\
 (m) & 378 & 299 & 221 & 143 & 70 & 46 & 34 & 32 & 34 & 40 & 46 & 35 \\\midrule
$10^{-5}$ & --- & --- & 93712 & 59616 & 25353 & 9737 & 19597 & 37621 & 55079 & 72379 & 90438 & 84164 \\
 (m) & & & 6591 & 4193 & 1783 & 685 & 1378 & 2646 & 3874 & 5091 & 6361 & 5920 \\\midrule
$10^{-8}$ & --- & --- & --- & --- & --- & 34076 & 69287 & --- & --- & --- & --- & ---\\
 (m) & & & & & & 2397 & 4873 & & & & & \\\bottomrule
\end{tabularx}
    \subcaption{b}
\endgroup

\caption{why I am a subcaption.}
\end{table}
\bigskip
\end{document}

相关内容