0

I am trying to compile a document with Russian language and using the fonts from cm-unicode. Code:

\documentclass[a4paper,12pt]{report}

\usepackage{polyglossia}
  \setdefaultlanguage[spelling=modern]{russian}
  \setotherlanguage{english}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{xecyr}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}

Build command:

latexmk -xelatex -outdir=build document.tex

And error message:

! Package polyglossia Error: The current latin font CMUTypewriterText(0) does n
ot contain the "Cyrillic" script!

And I get an error with any font.

What am I doing wrong?

1 Answers1

1

Solved

\setmainfont{CMU Serif}
\newfontfamily{\cyrillicfont}{CMU Serif}
\setsansfont{CMU Sans Serif}
\newfontfamily{\cyrillicfontsf}{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\newfontfamily{\cyrillicfonttt}{CMU Typewriter Text}
  • You actually don't need to define the family for the regular and sans fonts, only for the teletype. Probably a duplicate of https://tex.stackexchange.com/questions/91507/liberation-mono-the-current-roman-font-does-not-contain-the-cyrillic-script. – Marijn Feb 16 '20 at 17:34
  • This isn't really an answer. Using the code might solve the problem, but an answer explains itself and why it works. – dgoodmaniii Feb 16 '20 at 18:34