3

How to use mathspec package and polyglossia for the russian language?

MWE

\documentclass[14pt]{extreport}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{commath}    % \dif sign
\usepackage{array}
\usepackage{mathspec}

\usepackage{polyglossia}
\usepackage{ucharclasses}
\usepackage{microtype} % better management of overfulls


\setdefaultlanguage{russian}
\setotherlanguage{english}
\setTransitionsForLatin{\begingroup\hyphenrules{english}}{\endgroup}
%\setallmainfonts[Mapping=tex-text, Numbers={Lining,Proportional}]{Times New Roman}
\setmainfont[Mapping=tex-text]{Times New Roman}
\setmathfont{Latin Modern Math}
\setmonofont{Consolas}
\DeclareMathSizes{12}{12}{8}{6}
\DeclareMathSizes{14}{14}{9}{7}


\begin{document}
  \(\lambda_{сист}\) --- интенсивность системы.
\end{document}

enter image description here

1
  • 1
    \(\lambda_{\text{сист}}\)
    – egreg
    Commented Jun 29, 2014 at 22:33

1 Answer 1

3

You have to tell XeLaTeX that the subscript is textual:

\documentclass[14pt]{extreport}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{array}
\usepackage{mathspec}

\usepackage{polyglossia}
\usepackage{ucharclasses}
\usepackage{microtype} % better management of overfulls


\setdefaultlanguage{russian}
\setotherlanguage{english}
\setTransitionsForLatin{\begingroup\hyphenrules{english}}{\endgroup}
\setallmainfonts[Mapping=tex-text, Numbers={Lining,Proportional}]{Times New Roman}
%\setmainfont[Mapping=tex-text]{Times New Roman}
\setmonofont{Consolas}
\DeclareMathSizes{12}{12}{8}{6}
\DeclareMathSizes{14}{14}{9}{7}

\newcommand{\dif}{\mathop{}\!\mathrm{d}}

\begin{document}

\(\lambda_{\text{сист}}\) --- интенсивность системы.

\("f(x,y)\dif x+g(x,y)\dif y\)

\end{document}

enter image description here

I have removed the call to commath that I can't recommend. I added instead a good definition for \dif, certainly better than the wrong one given by commath.

However, I'd advise you to use a specialized math font instead of the clumsy mathspec.

\documentclass[14pt]{extreport}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{array}
\usepackage{unicode-math}

\usepackage{polyglossia}
\usepackage{ucharclasses}
\usepackage{microtype} % better management of overfulls


\setdefaultlanguage{russian}
\setotherlanguage{english}

\setTransitionsForLatin{\begingroup\hyphenrules{english}}{\endgroup}

\setmainfont[Ligatures=TeX]{Times New Roman}
\setmathfont{XITS Math}
\setmonofont{Consolas}
\DeclareMathSizes{12}{12}{8}{6}
\DeclareMathSizes{14}{14}{9}{7}

\newcommand{\dif}{\mathop{}\!\mathrm{d}}

\begin{document}

\(\lambda_{\text{сист}}\) --- интенсивность системы.

\(f(x,y)\dif x+g(x,y)\dif y\)

\end{document}

enter image description here

This is what I get if TeX Gyre Termes Math is used instead of XITS Math:

enter image description here

You must log in to answer this question.

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