Is there a way to force the text of an entire document to be typeset in all upper case with the exception of any math?
1 Answers
In principle you can use the OpenType case feature or its fontspec interface Letters=Uppercase
I can demonstrate with Caps and small Caps
Which comes from
\documentclass{article}
\usepackage{fontspec}
%\setmainfont{TeX Gyre Pagella}[Letters=Uppercase]
\setmainfont{TeX Gyre Pagella}[Letters=SmallCaps]
\begin{document}
One two three $1=0$ and $\theta=x$
\end{document}
However if you switch the commented \setmainfont then you just get lots of warnings looking like
*************************************************
* fontspec warning: "icu-feature-not-exist-in-font"
*
* OpenType feature 'Letters=Uppercase' (+case) not available for font 'TeX
* Gyre Pagella' with script 'Latin' and language 'Default'.
*************************************************
and the output is just as input with no transformation.
So, if your actual font has the case opentype feature set that's all you need.
If not, then you could view it as a transliteration and use teckit in xetex or a lua callback in luatex, there were recent answers describing this for cyrillic but the system could work for case change as well (don't use my input_buffer callback suggestion for luatex, as you will mess up all the latex commands using lowercase ascii:-)
for xetex
Using XeTeX for automatic transliteration of cyrillic letters
or for luatex
Create a mapping for transliteration from cyrillic to latin in LuaLaTeX
- 757,742

\uppercase{\ae}is the same as\ae. – Alenanno Jan 10 '16 at 15:03\uppercaseisn't a latex command, use\MakeUppercase{\ae}– David Carlisle Jan 10 '16 at 15:15\scshapeif you want all (large) caps then it would be easiest of you had an all caps font, that usually isn't available. – David Carlisle Jan 10 '16 at 15:18\scshape-- I readSmall capsinstead ofAll caps;-) – Jan 10 '16 at 15:22\def\abc{abc}\uppercase{\abc}but again MakeUppercase would work as it expands before uppercasing – David Carlisle Jan 10 '16 at 15:26\MakeTextUppercasefrom mytextcasepackage, which doesn't use any unicode features (would work with pdftex as well) which automatically avoids uppercasing math. – David Carlisle Jan 10 '16 at 19:55