50

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?

56

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}
  • 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 '16 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 '16 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. – Martin Scharrer Mar 27 '18 at 17:53
17

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.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.