latex2e
latex2e copied to clipboard
Suggestion for a new shipout hook with really complete \ShipoutBox
Brief outline of the enhancement
Within the shipout/before
hook, the box \ShipoutBox
contains neither foreground nor background material. What can I do to manipulate the really complete page? I think it's missing a shipout/completebox
or shipout/justbefore
hook, where the \ShipoutBox
is in the completely finished state.
Could you give a use case of what you want to do at this point? I'm not saying that it is unreasonable to have a hook there but it has some implications and I would therefore like to better understand what kind of workflow you have in mind.
The following example shows the problem. The circles are not mirrored. A more complex case is my package blowup
which can resize all pages of a document. There I use the package atbegshi
, which does not use shipout/foreground
or shipout/background
. The effort for a user (packet writer) would be greatly simplified with a completely-filled-box-hook. Also, the shipout hooks would be more consistent with it because they would be complete.
\listfiles
\documentclass[a4paper,oneside]{article}
\usepackage{blindtext,xcolor,pict2e,graphicx}
\usepackage[left=30mm,right=30mm]{geometry}
\setlength\parindent{0pt}
\AddToHook{shipout/background}{%
\put(0,0){\color{red!30}\circle*{2\paperwidth}}%
}
\AddToHook{shipout/before}{%
\setbox\ShipoutBox=\vbox{\moveright1in\box\ShipoutBox}%
\setbox\ShipoutBox=\hbox to\paperwidth{\box\ShipoutBox\hss}%
\setbox\ShipoutBox=\hbox{\reflectbox{\box\ShipoutBox}}%
\setbox\ShipoutBox=\vbox{\moveleft1in\box\ShipoutBox}%
}
\begin{document} \Large
\blindtext \par \vfill \blindtext
\newpage
\blindtext \par \vfill \blindtext
\end{document}
added hook shipout
to be called just in front of executing the \shipout
primitive