0

I am drafting an article in LaTeX, but having troubles to move tables from the text to the Appendix. I am using \appendix command, and then using standard code for creating a table. However, the table does not appear in the Appendix, rather it shows up in the main text. Please help.

\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}

Sane
  • 103

1 Answers1

2

\begin{table}[] means "do not allow the table anywhere". That generates a warning and the argument is changed:

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

But you do not want a top float here so use [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}

enter image description here

David Carlisle
  • 757,742
  • This works, thanks a lot. What stands for [hbt]? – Sane Jul 25 '23 at 11:31
  • 1
    @Sane allows the float here, bottom of page or top of page (or as I had it, with p on a page of floats) – David Carlisle Jul 25 '23 at 11:35
  • I see, thank you. – Sane Jul 26 '23 at 06:15
  • When I use [hbt], all of sudden the reference list which should come after the table in Appendix splits into two parts -- one before the table, another part after the table. Should I use another argument instead of [hbt] to guarantee that bibliography appears right after table in Appendix? – Sane Jul 26 '23 at 08:58
  • 1
    https://tex.stackexchange.com/questions/2275/keeping-tables-figures-close-to-where-they-are-mentioned – David Carlisle Jul 26 '23 at 09:10
  • Great, thanks a lot! – Sane Jul 26 '23 at 09:16