# Subscript after \underline in math mode

I would like to put a subscript after a character with multiple underlines in the math mode but ignoring the underlines. How can I do it?

Consider this picture: I would like the subscript to have the vertical position of the element with respect to the character. Here is the code the produced the picture:

\documentclass[border=5mm]{standalone}
\usepackage{ulem,amsmath,bm}
\begin{document}
$$C_{\text{c}}, \underline{\bm{C}}_{\text{c}}, \underline{\underline{\bm{C}}}_{\text{c}}, \uuline{\bm{C}}_{\text{c}}$$
\end{document}


Edit: Would be superb if the underline was limited to the width of the character.

• What about the horizontal position? For the vertical position the easiest thing here is to use an empty group, e.g. \underline{\bm{C}}{}_{\text{c}}. Jul 28 '17 at 15:00
• Thank you, @campa! I am so stupid :). I updated the post about to reflect on my preference about horizontal position. Jul 28 '17 at 15:04
• \smash{\underline{\underline{\bm{C}}}}_{\text{c}} as a partially satisfying way
– user4686
Jul 28 '17 at 16:15
• Thanks, @jfbu, but I fail to see how it is different from the empty group solution, proposed above. Jul 28 '17 at 16:24
• @campa, if adjusting the length of the underline is too much work, could you please submit your comment as an answer? Jul 28 '17 at 16:31

\newcommand{\ubar}[1]{\mkern 1.5mu\underline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}