I use the ulem
package to control the depth of underlines by setting
\renewcommand{\ULdepth}{1pt}
This works fine outside math mode. However, when using \uline
inside math mode, I seem to lose control over the underline depth. (Adding \smash
doesn't really solve the problem either.)
\documentclass{article}
\usepackage[normalem]{ulem}
\setlength{\parskip}{15pt} % add space between paragraphs for illustration
\begin{document}
\renewcommand{\ULdepth}{1pt}
\uline{normal text} $\uline{f(x)=y}$
\uline{normal text} $\uline{\smash{f(x)=y}}$
\renewcommand{\ULdepth}{10pt}
\uline{normal text} $\uline{f(x)=y}$
\end{document}
Is there a way to "regain control" over underline depth within math mode. If such control is not possible with the ulem
package (I also tried with soul
, which didn't work), are there other packages that can achieve the purpose of making the depth of underlines uniform both inside and outside math mode?
\uline{normal text} \uline{$f(x)=y$}
and it seems to obey the parameter\uline{$<math content>$}
works. But I'm underlining texts in thegame
environment provided by Martin Osborne'ssgame
package, in which the cells in a matrix is automatically set in math mode. So when I do use\uline
in that environment, it would be as if I'm using$\uline{...}$
.$\mbox{\uline{$....$}}$
\xblackout{abc} $\mblackout[1pt]{y = x^2}$
seems to align the math underline and text underline, regardless of descenders in the math mode.