I have an MWE below showing my problem (I got the general document outline from this answer:



\newfontfamily\cyrillicfontsf{CMU Sans Serif}[Script=Cyrillic]

% What I'm trying to replace
% \newfontfamily\cyrillicfont{CMU Serif}[Script=Cyrillic]

% What I'm trying to replace it with
\mycommand{cyrillic}{CMU Serif}


\author{А.В. Тор}
\title{Великий об'єм }

So the problem here is that I feel as though what I'm trying to replace and what I'm trying to replace it by are equivalent. However, I am thrown the following error:

fontspec error: "font-not-found"
! The font "c" cannot be found.
! See the fontspec documentation for further information.
! For immediate help type H <return>.

So it seems to be taking just the first letter of the argument cyrillic, but that seems strange as I'm putting it in the \csname ... \endcsname environment. How should I go about fixing this?

I also tried \expandafter before the \newcommand, but that doesn't seem to work either.

  • I'm really dubious about the usefulness of such a command.
    – egreg
    Jul 4 '17 at 21:03

\newfontfamily does not see a command sequence, but \csname as first argument. \expandafter helps by creating the command sequence before \newfontfamily parses its arguments:


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.