1、引用如下包:
\usepackage{xcolor}
\usepackage{soul}
\newcommand{\mathcolorbox}[2]{\colorbox{#1}{$\displaystyle #2$}}
2、行内行间公式高亮问题:
2.1、行内公式:
\hl{colored $equation$ }
2.2、行间公式:
\begin{equation}
\mathcolorbox{yellow}{y=\frac{x^2}{2}}+c
\end{equation}
3、多行高亮问题
\hl {highlight content}