The problem
I want to follow The Economist's example for annoyingly mixed-case words: letterspace them, capitalize the first letter according to normal rules, and set all other capitals as small capitals. And I'd like it to be as transparent as possible – one command, \ac, in the normal case and another, \Ac, when capitalized.
My attempt
In XeLaTeX, \ac can be implemented with a simple font change. But \Ac needs to apply that font change to all but the first letter. I found something similar (the \Upeach command) in a 2007 TUGboat article by Peter Wilson and modified it a little.
\documentclass[12pt]{standalone}
\usepackage{fontspec}
% Define \ac
\newfontface\acface[Letters=UppercaseSmallCaps,LetterSpace=6]{Minion Pro}
\newcommand{\ac}[1]{{\acface #1}}
% Define \Ac
%%% Non-working code removed; see the TUGboat article for the original
%%% Or egreg's answer for a much better solution
The actual questions
- Is there a simpler way to do this than butchering
\Upeach? - Can the butchered
\Upeachbe modified to stop it from eating spaces?
glossariespackage with thesmallcapsoption? It provides\glswhich does what your\acdoes (with the added bonus of providing the definition upon first use) and\Glswhich does what your\Acdoes (also provides\glsplfor plurals etc.). I assume this is too translucent for you, but just wanted to mention it if you have not considered it. – mforbes Dec 23 '11 at 05:19smallcapsoption,\glsmakes lowercase small caps. If I\let\acronymfont\acthen\glsmakes uppercase small caps. But then\Glsjust sets the entire acronym as small caps (i.e., no lowercase or uppercase), which is emphatically not what I want. – Chel Dec 23 '11 at 06:03\setmainfont[SmallCapsFeatures={LetterSpace=6}]{Minion Pro}, then use theglossariescommands\let\ac\gls, and\let\Ac\Gls. I see that it is somewhat difficult to redefine\acronymfontto select a specific font and to get the capitalization working because of the grouping required to contain the font selection. – mforbes Dec 23 '11 at 23:41