If I have a font in which lookups exist c2sc as built-in, there is a command to make small caps capital letters without incurring complicated codes like this: Convert all-caps words to small caps I mean something like \textsc{...}, but with uppercase?
1 Answer
You can write your own declarations and commands for c2sc
and for putting everything in small caps:
\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}
In most cases, there’s no advantage to doing this. But with EB Garamond and some commercial fonts, text in \textsc{...}
copies as lowercase, while text set with c2sc
copies as uppercase.
-
thank you. In any case \def is a Tex primitive, \newrobustcmd not and makes some contols before its execution. Here they are more or less the same May 25, 2019 at 15:40
\textsc{\MakeLowercase{YOURTEXT}}
?\MakeUppercase{Xxxx...}
to use the "real" uppercase.fontspec
.