I'm wondering if it's possible to do something like this in LaTeX:
For all numbers (0, 1, …, 9) in math mode, color it red. For alphabets (a, b, …, z, A, B, …, Z) in math mode, color it green. For everything else in math mode, color it blue.
I want to make my document more colorful, but doing manual coloring takes too much time!
Best Answer
With no warranty of any kind!
Let me add, with regards to
\everymath
and\everydisplay
that it would have been better to do:This preserves, rather than erases, the previously stored data in these token lists. (I just checked and Lamport's book does not have a single mention of
token list
, and even the wordtoken
is not to be found (it seems) in the entire book...). Admittedly, packages who put things in them should do thatAt Begin Document
so even the brutal way used in my initial code, as long as it is in the preamble, is maybe not that destructive. People interested in token lists can learn about it in, for example,TeX by Topic
by Victor Eijkhout (texdoc topic
).