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 Answer
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
\uppercase{\ae}
is the same as\ae
.\uppercase
isn't a latex command, use\MakeUppercase{\ae}
\scshape
if you want all (large) caps then it would be easiest of you had an all caps font, that usually isn't available.