So this question explains why \mathnormal
doesn't actually return numbers in the default font, but doesn't offer any solution for achieving this.
I'm working with KaTeX and have a set of macros for bolding & colouring symbols, but would like to be able to define an \unstyle
macro that exempts part of an expression. For example, if \blue{}
applies \boldsymbol
and {\color{blue}}
to its argument, I'd like to be able to write something like:
\blue{x^3 + 2x \unstyle{+ x} - 12}
such that everything except the "+ x" is in boldsymbol
and colour{blue}
and the "+ x" is in the default ("normal" math).
NB. double invocation of \blue
, like:
\blue{x^3 + 2x} + x \blue{- 12}
does not solve the issue, as it breaks the rendering of +
and -
as operators:
Any suggestions as to how to achieve this? I've played around with every combination of the fonts options available on KaTeX; however, the ones that resolve the issue for numbers change the font for the letters and vice-versa. I'm surprised that there isn't an actual "normalmath" (i.e. defaultmath
) option.
Any advice would be greatly appreciated.
\blue{..}
was defined as\textcolor{blue}{...}
then you could restore the binary operator spacing by adding empty math atoms{}
sox \blue{{}+12}