I'd like to align the subscript of E_m
with the subscript of E_m^\dagger
. Unfortunately, I can't find a solution that both aligns the subscripts and that does not break the alignement of the \sqrt
command:
MWE:
\documentclass[]{memoir}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\begin{document}
Without vphantom: $E^\dagger_m E_m$, $\sqrt{E_m}$
With vphantom: $E^\dagger_m E^{\vphantom{\dagger}}_m$, $\sqrt{E^{\vphantom{\dagger}}_m}$.
With mathstrut: $E^\dagger_m E^{\mathstrut}_m$, $\sqrt{E^{\mathstrut}_m}$.
\end{document}
-- EDIT --
I'm having another problem now: when the dagger is used inside a Trace operation, the index is lifted:
Why is it the case? Can I adapt the E_m^{}
code to also adapt depending on weather it is inside a trace or not? And I actually like this typesetting with the dagger a bit above, maybe more than the "normal" formatting because it should be automatically aligned with E_m
. Can I force LaTeX to always format it that way?
MWE:
\documentclass[]{article}
\usepackage{amssymb, amsthm, amsmath}
\DeclareMathOperator{\Tr}{Tr}
\newcommand*{\vect}[1]{\ensuremath{\mathbf{#1}}}
\begin{document}
\begin{align}
\rho_m = \frac{\vect{M}_m^{}\rho \vect{M}_m^\dagger}{\Tr(\vect{M}_m^\dagger \vect{M}_m^{} \rho)}
\end{align}
\end{document}