答案1
您可以\shipout
在 LuaTeX 中覆盖原语。要获得正确的边距、页眉和页脚,还需要做更多工作。
\documentclass{article}
\usepackage{pgffor}
\newbox\infobox
% Override the shipout primitive to also shipout infobox
\def\shipout{\directlua{
local box = token.scan_list()
tex.setbox(255, box)
tex.shipout(255)
tex.setbox(255, node.copy(tex.getbox("infobox")))
tex.shipout(255)
}}
\begin{document}
% Set infobox only after \begin{document}. Otherwise fonts will not
% be loaded.
\setbox\infobox=\vbox to \textheight{
\vfill
\Huge\input ward\par
\vfill
}
\foreach \i in {1,...,20} {
\input knuth\par
}
\end{document}