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?

0

1 Answer 1

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}
2
  • You actually don't need to define the family for the regular and sans fonts, only for the teletype. Probably a duplicate of tex.stackexchange.com/questions/91507/….
    – Marijn
    Feb 16, 2020 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. Feb 16, 2020 at 18:34

Not the answer you're looking for? Browse other questions tagged .