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
    \(\lambda_{\text{сист}}\) – egreg Jun 29 '14 at 22:33
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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.