bounddvi needs adaption to new latex version
Closed this issue · 9 comments
bounddvi manipulates \@begindocumenthook
to prepend and append code. This will no longer work in the next latex version, as \@begindocumenthook
is no longer used directly. Your code there will be silently ignored.
Please check if you can change the code to make use of the new additional hooks and hook management provided by LaTeX.
The bounddvi code contains a comment that one of the hook is only there to ensure that the code is behind the geometry code. This can for example be implemented with a hook rule:
\DeclareHookRule{begindocument}{geometry}{before}{bounddvi}
If you have problems or think that the provided hooks are not sufficient open please an issue at the latex2e github.
@aminophen gentle reminder that the LaTeX release is drawing nearer.
Thanks for the head-up; I know the problem but I haven't worked on it yet, because we (@texjporg) are addressing a number of incompatibilities related to LaTeX2e 2020-10-01 \shipout changes. Adjustment of bounddvi.sty would take more time.
FYI: the current pLaTeX redefines \AtBeginDvi
with an addition of \yoko
to avoid low-level pTeX errors (see mail "[graphics] New dvips.def and Japanese pLaTeX" which I sent in June 2016). However, that redefinition must be removed to avoid breaking your new definition. Nevertheless, we are still unable to find the appropriate place in the new \shipout code to insert \yoko
safely without causing any low-level pTeX errors.
Not sure what exactly \yoko does (it seems to be a primitive) but given its current position wouldn't the right place be shipout/firstpage?
\yoko is a pTeX-specific direction change primitive (JP vertical writing -> JP horizontal writing), but the use of that primitive is disallowed when the node list or the page is non-empty.
\AddToHook{shipout/firstpage}{\yoko}
% => ! Incompatible direction list can't be unboxed.
\documentclass[dvipdfmx]{tarticle}% vertical writing document class
\begin{document}
\begin{figure}
\caption{キャプション}
\end{figure}
\end{document}
\AddToHook{shipout/before}{\yoko}
% => ! Use `\yoko' at top of list.
\documentclass[dvipdfmx]{tarticle}% vertical writing document class
\begin{document}
\begin{figure}
\caption{キャプション}
\end{figure}
\end{document}
Using platex-dev, similar problems occur with lots of \unvbox inside the new shipout code, so we are still examining what needs to be changed.
ah, understood. So in that case atbegshi was never working with platex (because that code largely comes from that package)?
Maybe we do need some additional hooks for setting/altering direction (in the right places)
So in that case atbegshi was never working with platex
You are right, and that was why I developed "pxeveryshi.sty" and "pxatbegshi.sty" (both in platex-tools) which can cope with pLaTeX vertical writing (with some known subtle incompatible behaviors). Those two packages are also broken with platex-dev now ... investigating.
Maybe we do need some additional hooks for setting/altering direction (in the right places)
I guess so, but we are still not able to find "the right places", sorry. If we reach there, I'll let you know.
But if you managed to get pxatbegshi working, wouldn't that be a model on what needs changing in ltshipout? (but I guess you stried that already so I better leave you to it). Let me know when you found the "right places" so that we can work out something to accomodate.
FYI: our new implementation (called "candidate 3") is ready in platex.cfg; it seems to work, for most of our test cases prepared in the same directory. A mere addition of \yoko is not enough, so we don't think "some additional hook in the kernel" is useful. Therefore, we will do that patch in our pLaTeX kernel (plcore.ltx) instead. Many thanks for your kind cooperation.
In 2020-09-25, bounddvi is adapted.