Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The firstaid fix for pgfmorepages is not correct. #455

Closed
loopspace opened this issue Dec 14, 2020 · 2 comments
Closed

The firstaid fix for pgfmorepages is not correct. #455

loopspace opened this issue Dec 14, 2020 · 2 comments

Comments

@loopspace
Copy link

In latex2e-first-aid-for-external-files.ltx there is a fix for how the pgfmorepages package hooks into the shipout routine. This is a direct copy of the fix for the pgfpages package, but the two packages hook into the shipout routine slightly differently: pgfpages applies its hook at the end of the package but pgfmorepages applies its hook via an AtBeginDocument call.

To that end, the fix for pgfmorepages should patch the pgfmorepages hook rather than try to override its effect. The following is what I think it ought to be:

\AddToHook{file/after/pgfmorepages.sty}[firstaid]{%
  \cs_set_nopar:Npn \pgfhookintoshipout {
    \cs_set_eq:NN \pgfpages@originalshipout \tex_shipout:D
    \cs_set_eq:NN \tex_shipout:D \pgfpages@interceptshipout
  }
}

Some MWEs.

Currently not working:

\documentclass{article}

\usepackage{pgfmorepages}
\usepackage{lipsum}

\begin{document}

\lipsum[1-4]{}

\end{document}

Currently working:

\documentclass{article}

\ExplSyntaxOn
\makeatletter
\RemoveFromHook{file/after/pgfmorepages.sty}[firstaid]
\AddToHook{file/after/pgfmorepages.sty}[firstaid]{%
  \cs_set_nopar:Npn \pgfhookintoshipout {
    \cs_set_eq:NN \pgfpages@originalshipout \tex_shipout:D
    \cs_set_eq:NN \tex_shipout:D \pgfpages@interceptshipout
  }
}
\makeatother
\ExplSyntaxOff

\usepackage{pgfmorepages}
\usepackage{lipsum}

\begin{document}

\lipsum[1-4]{}

\end{document}
@FrankMittelbach FrankMittelbach transferred this issue from latex3/latex3 Dec 14, 2020
@FrankMittelbach FrankMittelbach self-assigned this Dec 14, 2020
@FrankMittelbach FrankMittelbach added this to Pool (unscheduled issues) in upcoming LaTeX2e releases via automation Dec 14, 2020
@FrankMittelbach FrankMittelbach added this to the hotfix milestone Dec 14, 2020
@FrankMittelbach FrankMittelbach moved this from Pool (unscheduled issues) to In progress in upcoming LaTeX2e releases Dec 14, 2020
FrankMittelbach added a commit that referenced this issue Dec 14, 2020
FrankMittelbach added a commit that referenced this issue Dec 14, 2020
josephwright pushed a commit that referenced this issue Dec 16, 2020
josephwright pushed a commit that referenced this issue Dec 16, 2020
@FrankMittelbach
Copy link
Member

now on ctan

upcoming LaTeX2e releases automation moved this from In progress to Done Dec 17, 2020
@loopspace
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants