我正在尝试使用西里尔字母ACM 官方主模板。要使用西里尔字母,必须使用 T2A 字体编码,因此我设置了 ,\usepackage[T1, T2A]{fontenc}
因为我同时使用英语和西里尔字体。不幸的是,它崩溃了,因为此模板中的其他包无法处理这种字体编码。从 切换到pdflatex
或lualatex
也xelatex
不起作用。
在我的特殊情况下,我只需要一个西里尔字符,即И。
是否可以仅使用 T1 字体编码并生成 utf-8 字符作为此单个字符?
答案1
我不知道您要提交的期刊具体接受什么。但这里有一个精简版的模板,它在文本和数学模式下都添加了这个西里尔字母。由于模板声明您应该使用字体包libertine
,因此它采用了 Libertinus Serif 和 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'.
另一种方法是\DeclareMathSymbol
,尽管这需要您用完在传统 TeX 中允许定义的有限数量的数学字母之一。
编辑
您在评论中提到在 XeLaTeX 中编译此内容。模板似乎没有设置为支持这一点,但这个快速而肮脏的黑客出现工作。请与期刊核对。
\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}
答案2
我尝试了多种方法并得出结论这个答案是在 LaTeX 数学中插入西里尔字母最灵活的方法。这个文件包含 T2A 中西里尔字母的所有代码。
按照上面引用的答案,我添加了以下在数学符号中可能有用的字母(第二个数字代码是小写字母,我还没有导入):
引用
\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
要在数学块中使用它们,您只需插入代码即可,例如:
$\mathbf{\mZhe}$