我有一份包含大量表格的文档,这些表格应按顺序出现在参考书目/参考文献之前的附录中。最初,我遇到了表格出现在文档中各处的问题,例如出现在前面章节的中间、参考书目中间等。我通过在\FloatBarrier
参考书目之前和[ht]
在每个表格上使用解决了这个问题。当我只有几个表格时,这没问题:
\documentclass{article}
\usepackage{tikz}
\usepackage{blindtext}
\usepackage{placeins}
\newcommand{\testtable}{\begin{table}[ht]
\tiny
\caption {PSNR Comparison}
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{cc|cc|cc|cc|cc|cc}
\hline \hline
\multicolumn{2}{c|}{A} &
\multicolumn{2}{c|}{B} &
\multicolumn{2}{c|}{C} &
\multicolumn{2}{c|}{D} &
\multicolumn{2}{c|}{E} &
\multicolumn{2}{c}{F} \\
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} \\
\hline \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\
\hline \hline
\end{tabular}}
\end{table}}
\begin{document}
\thispagestyle{empty}
\section*{Introduction}
\blindtext
\section*{Appendix A}
\blindtext
\section*{Appendix B}
\testtable
\testtable
\FloatBarrier
\section*{References}
\blindtext
\end{document}
但是,当我添加的表格数量超过一页的容量时,参考书目突然出现在单独的一页上,而它本来可以轻松地放在上一页(再添加五个\testtable
s 即可看到):
如何让参考文献出现在最后一张表格后的第三页上?
答案1
由于您的附录只是一个表格列表,您实际上并不希望它们浮动,将它们更改为非浮动的最简单方法是使用H
float 包(经常被过度使用但在这里可以正常工作)
\documentclass{article}
\usepackage{tikz}
\usepackage{blindtext}
\usepackage{float}
\newcommand{\testtable}{\begin{table}[H]
\tiny
\caption {PSNR Comparison}
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{cc|cc|cc|cc|cc|cc}
\hline \hline
\multicolumn{2}{c|}{A} &
\multicolumn{2}{c|}{B} &
\multicolumn{2}{c|}{C} &
\multicolumn{2}{c|}{D} &
\multicolumn{2}{c|}{E} &
\multicolumn{2}{c}{F} \\
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} &
\textit{Rate} & \textit{PSNR} \\
\hline \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\ \hline
x & x & x & x & x & x & x & x & x & x & x & x \\
\hline \hline
\end{tabular}}
\end{table}}
\begin{document}
\thispagestyle{empty}
\section*{Introduction}
\blindtext
\section*{Appendix A}
\blindtext
\section*{Appendix B}
\testtable
\testtable
\testtable
\testtable
\testtable
\testtable
\testtable
\section*{References}
\blindtext
\end{document}