9

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}

2 Answers 2

11

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.

7
  • Thank you also for the other useful suggestions, it really looks better with the right aligned x_m Sep 6, 2014 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? Nov 20, 2015 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, 2015 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. Nov 20, 2015 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, 2015 at 22:16
3

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}

enter image description here

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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .