在附录中创建表格

在附录中创建表格

我正在用 LaTeX 起草一篇文章,但在将表格从正文移到附录时遇到了麻烦。我使用 \appendix 命令,然后使用标准代码创建表格。但是,表格没有出现在附录中,而是出现在正文中。请帮忙。

\documentclass[12pt]{article}
\usepackage{appendix}
\begin{document}
\section{Introduction}
\subsection{Literature}
\appendix

\section{Appendix: Additional Figures}
\begin{table}[]
    \centering
    \begin{tabular}{c|c}
         &  \\
         & 
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\end{document} 

答案1

\begin{table}[]表示“不允许在任何地方使用该表”。这将生成警告,并且参数会发生变化:

LaTeX Warning: No positions in optional float specifier.
               Default added (so using `tbp') on input line 9.

但你不想在这里使用顶部浮动,所以使用[hbp]

\documentclass[12pt]{article}
\usepackage{appendix}
\begin{document}
\section{Introduction}
\subsection{Literature}
\appendix

\section{Appendix: Additional Figures}
\begin{table}[hbp]
    \centering
    \begin{tabular}{c|c}
         &  \\
         & 
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\end{document} 

在此处输入图片描述

相关内容