I want to include something in my LaTeX article that will make all mathematical formulae appear in black, while all text (including everything inside \text{}
s in the middle of mathematical formulae) appear in red. Ideally I would like this to be something I could include in the preamble or in a .cls
file or something like that. What would be the quickest way to do that?
[Tex/LaTex] How to get different colors for math and for text
colormath-mode
Best Answer
A quick way is using
\everymath
,\everydisplay
and theeverysel
package:However, with more complicated
amsmath
environments such asalign
there could could be problems with\everydisplay
, see: Modifying \everydisplay causes the align environment to stop working. If you would like to go this way, perhaps omit\everydisplay
asalign
uses inline math internally, and redefine basic displayed math otherwise for using the desired color.