I would like to know if there's a command that I can use in the preamble to highlight all elements of a given type in a colour of my choosing. I would particularly like to highlight all math formulae. If this is not possible, I would also be nice a command that colours all the formulae (or elements of a give type).
What I don't want is for each element to be highlighted individually, unless there's an automatic way to do so.
\documentclass{article}
% This option of this fictitious package highlights all formulae in yellow
\usepackage[formula=yellow]{highlighter}
% This unused command would have highlighted all numbers in cyan.
%\usepackage[number=cyan]{highlighter}
\begin{document}
This is a formula that will be highlighted:
$$(x+y)^2 &= x^2 + 2xy + y^2$$
Also the following formula will be highlighted:
\begin{align*}
(x+y)^2 &= x^2 + y^2
\end{align*}
And so will be $x^2 + y^2 = (x+y)^2$, because all formulas will be highlighted.
\end{document}