是否可以强制将整页图表放入参考文献列表内?(BibTeX)

是否可以强制将整页图表放入参考文献列表内?(BibTeX)

常见的问题是“我怎样才能让我的身材不是放在参考文献列表中吗?”我问的是相反的问题。

在参考文献开始后的第一页上放置一个特定的图表。当包含图表的页面有足够的空间容纳至少一个参考文献时,这很容易做到。不幸的是,我的图表占据了整个页面。有什么技巧可以应用吗?

答案1

这里的想法是挂接到命令\bibliography,然后使用它挂接到下一页。这样,TeX 就可以确定何时包含图片,我们不必担心调整参考书目。使用最新的 TeXLive(2021 或更高版本),我们可以使用钩子系统(请参阅 lthooks-doc.pdf 和 ltshipout-doc.pdf)。否则,我们需要引入一些软件包。

\documentclass[letterpaper]{article}
\begin{filecontents}{\jobname.bib}
@article{one,
  author = {Smith, A.},
  title = {A Title},
  journal = {A Journal},
  year = {2021}
}
@article{two,
  author = {Smith, A.},
  title = {A Title},
  journal = {A Journal},
  year = {2022}
}
@article{three,
  author = {Smith, A.},
  title = {A Title},
  journal = {A Journal},
  year = {2023}
}
\end{filecontents}
\usepackage{lipsum}
\usepackage{graphicx}
% with TeXLive 2021+
\AddToHookNext{cmd/bibliography/before}{%
 \AddToHookNext{shipout/before}{%
  \includegraphics[height=\textheight,width=\textwidth]{example-image}%
  \clearpage%
 }%
}
% with any TeXLive
%\usepackage{etoolbox}
%\usepackage{atbegshi}
%\pretocmd{\bibliography}{%
% \AtBeginShipoutNext{%
%  \includegraphics[height=\textheight,width=\textwidth]{example-image}%
%  \clearpage%
% }%
%}{}{}

\bibliographystyle{plainnat}

\begin{document}
For more on this, see\\\cite{one},\\\cite{two}, and\\\cite{three}.

\lipsum[1-4]

\bibliography{\jobname}
\end{document}

相关内容