I need to set subscripts and superscripts automatically in mathematical equations in roman font style for a book publication. I do not want to apply \mathrm{...}
to each subscript or superscript separately.
Fortunately I found a solution to globally set subscripts in roman font style in Redefine underscore to produce roman subscript. I made a slight adaptation in order to have all indexes in sequence in roman font style:
\catcode`_=\active
\newcommand_[1]{\ensuremath{\sb{\mathrm{#1}}}}
Original typeset $x_{abc}^{de}$
:
Roman subscripts with code above $x_{abc}^{de}$
:
I can, however, not figure out how to apply this code to superscripts. Does anyone have a solution so set both the subscript and superscript font style to roman?
_
by^
and\sb
by\sp
? – David Carlisle Jul 19 '17 at 7:47$x \mathrm{e}^{\mathrm{x}}$
the twox
s are different entities, while in$x \mathrm{e}^x$
they're not. – Chris H Jul 19 '17 at 8:53