I've just had a problem on using babel with lualatex (or xelatex as well) and fontspec in the context of latin and cyrillic alphabets. Here is a minimal example:
\documentclass[11pt]{article}
\usepackage{fontspec}
\setmainfont{Heuristica}%
\usepackage[english,russian]{babel}
\newcommand*\English{\selectlanguage{english}}
\begin{document}
\textup{\Russian Мороз и солнце, день чудесный}
\English\textit{The sea is calm to-night.}
\end{document}
And here's the resulting .pdf:
As one can see, the font used for the English part of the text is Computer Modern
, not Heuristica
, and there's not even italic where it's supposed to be italic.
However, if I change the order of the languages ([russian, english]
, everything is fine:
If I compile with pdflatex
, modifying accordingly the preamble and using the type 1 versions of the fonts instead of the opentype, everything is fine whatever the order of the languages. I tried with some other fonts, same problem. Is this a bug or do I miss something?
Best Answer
egreg's answer now explains why this works which I didn't understand when I posted it as a comment.
If you load
fontspec
afterbabel
, then it all works:But note that the
fontspec
manual describesbabel
as 'not really supported' and recommendspolyglossia
(page 4). I assume they mean for languages supported by the latter which is not all of them but does include Russian.