I have a macro to print (Center of Mass) \CM in text roman wherever the place in the book it is expanded. But when in subscript I want it much smaller than normal subscript size defaults to print it, so I have this:
\newcommand\CM{\ifmmode\textrm{\fontsize{3.5}{5}\selectfont CM}\else{{\textrm{CM}}}\fi}
but I wanted no \ifmathmode but I would like: \ifsubsupmode or any thing guessing the way the argument is going to be printed is in smaller size (super/sub script)
But I haven't found anything similar




\mathchoiceand use this in the definition of\CM. – yannisl Mar 19 '24 at 12:13Why not start by showing how \ifmathmode and \ifsubsupmode should be directly comparable?
When you read the manual, how did it let you down? Where did it go wrong?
– Robbie Goodwin Mar 23 '24 at 00:13