# Russian and Spanish babel

I want to use both Russian and Spanish in my document but it's not working. It just shows question marks for the Russian. Could you point out my error?

\documentclass[a4paper,openany,12pt]{extbook}
\usepackage[spanish, russian]{babel}
\selectlanguage{spanish}
\usepackage[latin1]{inputenc}

\foreignlanguage{russian}{Смирнова, В И. (2008). ЛЕОНАРД ЭЙЛЕР: К 300-ЛЕТИЮ СО ДНЯ РОЖДЕНИЯ. Санкт-Петербург: Нестор-История.}

• Just a guess: latin1 is, well, for the Latin script. – Javier Bezos Apr 12 '18 at 14:04

The main problem is that the latin1 encoding does not cover Russian letters. It would be best to switch to utf8; make sure you save you file with this encoding.

\documentclass[a4paper,openany,12pt]{extbook}

\usepackage[utf8]{inputenc}
\usepackage[main=spanish,russian]{babel}

\begin{document}

\foreignlanguage{russian}{Смирнова, В И. (2008). ЛЕОНАРД ЭЙЛЕР: К
300-ЛЕТИЮ СО ДНЯ РОЖДЕНИЯ. Санкт-Петербург: Нестор-История.}

\end{document}


With the newest version of LaTeX, utf8 will be assumed automatically and you can omit the inputenc package. If you use inputenc is should come before the babel package.

The babel options allow one to specify one language as the principal one by giving main=.