答案1
tcolorbox
,在数学环境中使用:
\documentclass[dvipsnames]{article}
\usepackage[most]{tcolorbox}
\colorlet{LightLavender}{Lavender!40!}
\tcbset{on line,
boxsep=4pt, left=0pt,right=0pt,top=0pt,bottom=0pt,
colframe=white,colback=LightLavender,
highlight math style={enhanced}
}
\begin{document}
\tcbox{Hello} world! $\tcbhighmath{c^2} = a^2 + b^2$
\end{document}