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

Mysterious "Undefined control sequence" error under XeLaTeX #5

Closed
inklesspen opened this issue Dec 8, 2020 · 6 comments
Closed

Mysterious "Undefined control sequence" error under XeLaTeX #5

inklesspen opened this issue Dec 8, 2020 · 6 comments

Comments

@inklesspen
Copy link

I am using MacTeX-2020, which has this version of pgfmorepages:

\ProvidesPackage{pgfmorepages}[2020/04/16 v1.20 multiple page manipulation]

The following document renders, if I comment out all three pgfmorepages-related lines. But with those lines in place, xelatex stops and complains.

\documentclass[10pt]{article}
\usepackage[
    paper=a5paper,
]{geometry}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{pgfmorepages}
\usepackage{lipsum}
\pgfmorepagesloadextralayouts
\pgfpagesuselayout{4 on 2, book format}[a4paper,landscape]
\defaultfontfeatures[\rmfamily,\sffamily]{}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Scale = 1}
\setmainfont{Vollkorn}

\begin{document}

\lipsum[1-20]{}

\end{document}
! Undefined control sequence.
\pgfpages@shipoutshipoutbox ...es@originalshipout 
                                                  \vbox {\hbox {\hskip -1in\...
l.18 \lipsum[1-20]{
                   }
@loopspace
Copy link
Owner

Hi,

Is it just XeLaTeX? Or are the other engines also affected?

Can you find out what version of expl3 is on your system? There was a moment where they changed how the LaTeX shipout mechanism worked and this might be related.

@inklesspen
Copy link
Author

I only use XeLaTeX, but if you can tell me exactly what you'd like me to test with other engines I can give it a go.

expl3.sty begins with this line:

\def\ExplFileDate{2020-12-03}%

@inklesspen
Copy link
Author

And actually the TeX Live Utility just offered an upgrade to l3kernel, so now it has 2020-12-07, but the problem is still happening.

@loopspace
Copy link
Owner

This seems to be an issue upstream with how the LaTeX3 team are adjusting things. I've filed an issue there https://github.com/latex3/latex3/issues/829

If you need something before it is fixed upstream, putting the following in your preamble before loading pgfmorepages seems to work:

\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

@loopspace
Copy link
Owner

This appears to be now fixed in https://github.com/latex3/latex3/issues/829 and has been published to CTAN. Updating your distribution should now fix it.

@inklesspen
Copy link
Author

Thank you!

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

No branches or pull requests

2 participants