1

I'm trying to use Cyrillic letters in the ACM Official Master Template. To use Cyrillic letters it is necessary to use the T2A font encoding, so I set \usepackage[T1, T2A]{fontenc} because I use both, English and Cyrillic fonts. Unfortunately, it crashes because other packages in this template cannot handle this kind of font encoding. Switching from pdflatex to lualatex or xelatex didn't work either.

In my special case I would only need one Cyrillic character, which is И.

Is it possible to use only T1 font encoding and generate a utf-8 character as this single character?

5
  • You probably want to \usepackage[T2A,T1]{fontenc}. This sets T1 as the default encoding and T2A as the supplemental one, instead of the other way around.
    – Davislor
    May 3, 2020 at 10:05
  • It is also possible to use a single symbol from a T2A font, but that’s really an XY problem.
    – Davislor
    May 3, 2020 at 10:06
  • Where should the character be used? In math? If so, should it be upright or italic?
    – egreg
    May 3, 2020 at 10:07
  • Also, I believe you can compile an acmart document in XeLaTeX and just use Unicode.
    – Davislor
    May 3, 2020 at 10:11
  • If you’re not using the OpenType version of Libertine in XeTeX, you might need to substitute Libertinus Serif/Sans as your T2A font.
    – Davislor
    May 3, 2020 at 10:22

2 Answers 2

1

I don’t know precisely what the journal you want to submit to accepts. but here’s a pared-down version of the template that adds this Cyrillic character, in both text and math mode. Since the template states that you should use the libertine font package, it takes the Cyrillic alphabet from Libertinus Serif and Libertinus Sans.

%%%% Generic manuscript mode
\documentclass[manuscript,screuen,review]{acmart}
\usepackage{iftex}

\ifPDFTeX
  \usepackage[T2A,T1]{fontenc}
  \usepackage{newunicodechar, substitutefont}

  \substitutefont{T2A}{LinuxLibertineT-TLF}{LibertinusSerif-TLF}
  \substitutefont{T2A}{LinuxBiolinumT-TLF}{LibertinusSans-TLF}
  \newunicodechar{И}{{\fontencoding{T2A}\selectfont\symbol{"C8}}}
\fi

\newcommand\mitcyrI{\mathord{\text{\rmfamily\mdseries\itshape И}}}
\newcommand\mupcyrI{\mathord{\text{\rmfamily\mdseries\upshape И}}}
\newcommand\mbfitcyrI{\mathord{\text{\rmfamily\bfseries\itshape И}}}
\newcommand\mbfupcyrI{\mathord{\text{\rmfamily\bfseries\upshape И}}}
\newcommand\msfupcyrI{\mathord{\text{\sffamily\mdseries\upshape И}}}

%%
%% \BibTeX command to typeset BibTeX logo in the docs
\AtBeginDocument{%
  \providecommand\BibTeX{{%
    \normalfont B\kern-0.5em{\scshape i\kern-0.25em b}\kern-0.8em\TeX}}}

%% Rights management information.  This information is sent to you
%% when you complete the rights form.  These commands have SAMPLE
%% values in them; it is your responsibility as an author to replace
%% the commands and values with those provided to you when you
%% complete the rights form.
\setcopyright{acmcopyright}
\copyrightyear{2018}
\acmYear{2018}
\acmDOI{10.1145/1122445.1122456}

%%
%% end of the preamble, start of the body of the document source.
\begin{document}

%%
%% The "title" command has an optional parameter,
%% allowing the author to define a "short title" to be used in page headers.
\title{The Name of the Title is Hope}

\maketitle

\section{Introduction}

The Cyrillic letter И can mean the variable \(\mitcyrI\), the constant \(\mupcyrI\), the vector \(\mbfitcyrI\) or the constant vector \(\mbfupcyrI\).  Other forms such as \textsf{И} for tensors could be defined similarly as \(\msfupcyrI\).

\end{document}
\endinput
%%
%% End of file `sample-manuscript.tex'.

Libertinus font sample

An alternative would be to \DeclareMathSymbol, although this would require you to use up one of the limited number of math alphabets you are allowed to define in legacy TeX.

Edit

You mentioned in a comment compiling this in XeLaTeX. The template does not seem to have been set up to support that, but this quick and dirty hack appears to work. Check with the journal.

\RequirePackage[no-math]{fontspec}
\defaultfontfeatures[LinLibertine]{NFSSFamily=LinuxLibertineT-TLF}
\documentclass[manuscript,screuen,review]{acmart}
\usepackage[nomath]{libertinus}

\newcommand\mitcyrI{\mathord{\text{\rmfamily\mdseries\itshape И}}}
\newcommand\mupcyrI{\mathord{\text{\rmfamily\mdseries\upshape И}}}
\newcommand\mbfitcyrI{\mathord{\text{\rmfamily\bfseries\itshape И}}}
\newcommand\mbfupcyrI{\mathord{\text{\rmfamily\bfseries\upshape И}}}
\newcommand\msfupcyrI{\mathord{\text{\sffamily\mdseries\upshape И}}}

%%
%% \BibTeX command to typeset BibTeX logo in the docs
\AtBeginDocument{%
  \providecommand\BibTeX{{%
    \normalfont B\kern-0.5em{\scshape i\kern-0.25em b}\kern-0.8em\TeX}}}

%% Rights management information.  This information is sent to you
%% when you complete the rights form.  These commands have SAMPLE
%% values in them; it is your responsibility as an author to replace
%% the commands and values with those provided to you when you
%% complete the rights form.
\setcopyright{acmcopyright}
\copyrightyear{2018}
\acmYear{2018}
\acmDOI{10.1145/1122445.1122456}

%%
%% end of the preamble, start of the body of the document source.
\begin{document}

%%
%% The "title" command has an optional parameter,
%% allowing the author to define a "short title" to be used in page headers.
\title{The Name of the Title is Hope}

\maketitle

\section{Introduction}

The Cyrillic letter И can mean the variable \(\mitcyrI\), the constant \(\mupcyrI\), the vector \(\mbfitcyrI\) or the constant vector \(\mbfupcyrI\).  Other forms such as \textsf{И} for tensors could be defined similarly as \(\msfupcyrI\).

\end{document}
3
  • 1
    You are clearly a font-magician. Works like a charm for pdflatex. For xelatex I get 7 Warnings in the style of "Font shape `T2A/lmr/m/n' undefined using T2A/cmr/m/n instead", but I think they can be savely ignored.
    – boraas
    May 4, 2020 at 6:52
  • 1
    @boraas Compiling in XeLaTeX breaks the template. You might get it to work by loading the libertine package, but you’d really want to contact the journal and ask them what alterations to the template they accept.
    – Davislor
    May 4, 2020 at 6:56
  • 1
    @boraas I added a quick hack to get the template to compile in XeLaTeX with OpenType fonts. I have no idea if it breaks anything else in your document, or whether the journal would accept it.
    – Davislor
    May 4, 2020 at 7:37
0

I have tried multiple ways and concluded that this answer is the most flexible way to insert Cyrillic letters in LaTeX math. This document contains all the codes for Cyrillic letters in T2A.

Following the answer cited above, I have added the following letters that could be useful in mathematical notations (the second numeric codes are for the lower case letters, which I did not yet import):

Blockquote

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[T2A,T1]{fontenc}
\DeclareSymbolFont{cyrillic}{T2A}{cmr}{m}{n}%{it}
\SetSymbolFont{cyrillic}{bold}{T2A}{cmr}{bx}{n}%{it}
\DeclareMathSymbol{\mBe}{\mathord}{cyrillic}{193}%Б б 225
\DeclareMathSymbol{\mDe}{\mathord}{cyrillic}{196}%Д д 228
\DeclareMathSymbol{\mZhe}{\mathord}{cyrillic}{198}%Ж ж 230
\DeclareMathSymbol{\mI}{\mathord}{cyrillic}{200}%И и
\DeclareMathSymbol{\mEl}{\mathord}{cyrillic}{203}%Л л 235
\DeclareMathSymbol{\mTse}{\mathord}{cyrillic}{214}%Ц ц 246 or 84 116 ?
\DeclareMathSymbol{\mChe}{\mathord}{cyrillic}{215}%Ч ч 247
\DeclareMathSymbol{\mSha}{\mathord}{cyrillic}{216}%Ш ш 248
\DeclareMathSymbol{\mE}{\mathord}{cyrillic}{221}%Э э 253
\DeclareMathSymbol{\mYu}{\mathord}{cyrillic}{222}%Ю ю 254
\DeclareMathSymbol{\mYa}{\mathord}{cyrillic}{223}%Я я 255

To use them in math blocks you can simply insert the codes, e.g.:

$\mathbf{\mZhe}$

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.