# Underline math symbols and letters on same height

i'm looking for another option than \underline for underline math symbols as well as regular letters on same height.

What I want is to change the underline of the first two symbols to the red underlines in this image, e.g. to match the height of the underline in the last two symbols.

\usepackage{contour}
\usepackage{ulem}

\renewcommand{\ULdepth}{1.0pt}
\contourlength{0.8pt}

\newcommand{\myuline}[1]{%
\uline{\phantom{#1}}%
\llap{\contour{white}{#1}}%
}


but without any success.

Any ideas?

The result won't be pretty.

\documentclass{article}
\usepackage{amsmath}
\usepackage{accents}

\newcommand{\under}[1]{%
\vphantom{#1}%
\underaccent{\bar}{\smash[b]{#1}}%
}

\begin{document}

$\under{y},\under{\mu}_a,\under{\sigma},\under{a}$

\end{document}


• thanks so far! is there a way to add some small space between the underline and the letter at the positions where both overlap to make it look better? Aug 2 at 21:55
• @Micha Sorry, but as I said, the result isn't pretty and nothing would improve it. Aug 3 at 10:37