4

I would like to number a multi-line multi-column equation group with one number. If I use

\documentclass{scrartcl}  
\usepackage{amsmath}
\begin{document}

\begin{align}
    x&=1 & x&=2\\
    y&=3 & y&=4
\end{align}
\end{document}

I get an equation number per row. When using the split environment

\documentclass{scrartcl}  
\usepackage{amsmath}
\begin{document}

\begin{align}
    \begin{split}
        x&=1 & x&=2\\
        y&=3 & y&=4
    \end{split}
\end{align}
\end{document}

the groups are omitted and I have one number for four rows.

How can I number the first example with one number?

Edit:

I used the equation and aligned environments proposed by @daleif and got the following results in equation (3). Equation (1) and (2) are typeset by an align environment:

<code>align</code> vs. <code>aligned</code>

The align environment uses the whole width of the document. Is this possible with aligned, too?

Dirk
  • 2,728
  • 3
    Use aligned inside equation. – Sigur Jan 13 '15 at 13:34
  • 2
    Follow @Sigur's advice, and please never use split inside align!!!!!!!!!!!!! – karlkoeller Jan 13 '15 at 13:46
  • What's wrong with split inside align? Though I tend to go for equation plus aligned – daleif Jan 13 '15 at 13:49
  • If it works.... However I'd not even use split in any case, see the example in my answer. – daleif Jan 13 '15 at 13:55
  • @daleif While align is meant to be a standalone environment, split and aligned are meant to be used inside equation – karlkoeller Jan 13 '15 at 13:56
  • @karlkoeller aligned are perfectly suited to go inside align, I use it quite often within align*, when soemthing is broken across lines within pairs of braces. – daleif Jan 13 '15 at 13:58
  • @daleif I was probably wrong, because the last example in your answer shows that it can be needed. :-) – karlkoeller Jan 14 '15 at 10:23
  • @karlkoeller, no problem. Looking at the sources, it seems intentional. The code does check to see if it is inside align or not. – daleif Jan 14 '15 at 10:25
  • 1
    @All I marked to reopen this question, because my problem is to number a multi-line multi-column equation with one number. The recommend thread handles a multi equation with only one column. – Dirk Jan 21 '15 at 08:46

1 Answers1

7

I'd actually go for equation plus aligned as that combination still have equations space saving feature, whereas equation plus split does not.

\documentclass[a4paper]{memoir}
\usepackage{amsmath}
\begin{document}

\noindent sd\rlap{\rule{\linewidth}{1pt}}
\begin{equation}
  \begin{split}
    a\\ b
  \end{split}
\end{equation}


\noindent sd\rlap{\rule{\linewidth}{1pt}}
\begin{equation}
  \begin{aligned}
    a\\ b
  \end{aligned}
\end{equation}


\end{document}

See the spacing below the special line

enter image description here

On a side note, aligned also has its uses inside align* (does not work well with numbered lines then using the [t] or [b] optional arg)

\begin{align*}
  f(x) = {} &  \sum \dots \\
  & + \sum_i
  \!
  \begin{aligned}[t]
    \Bigl[ &a_i +b_i+\cdots
    \\ & + x_i+y_i\Bigr]
  \end{aligned}
\end{align*}

enter image description here

daleif
  • 54,450
  • Thanks for your answer. Please add two columns to this example and you will see, that the split environment omits these columns. In addition, the aligned environment does not use the whole width like the align environment does. Is this possible? (I make a note in my initial post.) – Dirk Jan 13 '15 at 14:27
  • @Dirk split only supports one alignment column (ie one &) per row. If you need more, use aligned. What do you mean by using the whole width? – daleif Jan 13 '15 at 14:29
  • I add an example to my initial post. Does this clarify my question? – Dirk Jan 13 '15 at 14:35
  • 1
    @Dirk, it that case you can use alignedat instead, and then manually set the space between cols. aligned use a minimalist approach. Looking at the sources, one might also be able to use, say, \renewcommand{\minalignsep}{5em} however I do not know what other effect messing with this might have. The default value is 10pt. – daleif Jan 13 '15 at 14:42
  • Remember that align does a lot of measuring and readjustments, aligned does not, it is a much simpler construction. – daleif Jan 13 '15 at 14:45