1

I am using \usepackage{fontspec} together with the text encoding conversion file (ascii-to-serbian.tec) in order to obtain a XeLaTeX->PDF output file in Serbian Cyrillic script. TeX code (see below) is entirely typed in Latin with the Times New Roman output font. However, I am curious is it possible in such a way to produce output PDFs with a Computer Modern font that is the default font in LaTeX. There seems to be an issue in the code when {Times New Roman} is replaced with {Computer Modern}, {Computer Modern Unicode}, or similar. Any help would be highly appreciated.

\documentclass{article}
\usepackage{fontspec}

\setmainfont[Ligatures=TeX]{Times New Roman}
\newfontfamily{\serbianfont}[Mapping=ascii-to-serbian]{Times New Roman}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[Script=Cyrillic]{serbian}

\begin{document}

Novak Djokovi\'{c} in Serbian Latin script

\begin{serbian}
Novak Djokovi\'{c}
\end{serbian}
in Serbian Cyrillic script

\begin{serbian}
\textbf{Novak Djokovi\'{c}}
\end{serbian}
in bold Serbian Cyrillic script

\begin{serbian}
\textit{Novak Djokovi\'{c}}
\end{serbian}
in italic Serbian Cyrillic script

\end{document}

1 Answer 1

3

You can use fonts from cm-unicode. They contain cyrillic and should normally work in the same way in your setup:

\documentclass{article}
\usepackage{fontspec}

%\setmainfont[Ligatures=TeX,Script=Cyrillic]{Times New Roman}
\setmainfont[Ligatures=TeX,Script=Cyrillic]{CMU Serif}
\begin{document}
Эйн текст в кириллице


\end{document}

enter image description here

5
  • Thank you Ulrike Fischer. However, the major idea is to circumvent typing text-code in Cyrillic script to avoid eventual keyboard incompatibilities with other TeX editors.
    – Savchenko
    Commented Feb 3, 2019 at 15:46
  • 1
    I know. As I wrote: it should work with your setup too. I only used directly cyrillic to test if the glyphs are there - I didn't want have to install the tec-file. Did you try the font? Commented Feb 3, 2019 at 15:51
  • I've just tried to compile the code; with no success, unfortunately.
    – Savchenko
    Commented Feb 3, 2019 at 15:58
  • 1
    I compiled the tec and tried your example with \newfontfamily{\serbianfont}[Mapping=ascii-to-serbian]{CMU Serif} and it works without any problems. Why did you accept the answer if it doesn't work for you? Commented Feb 3, 2019 at 16:05
  • Anyhow, the answer is helpful as it refers me to look somewhere else while resolving the issue - for instance, TeX compilers, installed packages etc...
    – Savchenko
    Commented Feb 3, 2019 at 16:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .