Is there a LaTeX command for the equal (=) sign? I'd like to overwrite the command so that all equal signs in my document are colored green. But it seems I cannot do it with just the symbol =, which is not a command.

1 Answer 1


Ten years later, a better implementation.


% preserve the original equals
% and make = math active

% define math active = to be green \standardequals
\cs_new_protected:Nn \mika_greenequals: { \mathcolor{green!70!red}{\standardequals} }
\char_set_active_eq:NN = \mika_greenequals:


$a\standardequals b$



The top line is to show that spacing is right.

enter image description here

original answer

Every character can be turned into a command in math mode, but some special tricks are needed.




\AtBeginDocument{\mathcode`=\string"8000 }


enter image description here

  • 4
    Since the code is not too long, could you please explain how it works too, egreg? Thanks!
    – Mika H.
    Commented Mar 9, 2013 at 19:13
  • I'm asking also because I'd like to do other characters, like > < ) ( etc.
    – Mika H.
    Commented Mar 9, 2013 at 19:33
  • 1
    @MikaH. It works similar to the accepted answer of LaTeX color setting for math mode. Commented Mar 9, 2013 at 19:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .