[Tex/LaTex] How to change the language of datetime


Сondition to change language of the month on titlepage doesn't work.

How to write condition to activate russian or english date depending on the choice?

XeLaTeX is used.

My code doesn't work. MWE:

\documentclass[10pt, oneside, a4paper]{report}



{ %rus
\newdateformat{docdatef}{\rus{\monthname\ \THEYEAR}}
\newdateformat{docdatef}{\monthname\ \THEYEAR}

Best Answer

The language definition file dt-russian.def (provided by datetime) uses commands like \cyrya in the month names, which aren't provided with XeLaTeX. However, datetime has been replaced by datetime2 and the corresponding datetime2-russian module (which needs to be installed separately) provides UTF-8 support.




\setmainfont{Liberation Serif}
\newfontfamily\cyrillicfont{Liberation Serif}







January 2018 января 2018 г.

Related Question