I am trying to configure Cyrillic (namely, the Russian language) in my LaTeX template. I successfully downloaded the template like this: LaTeX book template dependent files
The only change that I made to the template was in the main.tex
file, which I'm showing the snippet of code below:
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[11pt,fleqn]{book} % Default font size and left-justified equations
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,letterpaper]{geometry} % Page margins
\usepackage{fontspec} % loaded by polyglossia, but included here for transparency
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{russian}
%\newfontfamily\russianfont[Script=Cyrillic]{Linux Libertine}
\usepackage{xcolor} % Required for specifying colors by name
\definecolor{ocre}{RGB}{52,177,201} % Define the orange color used for highlighting throughout the book
% Font Settings
\usepackage{avant} % Use the Avantgarde font for headings
%\usepackage{times} % Use the Times font for headings
\usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the SymÂbol, Chancery and ComÂputer Modern fonts
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
% Bibliography
\usepackage[style=alphabetic,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}
\addbibresource{bibliography.bib} % BibTeX bibliography file
\defbibheading{bibempty}{}
\input{structure} % Insert the commands.tex file which contains the majority of the structure behind the template
\begin{document}
%----------------------------------------------------------------------------------------
% TITLE PAGE
%----------------------------------------------------------------------------------------
\begingroup
\thispagestyle{empty}
\AddToShipoutPicture*{\put(0,0){\includegraphics[scale=1.25]{esahubble}}} % Image background
\centering
\vspace*{5cm}
\par\normalfont\fontsize{35}{35}\sffamily\selectfont
\textbf{Привет}\\
{\LARGE Data Mining and Machine Learning in Astronomy}\par % Book title
\vspace*{1cm}
{\Huge Andrea Hidalgo}\par % Author name
\endgroup
As you can see, I've added one Russian word at the bottom of the file and attempted setting up Russian at the top of the file. I have tried these options so far: How to include russian in LaTeX (LEd)? and Cyrillic in (La)TeX. I have tried a few different options from these two existing questions.
I seem to be running into an issue with babel
, something along these lines: babel with russian and english language. Specifically, the compiler doesn't like this specific line in my structure.tex
file: \usepackage[english]{babel} % English language/hyphenation
. I have tried specifying russian
inside its scope, but that doesn't solve my issue.
Can anyone please help me configure Russian for my template? I don't understand why none of those options have worked for me (yet).
EDIT
Another MWE using suggestions provided from here: https://www.sharelatex.com/learn/Russian
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[11pt,fleqn]{book} % Default font size and left-justified equations
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,letterpaper]{geometry} % Page margins
\usepackage{xcolor} % Required for specifying colors by name
\definecolor{ocre}{RGB}{52,177,201} % Define the orange color used for highlighting throughout the book
% Font Settings
\usepackage{avant} % Use the Avantgarde font for headings
%\usepackage{times} % Use the Times font for headings
\usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the SymÂbol, Chancery and ComÂputer Modern fonts
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T2A]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage[russian]{babel}
% Bibliography
\usepackage[style=alphabetic,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}
\addbibresource{bibliography.bib} % BibTeX bibliography file
\defbibheading{bibempty}{}
\input{structure} % Insert the commands.tex file which contains the majority of the structure behind the template
pdflatex
with commands and packages meant forxelatex
. This won't work. Instead of trying to adapt a large template you should better start with small examples and learn the differences between the engines. – Ulrike Fischer Aug 17 '15 at 8:21