3

With LuaLaTeX I had compiled the same code by different distributions:

LuaLaTeX 0.95.0/TeXLive 2016

LuaLaTeX 1.0.4/MiKTeX 2.9.6236

updated to the latest versions.

Unfortunately, I got different results for polyglossia behaviour.

With the following code:


%%============================ Compiler Directives =======================%%
%%                                                                        %%
% !TeX program = lualatex                                    
% !TeX encoding = utf8
% !TeX spellcheck = uk_UA

\documentclass{article}

%%============================ languagee ann encodings ===================%%

\usepackage{polyglossia}
\setmainlanguage{ukrainian}
\setotherlanguage{russian}
\setotherlanguage{english}
\setsansfont{Arial}
\setmainfont{Times New Roman}
\setmonofont{Consolas}
\defaultfontfeatures{Ligatures={TeX}}
\usepackage[math-style=TeX]{unicode-math}

%%========================================================================%%

\begin{document}

Some text

Якийсь текст

Какой-то текст

\end{document}

LuaLaTeX 0.95.0/TeXLive 2016 works fine.


But LuaLaTeX 1.0.4/MiKTeX 2.9.6236 produce an error:

! Package polyglossia Error: The current roman font does not contain the Cyrillic script!
(polyglossia)                Please define \cyrillicfont with \newfontfamily.

See the polyglossia package documentation for explanation.

Main question is: Why only with LuaLaTeX 1.0.4/MiKTeX 2.9.6236 should I use any other nonintuitive constructions for using fonts differ from Latin?

Is this a bug of LuaLaTeX 1.0.4?

I note that in selected fonts the necessary symbols are present.

log-file

16
  • 1
    The error message is only issued when you add \texttt{...} in a Ukrainian context. And it does also in TeX Live, of course. Solution: \newfontfamily{\cyrillicfonttt}{<some monospaced font supporting Cyrillic>}. I guess some specific MiKTeX configuration file kicks in, but it's unimportant, as the declaration above is needed whenever the font set with \setmonofont has no specific support for Cyrillic.
    – egreg
    Apr 24, 2017 at 16:54
  • @egreg MyTeXLive works fine even with \texttt{...} and the preamble. Just checked Apr 24, 2017 at 16:59
  • Then the problem is in the font. Sorry, but I don't have Consolas.
    – egreg
    Apr 24, 2017 at 17:01
  • @egreg I had try \newfontfamily{\cyrillicfonttt}{Consolas} and got the same error with MikTeX. Apr 24, 2017 at 17:06
  • @egreg Just cheched xelatex/MikTeX with MWE preamble. Works fine. I think, the problem in MikTeX'sLuaLaTeX Apr 24, 2017 at 17:17

2 Answers 2

1

From your log-file one can see that you are using a local version of times.ttf, in E:/Projects/LaTeX/Z_LaTeX_XP/Fizmatlit/localtexmf/fonts/truetype/times.ttf and one can also see that this font doesn't has correct Script features:

. fontspec info: "no-scripts"
. 
. Font "TimesNewRoman" does not contain any OpenType `Script' information.

So it is quite probable that the font is faulty, and as it is in a localtexmf is is also probable that only your miktex system is using it which would explain why only miktex doesn't work. This types of errors depends normally on a concrete font file, and so can be easily system and font dependant.

2

works with LuaTeX 1.0.4:

\documentclass{article}
\usepackage[math-style=TeX]{unicode-math}
\usepackage{libertine}
\setmonofont[Scale=0.9,FakeStretch=0.9]{Consolas}
\newfontface\cyrillicfont{Linux Libertine O}
\usepackage{polyglossia}
\setmainlanguage{ukrainian}
\setotherlanguage{russian}
\setotherlanguage{english}

\begin{document}

    Some text

    Якийсь текст

    Какой-то текст

\ttfamily   
    Some text

    Якийсь текст

    Какой-то текст
\end{document}

enter image description here

2
  • Yes, with \usepackage{libertine} very well. But, what if I want to use a system font? (I use Win10) Apr 24, 2017 at 18:38
  • 2
    You have to use a font which has the cyrillic letters. Times has no one!
    – user2478
    Apr 24, 2017 at 19:25

You must log in to answer this question.

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