# Missing number error when using the scrbook document class LuaLaTeX

I'm working on a book of chants, using gregorio. The gregorio package requires LuaLaTeX. To simplify the issue, however, I narrowed the error down with this sample .tex file:

\documentclass{scrbook}
\begin{document}
\title{Title}
\maketitle
Lorem Lipsum
\end{document}


Compiling with LaTeX works fine, but when I try it with LuaLaTeX, it produces the following errors:

***snip***
)) (./test.aux)
! Missing number, treated as zero.
p
l.2 \begin{document}

?
! Illegal unit of measure (pt inserted).
p
l.2 \begin{document}

?
! Missing number, treated as zero.
\begingroup
l.2 \begin{document}

?
! Illegal unit of measure (pt inserted).
\begingroup
l.2 \begin{document}

?
-------------------


The output .pdf file has this text at the top of the page:

pagewidth=pageheight=


Am I fighting a pointless battle? I can use the {article} document type without issue, but the {scrbook} seems more appropriate. If there's no simple solution, I'll just go with article, but... Any advice?

• Welcome to TeX.SE. Which version of LuaTeX do you use? – Mico Oct 27 '16 at 6:39
• Which KOMA-Script version do you use? There was a bug in version 3.20 (I can reproduce your problem with this version). But current version is 3.21. If you can not update, then try to load package luatex85. – esdd Oct 27 '16 at 6:40
• Your sample compiles fine for me both with latex and lualatex. Maybe try deleting your .aux file before recompiling. – siracusa Oct 27 '16 at 6:40
• Thanks, esdd (and everyone else)! That solved it. I'm using MacTex 2016, which likely has a prior version of KOMA-Script. Including \usepackage{luatex85} allowed even my gregorio file to compile without errors. I'll look into updating KOMA-Script as well. – Nick Oct 27 '16 at 7:48
• Updating KOMA-Script also worked seamlessly. For other users of MacTex 2016, this can be done very simply by typing the following in a terminal window (all on one line): tlmgr install --reinstall --repository komascript.de/repository/texlive/2016 koma-script – Nick Oct 28 '16 at 1:49

There was a bug in package typearea version 3.20 which is part of the KOMA-Script bundle and used by all KOMA-Script classes. See Bekannte Probleme und Änderungen in KOMA-Script 3.20 (German).

It is already fixed in current version 3.21. So if you update your KOMA-Script, your MWE will compile:

\documentclass{scrbook}[2016/06/14]
\begin{document}
\title{Title}
\maketitle
Lorem Lipsum
\end{document}


Workarounds if you have to use version 3.20:

If you do not want to change the default paper size (A4), set option pagesize=false:

\documentclass[pagesize=false]{scrbook}
\begin{document}
\title{Title}
\maketitle
Lorem Lipsum
\end{document}


Alternativly you can load package luatex85:

\documentclass[pagesize=false]{scrbook}
\usepackage{luatex85}
\begin{document}
\title{Title}
\maketitle
Lorem Lipsum
\end{document}