I have discovered that fontspec with russian babel settings doesn't work with datetime package. I tried to compile such code:
\documentclass[a4paper,11pt]{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[main=russian,english]{babel}
\usepackage{datetime}
\usepackage[cm-default]{fontspec}
\begin{document}
\today
\end{document}
with a xelatex and got an error: Command \cyri unavailable in encoding EU1.
Is there any way to handle it?
UPDATE: I really bungle with charset in XeLateX. Thanks to egreg. I have removed fontenc and inputenc and used some cyrillic font, so my MWE now looks this way:
\documentclass[a4paper,11pt]{article}
\usepackage[main=russian,english]{babel}
\usepackage{fontspec}
\setromanfont{PT Sans}
\usepackage{datetime}
\begin{document}
\today
\end{document}
and I've got another error, if I used russian as a main language in babel: Undefined control sequence. \\monthnamerussian ...cyrm \cyra \cyrya \or \cyri \cyryu \cyrn \cyrya \or \c...
Is it still because of XeLaTeX?
fontenc
norinputenc
with XeLaTeX. Thecm-default
option tofontspec
is obsolete. I'm afraid thatdatetime
needs surgery in order to be compatible with XeLaTeX. You don't get Cyrillic with that document anyway, unless you set up a font that supports this script (which the default font withfontspec
doesn't).