Simple task here: I want to use the \MakeUppercase{} command, but I have some text that must be protected to remain lower case. Specifically, elemental symbols (e.g. PbI\textsubscript{2}, where the 'b' needs to remain lower case. Is there some way of protecting lower case letters from \MakeUppercase{}?
Asked
Active
Viewed 1,018 times
3
1 Answers
3
Define a macro for it. I suggest considering chemformula for chemistry documents.
\documentclass{article}
\usepackage{chemformula} % also loads xparse
\NewDocumentCommand{\LI}{}{\ch{PbI2}}
\begin{document}
Here is lead iodide \LI{} and
\MakeUppercase{also \LI{} here}
Here's a reaction: \ch{Pb + I2 -> PbI2}
\end{document}
Note that \newcommand would not work, but \NewDocumentCommand makes the macro safe against \MakeUppercase.
egreg
- 1,121,712
-
1@jkmey If you use
\ch{PbI2}in text that ends up inside\MakeUppercase, thebwould be uppercased as well. By hiding it in a “protected” macro,\MakeUppercasewill do nothing to it. – egreg Sep 22 '17 at 21:40

bas\lowercase{b}. – Sep 22 '17 at 21:29\MakeTextUppercasewith thetextcasepackage then you can use\NoCaseChange{...}to protect the case. (I think there's a package option to redefine\MakeUppercaseas\MakeTextUppercase.) – Nicola Talbot Sep 23 '17 at 10:59