I want to make a book where one letter has a different rendering from how it usually looks.
I tried
\newcommand{\oldvs}{z}
\catcode`\z=\active
\defz{\stackengine{0pt}{\oldvs}{\~}{O}{c}{F}{T}{L}}
\newcommand{\oldVS}{Z}
\catcode`\Z=\active
\defZ{\stackengine{0pt}{\oldVS}{\~}{O}{c}{F}{T}{L}}
However, this also banned it in commands, and, although I've placed it right before \begin{document}
, it affects loading of some .sty files. I don't know why they are loaded after that part; I use an existing template (fancyBook) and don't think switching to a different one would help.
Is there a way to achieve this goal without having to manually put something else each time?
UPD (not about the main point): The code above doesn't produce what I want; a better way is \stackengine{0pt}{z}{$\sim$}{O}{c}{F}{T}{L}}
and \stackengine{0pt}{Z}{$\sim$}{O}{c}{F}{T}{L}
, respectively.
UPD2: An even better way is \stackengine{0pt}{z}{\textasciitilde}{O}{c}{F}{T}{L}
and \stackengine{0pt}{Z}{\raisebox{0.3ex}{\textasciitilde}}{O}{c}{F}{T}{L}
, respectively. Also, I currently have a version where this is implemented in a way that requires me to add some additional characters into the source code; my question is if there is a way to do so without that