如果我有一个内置有查找 c2sc 的字体,则有一个命令可以将小型大写字母变为大写字母,而无需产生像这样的复杂代码: 将全大写单词转换为小写单词 我的意思是像 \textsc{...} 这样的东西,但是是大写的?
答案1
您可以编写自己的声明和命令c2sc
,并将所有内容变成小写:
\documentclass[12pt]{article}
\usepackage{fontspec}
\setmainfont{EB Garamond}
%%% make uppercase letters small caps:
% declaration
\DeclareRobustCommand\csc{\addfontfeature{Letters=UppercaseSmallCaps}}
% command
\DeclareTextFontCommand{\textcsc}{\csc}
%%% make all letters small caps:
% declaration
\DeclareRobustCommand\asc{\addfontfeature{Letters=UppercaseSmallCaps,Letters=SmallCaps}}
% command
\DeclareTextFontCommand{\textasc}{\asc}
\begin{document}
{\csc This declaration gives UPPERCASE SMALL CAPS.}
\textcsc{This command gives UPPERCASE SMALL CAPS.}
{\asc Now lower- and UPPERCASE letters are all small caps.}
This is \textasc{a TEST.} This is \textasc{only a TEST.}
\end{document}
在大多数情况下,这样做并没有什么好处。但对于 EB Garamond 和一些商业字体,文本在\textsc{...}
副本中显示为小写,而在副本中显示c2sc
为大写。