[Tex/LaTex] Smashoperator for the vertical space

amsmathmath-modemath-operatorsmathtools

I would like to vertically smash a summation sign in a way that the line has a vertical space as if the summation sign wouldn't be there.

To illustrate it please see the MWE. The space between the first and second line should be the same as the space between the third and fourth line. At the moment it looks like the second line doesn't belong to the first one.

Note: I cannot write the last column into one line, because the second column will contain more text in the end and I have to break the last column into two or multiple lines.

MWE:

\documentclass{scrbook}
\usepackage{amsmath}

\begin{document}
\begin{alignat}{3}
        &   \sum_{m \in M}  x_m     && = 1      & \quad &   , \forall m \in M \colon a \neq b ;                     \notag  \\
        &                                                                   &&              &               &   \phantom{,{}}   c \neq d                                                                \\
        &                                                       x_m     && = 1      &               &   , \forall m \in M \colon e \neq f ;                     \notag  \\
        &                                                                   &&              &               &   \phantom{,{}}   g \neq h            
\end{alignat}
\end{document}

Best Answer

You can use \smash[b]:

\documentclass{scrbook}
\usepackage{amsmath}

\begin{document}
\begin{alignat}{2}
\smash[b]{\sum_{m \in M}}\, x_m &= 1\quad && , \forall m \in M \colon a \neq b ; \notag \\
                                &         && \phantom{,{}}   c \neq d \\
               x_m              &= 1      && , \forall m \in M \colon e \neq f ; \notag  \\
                                &         && \phantom{,{}}   g \neq h
\end{alignat}
\end{document}

Instead of \, you could use

\mathop{\smash[b]{\sum_{m \in M}}}

but it's more complicated with no real advantage other than inserting the thin space automatically.

I'd not left align x_m, but if you really want, you know how to do it.

Instead of the phantoms you could add another set of columns.

enter image description here

Note that using \smash alone would also remove the height, which is not desired here.

Related Question