# Smashoperator for the vertical space?

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}


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.

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

• Thank you also for the other useful suggestions, it really looks better with the right aligned x_m – user2653422 Sep 6 '14 at 12:24
• I've noticed that you use an additional \, after the braces of the smash command. For smash it seems to be necessary to add it. Is it also necessary in the case of the smashoperator command? It seems to be to much space when adding the \, then? – user2653422 Nov 20 '15 at 22:04
• @user2653422 \smash produces an ordinary atom, whereas \mathop an Op atom. The latter adds automatically \, when it's followed by an ordinary atom (x_m in this case). If you use the \mathop way, then \, should be omitted. – egreg Nov 20 '15 at 22:08
• So \smashoperator uses \mathop internally? The question about \smashoperator is not directly related to my question of the initial post and the result I wanted to achieve there, but about the spacing. – user2653422 Nov 20 '15 at 22:13
• @user2653422 Sorry, but I see no \smashoperator in my answer. Are you referring to mathtools? It has a \smashoperator, but it does a completely different thing. – egreg Nov 20 '15 at 22:16

One way is to add some negative vertical space.

\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  \\[-4\jot]    %%% <--- here
&                                                                   &&              &               &   \phantom{,{}}   c \neq d                                                                \\
&                                                       x_m     && = 1      &               &   , \forall m \in M \colon e \neq f ;                     \notag  \\
&                                                                   &&              &               &   \phantom{,{}}   g \neq h
\end{alignat}
\end{document}


Another way is to smash.

\documentclass{scrbook}
\usepackage{amsmath}

\begin{document}
\begin{alignat}{3}
&   \smash{\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}