4

After the latest TeX Live update, I'm getting the following error while compiling my book draft with lualatex:

! Undefined control sequence.
\@begindocumenthook ...yrr \cyri \cyrl \cyro \ETC.

I'm not sure what might be the culprit (this is the first time I'm getting this kind of error while working on this document) or even how to track it down. Any advice would be highly appreciated. TIA.

P.S. I understand this has got to do with Russian characters or language use, and I do have some words in Russian in the text, as well as a

\setotherlanguage[spelling=modern]{russian}

declaration in the preamble, but these things did not cause any issues before (and the error does not go away if I remove the \setotherlanguage line).

P.P.S. The (almost) full preamble with an empty document body is here. It does reproduce the error with the latest TeX Live update.

8
  • 3
    show a small complete example, that makes it much easier to test and investigate. – Ulrike Fischer Nov 2 '19 at 8:49
  • I'm not sure I'll be able to provide a small complete example since the full preamble is extensive (> 700 LoC), depends on several external files, and I have no good idea which parts of the code might be causing the error. The preamble (minus functionality that uses proprietary Lua code and does not affect the error) is in ghostbin.co/paste/nguce and does reproduce the error with the latest TeX Live update. – Arets Paeglis Nov 2 '19 at 9:02
  • well you at least have the preamble, we have nothing. So how do you expect us to know what's going on in your document? Copy the preamble with a small document body in a test document. If you get the error start to remove lines from the preamble until it gets a reasonable size. – Ulrike Fischer Nov 2 '19 at 9:05
  • 2
    try if it works if you move the \setmainlanguage and \setotherlanguage before cleveref. And clean up your preamble, loading all this lua package (luaotfload etc) is no needed in a current system. – Ulrike Fischer Nov 2 '19 at 9:21
  • 3
    polyglossia has been updated a few days ago. I can look later what happens here. – Ulrike Fischer Nov 2 '19 at 9:32
8

The problem is from polyglossia and cleverref. cleverref doesn't like it if the language isn't yet declared. The following errors:

\documentclass[]{book}
\usepackage{polyglossia}
\usepackage{cleveref}
\setmainlanguage{english}
\begin{document}
\end{document}

Solution: move the \setmainlanguage{english} before loading cleverref.

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.