[Tex/LaTex] How to Write a Dot in Subscript

formattingsubscripts

I'm trying to write a dot over a subscript – like

    f_{\dot{x}}

My problem is that this comes out looking all wrong. The dot is inside the x, it's just messy. Does anyone know of a way to do this?

P.S I'm doing this because I want to write the euler-lagrange equations in the more compact form

    f_{x}=\dot{f_{\dot{x}}}

so I need a method that will accompany another dot on top of the one in the subscript. Any help would be appreciated.

Edit: Mico answered this below to all who have the same issue! Thanks Mico!

Best Answer

If you change from \dot{f_{\dot{x}}} to \dot{f}_{\dot{x}}, both dots will be placed correctly.

enter image description here

\documentclass{article}
\begin{document}
$f_{x}=\dot{f}_{\dot{x}}$
\end{document}

Addendum: A second MWE, which shows the OP's formula, the improvement suggested above, and a possible further improvement on.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{ccc}
bad & good & best(?) \\[1ex]
$\dot{f_{\dot{x}}}$ & $\dot{f}_{\dot{x}}$ & $\dot{f}^{}_{\!\dot{x}}$ 
\end{tabular}
\end{document}
Related Question