答案1
\documentclass{scrartcl}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{xcolor}
\newcommand*\drawbaseline[2][orange]
{\begingroup\sbox0{$\displaystyle#2$}\mathrlap{\color{#1}\rule{\wd0}{.1pt}}\endgroup#2}
\begin{document}
\begin{align*}
\drawbaseline{\psi_{\mathrm{tot}}(x,-t_0,r) = \frac{1}{(2\pi)^2} \iint
\tilde\Psi_{\mathrm{tot}}\Bigl(k_x,\frac{c}{2}\sqrt{k_x^2 + k_r^2},r=0\Bigr)}
\end{align*}
\end{document}
答案2
一个肮脏的伎俩,利用align
(一般不应用于单行显示)
\documentclass{article}
\usepackage{amsmath,xcolor}
\pagestyle{empty}
\makeatletter
\newcommand{\showbaseline}{%
\ifmeasuring@
\else
\makebox[0pt][l]{%
\color{red}%
\vrule height.05pt depth 0.05pt
width \ifcase\expandafter1\maxcolumn@widths\fi
}%
\fi
}
\makeatother
\begin{document}
\begin{align*}
\showbaseline
\psi_{\mathrm{tot}}(x,-t_0,r) =
\frac{1}{(2\pi)^2} \iint
\tilde\Psi_{\mathrm{tot}}\left(k_x,\frac{c}{2}\sqrt{k_x^2 + k_r^2},r=0\right)
\end{align*}
\end{document}
这个技巧在https://tex.stackexchange.com/a/209732/4427
我还修复了代码中的一些错误。