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?
Asked
Active
Viewed 1,249 times
1
1 Answers
3
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.
Thérèse
- 12,679
-
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 – user41063 May 25 '19 at 15:40

\textsc{\MakeLowercase{YOURTEXT}}? – Marijn May 22 '19 at 21:14\MakeUppercase{Xxxx...}to use the "real" uppercase. – barbara beeton May 22 '19 at 21:15fontspec. – Davislor May 22 '19 at 21:21\def\smcp#1{{\addfontfeature{Letters=UppercaseSmallCaps}#1}}. – Thérèse May 22 '19 at 23:38\def\smcp#1{{\addfontfeature{Letters=UppercaseSmallCaps}#1}}or\newrobustcmd\smcp[1]{{\addfontfeature{Letters=UppercaseSmallCaps}#1}}? – user41063 May 23 '19 at 11:01