如何像 Ax 一样创建表格标签?

如何像 Ax 一样创建表格标签?

从中获取 MWE问题,我正在寻找一种可以标记我的表格Table A.1和的解决方案Table A.2。有没有一种简单的解决方法?

\documentclass{article}
\usepackage{booktabs}
\usepackage{dcolumn}

\begin{document}
% Table generated by Excel2LaTeX from sheet 'nipo'
\begin{table}[htbp]
\centering
\caption{Statistics of Initial Public Offering}
\begin{tabular}{rrr}
\toprule
    Year  & Frequency & \% \\
\midrule
1975  & 10    & 0,1 \\
1976  & 27    & 0,3 \\
1977  & 17    & 0,2 \\
1978  & 21    & 0,3 \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}%

\begin{table}[htbp]
    \centering
    \caption{Statistics of Initial Public Offering (Version Two)}
    \begin{tabular}{rrr}
        \toprule
        Year  & Frequency & \% \\
        \midrule
        1975  & 10    & 0,1 \\
        1976  & 27    & 0,3 \\
        1977  & 17    & 0,2 \\
        1978  & 21    & 0,3 \\
        1979  & 47    & 0,6 \\
        \bottomrule
    \end{tabular}%
    \label{tab:second_addlabel}%
\end{table}%

\end{document}

答案1

您可以使用\renewcommand{\thetable}{A.\arabic{table}}如以下 MWE 所示的方式将一个添加A到所有表格的标题中。

\documentclass{article}
\usepackage{booktabs}
\usepackage{dcolumn}
\renewcommand{\thetable}{A.\arabic{table}}

\begin{document}
% Table generated by Excel2LaTeX from sheet 'nipo'
\begin{table}[htbp]
\centering
\caption{Statistics of Initial Public Offering}
\begin{tabular}{rrr}
\toprule
    Year  & Frequency & \% \\
\midrule
1975  & 10    & 0,1 \\
1976  & 27    & 0,3 \\
1977  & 17    & 0,2 \\
1978  & 21    & 0,3 \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}%

\begin{table}[htbp]
    \centering
    \caption{Statistics of Initial Public Offering (Version Two)}
    \begin{tabular}{rrr}
        \toprule
        Year  & Frequency & \% \\
        \midrule
        1975  & 10    & 0,1 \\
        1976  & 27    & 0,3 \\
        1977  & 17    & 0,2 \\
        1978  & 21    & 0,3 \\
        1979  & 47    & 0,6 \\
        \bottomrule
    \end{tabular}%
    \label{tab:second_addlabel}%
\end{table}%

\end{document}

相关内容