I have a problem with the subscript under the sum,
\sum_{i \in X} \sum_{i \in \bar{X}}
for example gives the subscript at different heights for each sum. Does anyone know how to fix this?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI have a problem with the subscript under the sum,
\sum_{i \in X} \sum_{i \in \bar{X}}
for example gives the subscript at different heights for each sum. Does anyone know how to fix this?
This can be solved using the mathtools
package and its command \adjustlimits
:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
\adjustlimits\sum_{i \in X}\sum_{i \in \bar{X}}
\]
\end{document}
Vertical adjustments are also possible via \vphantom
:
\documentclass{article}
\begin{document}
\[
\sum_{i \in X}\sum_{i \in \bar{X}} \quad \mbox{compared to} \quad
\sum_{i \in X\vphantom{\bar{X}}}\sum_{i \in \bar{X}}
\]
\end{document}\end{document}