答案1
编辑后将其变成宏。采纳了 Dai 的建议,添加了\strut
,以解释蹲伏方程。
\documentclass{article}
\usepackage{xcolor,stackengine}
\newcommand\redbox[1]{%
\fboxsep=-2pt
\def\tmp{\displaystyle\strut #1}
\def\shadow{\makebox[.4pt]{$\tmp$}}
\stackengine{0pt}{%
\stackengine{0pt}{%
\textcolor{red}{\fbox{~~$\phantom{\tmp}$~~}}%
}{\color{white}\shadow\shadow\shadow\shadow\shadow\shadow\shadow%
\shadow\shadow\shadow\shadow}{O}{c}{F}{F}{L}%
}{$\tmp$}{O}{c}{F}{F}{L}
}
\begin{document}
\[
\redbox{z(t) = \int D\vec m e^{-\int d^\alpha x
\Phi[...]}}
\]
\[
\redbox{y = \int_0^\tau e^t dt}
\]
\[
\redbox{x = y + z}
\]
\end{document}