[Tex/LaTex] Annotation on mathematical symbol


Is it possible to annotate the equal-symbol like in the picture below?

enter image description here

E[|A\cup B|]=E[|A|+|B|-|A\cap B|]=E[|A|]+E[|B|]-E[|A\cap B|]

Best Answer

You could use the \overset macro, which is provided by the amsmath package:

enter image description here

\usepackage{amsmath} % for \overset and \text macros

E[|A\cup B|]=E[|A|+|B|-|A\cap B|] 
E[|A|]+E[|B|]-E[|A\cap B|]


Addendum: If you also need the vertical arrow below "linearity", just replace



\overset{\substack{\text{linearity} \\ \downarrow}}{=}

The \substack macro is also provided by the amsmath package.

Related Question