[I'm not sure whether this is a problem with \pdfmanagement_add:nnn, a problem with \AddToHook{shipout}, or lacking documentation. ]
[LaTeX2e <2024-11-01>]
[L3 programming layer <2024-11-02>]
Consider the following example to rotate all odd pages.
\RequirePackage{pdfmanagement-testphase}
\DocumentMetadata{}
\documentclass[landscape]{article}
\ExplSyntaxOn
\AddToHook{shipout}{%
\ifodd\thepage
\else
\pdfmanagement_add:nnn{ThisPage}{Rotate}{180}%
\fi}
\ExplSyntaxOff
\begin{document}
foo\newpage
bar\newpage
baz\newpage
urgh
\end{document}
I would expect that the above code rotates the first page, too – at the moment of the shipout, \thepage already has been set to the next page number, or so I think. However, it doesn't work, and I don't see why. My guess is that it is not suitable to use \thepage for the test. What should be used instead?
[I'm not sure whether this is a problem with
\pdfmanagement_add:nnn, a problem with\AddToHook{shipout}, or lacking documentation. ][LaTeX2e <2024-11-01>]
[L3 programming layer <2024-11-02>]
Consider the following example to rotate all odd pages.
I would expect that the above code rotates the first page, too – at the moment of the shipout,
\thepagealready has been set to the next page number, or so I think. However, it doesn't work, and I don't see why. My guess is that it is not suitable to use\thepagefor the test. What should be used instead?