# LuaLaTeX, TeXLive 2016, standalone: undefined control sequence

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?

• See tex.stackexchange.com/a/314429/4427 In this case, just add \RequirePackage{luatex85} as the very first line. Jun 16 '16 at 9:26
• @egreg thanks, what to do with this question? Duplicate or remove? Jun 16 '16 at 9:28
• Well, the other question is focused on a different topic. A CW answer will do. Jun 16 '16 at 9:31
• Jun 16 '16 at 11:32
• The newest standalone version v1.3a 2018-03-26 fixes this problem. Mar 27 '18 at 17:52

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}

• Do you foresee any issues if putting a \usepackage{luatex85} immediately after \documentclass{standalone}? It does seem to work if I try it. 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. Jun 16 '16 at 15:10
• 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 '18 at 17:53

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.