Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Example file:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Ubuntu}
\usepackage{polyglossia}
\setmainlanguage{russian}
\usepackage{keystroke}
\begin{document}
\keystroke{Q}
\end{document}

Error (when running xelatex test.tex):

! Package polyglossia Error:
The current roman font does not contain the Cyrillic script!
Please define \cyrillicfont with \newfontfamily.

See the polyglossia package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.8 \keystroke{Q}

When I compile with TeXLive 2009, the same file works fine. What is wrong?

share|improve this question
1  
The fact that it "worked" in TeX Live 2009 doesn't say much. Don't load xltxtra, but fontspec and define as main font one that has support for cyrillic. –  egreg Jun 2 '13 at 13:04
    
@egreg - I updated the example. It now uses fontspec, defines Ubuntu as a new font, but the error is still there. –  Rogach Jun 2 '13 at 13:07

1 Answer 1

up vote 3 down vote accepted

The error message is, unfortunately, not very informative. The keystroke package uses, for its drawings, the sans serif font.

In some cases Polyglossia is not able to extract information about the scripts supported by a font, so you have to help it. But first of all, you have to set a sans serif font. Here's the version with Linux Libertine and Biolinum (I don't have Ubuntu):

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Linux Libertine O}
\setsansfont[Ligatures=TeX]{Linux Biolinum O}
\usepackage{polyglossia}
\setmainlanguage{russian}
\usepackage{keystroke}
\begin{document}
\keystroke{Q}
\end{document}

Try with

\setsansfont[Ligatures=TeX]{Ubuntu}

and, if the message is still there, add

\newfontfamily{\cyrillicfontsf}[Ligatures=TeX]{Ubuntu}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.