# Missing control sequence inserted when using LuaLaTex

When I try to compile my LuaLaTex template file, I get the following error.

./fi-lualatex.toc:33: Missing control sequence inserted.
<inserted text>
\inaccessible
l.33 ...} sectioning commands.}{3}{subsection.2.1.1}


I will share the Overleaf project in question and I allow you to even edit it. The content is not important.

https://www.overleaf.com/4697929jgqygc

\thesis@versiondef{v0.3.34}{2016/02/24}}

This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/Debian) (rev 5238) (format=lualatex 2016.3.4) 24 MAR 2016 10:51 \write18 enabled. file:line:error style messages enabled.

The template uses the rapport3 class as the backend. Consider the following minimal example document:

\documentclass{rapport3}
\usepackage{polyglossia}
\begin{document}
\tableofcontents
\subsection{sectioning commands.}
\end{document}


When complied at Overleaf, the same error gets reported. Unfortunately, I can not reproduce the error on the current version of TeX Live (a four days old release from the Debian unstable repository) at my local host, so any further debugging is problematic. On the bright side, this means that this should be just an Overleaf issue.

• The minimal example document above compiles fine on Overleaf, as well as on my local up-to-date TeX Live 2015. I have the vanilla version (./install-tl --gui perltk) on Fedora 23. In both cases, there is not even an error and a correct PDF file is produced. Mar 24 '16 at 22:40
• By the way the original issue still persists, so the problem has not been repaired by the Overleaf meanwhile. Just wanted to refute this possible explanation why it already works. Mar 24 '16 at 22:45
• It does not compile fine for me (on Overleaf). I have even created a separate project just to make sure there is no stale .toc file lying around. Make sure you have the LuaLaTeX format selected in the Project Preferences, when compiling the project. Mar 25 '16 at 0:13
• Thanks to @Witiko's minimal example, I've discovered that the issue is due to the particular version of polyglossia in TeX Live215 on Ubuntu wily stable (which is what Overleaf is running). After uploading a recent version of polyglossia.sty to the project, both the minimal example and the fithesis (lualatex version) now compiles fine. Mar 25 '16 at 4:02
• I confirm the minimal example is compilable on Overleaf as of now, but the default fithesis3 lualatex template is still not compilable on Overleaf, though the error message has changed. I can compile the default fithesis3 lualatex template on my Fedora 23 up-to-date Texlive 2015 (vanilla, not repositories). I will communicate with @Witiko and the Overleaf maintainers (have a Pro account there). Apr 6 '16 at 19:07

Thanks to @Witiko's minimal example, the problem is found to be due to the particular version of polyglossiain TeX Live215 on Ubuntu wily (which is what Overleaf is running). After uploading a recent version of polyglossia.sty and polyglossia.lua to the project, both the minimal example and the fithesis (LuaLaTeX version) now compiles fine.

• I'm glad the example was useful. Is this the suggested course of action, then, or are you going to update the package? Mar 25 '16 at 10:55
• @Witiko Yes the best thing for now is to manually add the new polyglossia.sty, until the next Ubuntu release of TeX Live. Mar 25 '16 at 14:11
• I still can not compile the default fithesis3 lualatex template, even with the new polyglossia.sty. The error message has changed, however, so it seems the original issue has been fixed. Apr 6 '16 at 19:09
• It looks the template has been updated in the Overleaf Gallery with a version of polyglossia.sty different from the one I used previously (I hadn't updated my TL2015 in a while) — for this version of polyglossia.sty, it needs the corresponding version of polyglossia.lua as well. After adding that file to your project, it now compiles without errors. I've updated my answer. Apr 7 '16 at 3:03