5
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{russian}
\setmainfont[Ligatures=TeX]{Times New Roman}
\begin{document}
\section{Test}
\end{document}

I already tried what was suggested here. here, and here. Tried to compile with XeTeX and LuaLaTeX but the result is same.

And this font does support cyrillic script, the following compiles and looks properly:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Times New Roman}
\begin{document}
АБВГД
\end{document}
Hanlon
  • 265
  • 2
  • 12
  • 1
    Welcome to TeX.SX. Add \newfontfamily\cyrillicfont{Times New Roman}[Script=Cyrillic] after the \setmainfont command. See here for futher reference: https://tex.stackexchange.com/questions/91507/liberation-mono-the-current-roman-font-does-not-contain-the-cyrillic-script and https://tex.stackexchange.com/questions/223327/lualatex-xelatex-with-koma-for-cyrillics – Jasper Habicht Feb 05 '18 at 12:39
  • 2
    Some fonts don't advertise their support for scripts in the expected way. It may depend on the particular version of Times New Roman you have: on my system I get no error about the script. – egreg Feb 05 '18 at 13:02
  • I don't get an error, even if I explictly use a font which doesn't have cyrillic. That's rather curious. Could you show your log-file? – Ulrike Fischer Feb 05 '18 at 14:30
  • @UlrikeFischer I could replicate the problem using Overleaf. Maybe you want to check over there? If I compile it on a Mac, there is no warning or error. – Jasper Habicht Feb 05 '18 at 14:57
  • To expand upon what egreg wrote above: An Open Type font may have characters in the Cyrillic locations, yet not have any "scripts" for Cyrillic, pertaining to such things such as kerning, ligatures, and substitutions. I am not sure that has anything to do with the problem, since AFAIK no scripts of any kind are strictly required. I do know that fontspec will not normally accept a font as a math font, if it does not have a math script. –  Feb 05 '18 at 15:24
  • 1
    @JasperHabicht If you compile on overleaf with lualatex and try to use times new roman, which font is used at the end? Beside this I just realize that fonts without cyrillic chars can neverless have the cyrillic script ;-). – Ulrike Fischer Feb 05 '18 at 16:49

1 Answers1

3
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{russian}
\setmainfont[Ligatures=TeX]{Times New Roman}
\newfontfamily\cyrillicfont{Times New Roman}[Script=Cyrillic]
\begin{document}
\section{Test}
\end{document}

Credits go to Jesper Habicht (and egreg).

Hanlon
  • 265
  • 2
  • 12
  • Credits rather go to egreg who originally helped other with this problem. – Jasper Habicht Feb 05 '18 at 15:06
  • The only downside is that now you get warning that Font 'Times New Roman' does not contain script 'Cyrillic'. This is not true, the document compiles without problems and it looks just like it should look. – Hanlon Feb 05 '18 at 18:01
  • 1
    Just remove the Script=Cyrillic option. – egreg Feb 05 '18 at 19:02
  • 1
    That's not a bad warning, it is merely confusing if you don't know the internals of Open Type fonts. What it means is that none of the font internal instructions, pertaining to things such as kerning, substitutions, and ligatures, has instructions for what to do about Cyrillic characters. So, if Cyrillic characters are in the font, they are used "as-is" without any magical Open Type modifications. However, I do not know the underlying logic of fontspec, in that regard. –  Feb 05 '18 at 19:03