56

Since I installed TeXLive 2016 I cannot build documents with the standalone document class any more using LuaLaTeX (PDFLaTeX works fine). For example:

\documentclass{standalone}
\begin{document}
hi
\end{document}

Gives me:

! Undefined control sequence.
\sa@placebox ->\newpage \global \pdfpagewidth 
                                              =\wd \sa@box \global \pdfpageh...

l.4 \end{document}

How to fix that?

5

2 Answers 2

63

The fix is easy: add \RequirePackage{luatex85} as the very first line, a temporary workaround until standalone is updated. It should do no harm even after the update.

\RequirePackage{luatex85}
\documentclass{standalone}
\begin{document}
hi
\end{document}
3
  • 1
    Do you foresee any issues if putting a \usepackage{luatex85} immediately after \documentclass{standalone}? It does seem to work if I try it.
    – Szabolcs
    Jun 16, 2016 at 13:27
  • @Szabolcs This case may work, but others may not: it depends if the class code “uses”, say, \pdfpagewidth, instead of just storing it in a macro for later call. So, if a package/class performs computations based on \pdfpagewidth at loading time, they need luatex85 having already done its work.
    – egreg
    Jun 16, 2016 at 15:10
  • 1
    The newest standalone version v1.3a 2018-03-26 fixes this problem as it does not use \pdfpagewidth with LuaTeX anymore and also loads luatex85 itself. Mar 27, 2018 at 17:53
18

The easiest way is to load luatex85 package. You probably will need to load it before documentclass, using RequirePackage

The longer story is that luatex now no longer defines many primitives with pdf prefix. The luatex85 package defines aliases of primitives which have the same names as in pdftex and earlier versions of luatex.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .