For my lectures, I like to colour the symbols in the equations to make it easier to follow what's going on - a bit like syntax highlighting. So all vector spaces are one colour, all sets another, e is in roman font, and so forth. At the moment, I do this by defining new macros for each symbol, so a typical line reads something like this:
Define \(\tyz^\tyw \coloneqq \tye^{\tyw \ty\ln(\tyz)}\)
I'd really like to be able to just type
Define \(z^w \coloneqq e^{w \ln(z)}\)
To do this, I'd need to be able to tell TeX that the maths symbol for, say, 'e' was not 'e' but actually 'e' in roman font and with a particular colour.
Does anyone have any ideas on how to do this?