5

doc.tex:

\documentclass[a4paper]{scrartcl}

\usepackage{polyglossia}
\setmainfont{DejaVu Sans}
\newfontfamily{\cyrillicfontsf}{DejaVu Sans}
\newfontfamily{\cyrillicfonttt}{DejaVu Sans Mono}

\setmainlanguage{russian}

\begin{document}
    \section{Тест}
\end{document}

Output of xelatex doc.tex:

This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018/Arch Linux) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./doc.tex
LaTeX2e <2018-04-01> patch level 5
(/usr/share/texmf-dist/tex/latex/koma-script/scrartcl.cls
Document Class: scrartcl 2018/03/30 v3.25 KOMA-Script document class (article)
(/usr/share/texmf-dist/tex/latex/koma-script/scrkbase.sty
(/usr/share/texmf-dist/tex/latex/koma-script/scrbase.sty
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-dist/tex/latex/koma-script/scrlfile.sty)))
(/usr/share/texmf-dist/tex/latex/koma-script/tocbasic.sty)
(/usr/share/texmf-dist/tex/latex/koma-script/scrsize11pt.clo)
(/usr/share/texmf-dist/tex/latex/koma-script/typearea.sty))
(/usr/share/texmf-dist/tex/latex/polyglossia/polyglossia.sty
(/usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/share/texmf-dist/tex/latex/makecmds/makecmds.sty)
(/usr/share/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/share/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def)))
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texmf-dist/tex/latex/base/tuenc.def))
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/share/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/share/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
(/usr/share/texmf-dist/tex/latex/polyglossia/babelsh.def))
No file doc.aux.

! LaTeX Error: \chapterformat undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.10 \begin{document}

When I remove the \setmainlanguage line, the error disappears, but cyrillic characters also disappear

I can fix it by manually defining a \chapterformat before \begin{document}, but it feels like a hack

5

The russian module for polyglossia has a part of code specific for Komascript classes; unfortunately, it issues \renewcommand{\chapterformat}{...} without checking it is defined (which isn't in scrartcl).

As a fix you can give a dummy definition to \chapterformat. Using \providecommand will do nothing in case the class is changed to one that supports \chapterformat.

\documentclass[a4paper]{scrartcl}
\providecommand{\chapterformat}{}

\usepackage{polyglossia}
\setmainfont{DejaVu Sans}
\newfontfamily{\cyrillicfontsf}{DejaVu Sans}
\newfontfamily{\cyrillicfonttt}{DejaVu Sans Mono}

\setmainlanguage{russian}

\begin{document}

\section{Тест}

\end{document}

The issue has already been reported at the polyglossia repository:

https://github.com/reutenauer/polyglossia/issues/210

to which I added a proposed fix.

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.