在 LaTeX 模板中添加西里尔字母

在 LaTeX 模板中添加西里尔字母

我正在尝试在 LaTeX 模板中配置西里尔文(即俄语)。我成功下载了模板,如下所示:LaTeX 书籍模板依赖文件

我对模板做的唯一更改是在文件中main.tex,下面显示了代码片段:

%----------------------------------------------------------------------------------------
    %   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

如您所见,我在文件底部添加了一个俄语单词,并尝试在文件顶部设置俄语。到目前为止,我尝试了以下选项:如何在 LaTeX (LEd) 中包含俄语?(La)TeX 中的西里尔字母。我从这两个现有问题中尝试了几个不同的选项。

我似乎遇到了一个问题babel,类似这样的问题:俄语和英语的 babel。具体来说,编译器不喜欢我的structure.tex文件中的这一特定行:\usepackage[english]{babel} % English language/hyphenation。我尝试russian在其范围内指定,但这并不能解决我的问题。

有人能帮我为我的模板配置俄语吗?我不明白为什么这些选项对我来说都不起作用(到目前为止)。

编辑

另一个 MWE 使用此处提供的建议:https://www.sharelatex.com/learn/俄语

%----------------------------------------------------------------------------------------
%   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

相关内容