[Tex/LaTex] Mixed superscript, subscript and widehat

accentssubscriptssuperscripts

What is the correct way to write this equation and make both L_s matrices look the same? I tried this but the widehat and superscript L_s matrix' subscript is positioned slightly lower than the no-widehat no-superscript L_s.

\dot{\mathcal{L}} = - \lambda \mathbf{e}^\mathrm{T} \mathbf{L}_\mathbf{s} \widehat{\mathbf{L}_s^{+}} \mathbf{e}

UPDATE:

This is the code output for me. Note that the first subscript s is higher than the second.

Code output

This is more noticeable when regular font size is used:

Regular font size

This minimal example seem to produce correct output.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
\cramped{\mathbf{L}_\mathbf{s}}
\widehat{\mathbf{L}_\mathbf{s}^{+}}
\]
\end{document}

But when used inside my document (thesis) it produces the output described above. I have no idea what causes this, but it's probably some other obscure configuration of the cls file I'm using (from the thesis reference model).

Best Answer

The slight difference is in the fact that TeX uses "cramped display style" when typesetting the argument to \widehat, which is characterized by reduced lowering of subscripts and raising of superscripts.

This is one of the cases where TeX needs help; here's a way:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
\cramped{\mathbf{L}_\mathbf{s}}
\widehat{\mathbf{L}_\mathbf{s}^{+}}
\]
\end{document}

enter image description here

Alternatively, don't let the wide hat cover also the superscript and subscript:

\documentclass{article}
\begin{document}
\[
\mathbf{L}^{}_\mathbf{s}
\widehat{\mathbf{L}}_\mathbf{s}^{+}
\]
\end{document}

Notice the empty superscript.

enter image description here