# Writing stacked hats on a character with subscripts

As part of writing up notes I need to write something containing subscript and two "hats", however having a look online i can find only people doing it by manually positioning them which is a little beyond me given I've been using latex for 4 days.

What I am trying to write is something I thought would be achieved with:

$$\dot{\tilde c_{21}}$$


However when outputting this becomes garbled. Any thoughts?

• welcome to tex.sx. although your question is reasonably clear, it would be much easier for us to help if you provide a small compilable example that shows what you have done. potential helpers can cut and paste that example and use it to experiment. – barbara beeton Feb 25 '17 at 19:51
• I tried to with $$\dot{\tilde c_{21}}$$ but i'll write something a bit clearer – Tom Heal Feb 25 '17 at 19:53
• please start your example with \documentclass and end with \end{document}. (that's what i meant by "compilable".) – barbara beeton Feb 25 '17 at 19:55

Instead of \dot{\tilde c_{21}}, you should write

\dot{\tilde{c}}_{21}


That way, you inform TeX that the dot and tilde diacritics are supposed to be applied to c, and not to c_{21}.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\dot{\tilde{c}}_{21} \quad \dot{\tilde c_{21}}$
\end{document}

• Sweet, thank you. I wouldn't have thought it would be a problem to apply it to the whole thing but i guess that's just beginner ignorance aha – Tom Heal Feb 25 '17 at 20:00
\documentclass{article}
$\dot{\tilde{{c_{21}}}} + \dot{\tilde{c}}_{21}$