# How to add a line break in math mode but number the whole as one formula?

I am trying to get the following formula on two lines like this:

$$W \in \mathbf{M}_N \rightarrow W' \in \mathbf{M}_{N+1}\\ (w_{ij})_{1\leq i,j\leq N} \mapsto (w_{ij})_{1\leq i,j\leq N+1} \text{with} \left\{ \begin{array}{l} w_{ij} = w_{ij} \quad \text{for} \; 1\leq i,j\leq N \\ w_{i,N+1} = w_{i,k}\\ w_{N+1,i} = w_{k,i} \end{array} \right.$$


I've read about align and align* environments, however I want something in between.

What I want is this thing to be numbered (and to be able to reference it) but only once, as one formula, and what the align environment does is number both lines seperatly (or not at all in align*)

What can I do to make this happen?

-
Does this help? – Sean Allred Apr 21 '14 at 14:04

While this is similar to @Bernard's, it seems to me the list of cases belong with the second line alone. The following numbers only the second line:

\documentclass[a4paper, 11pt]{book}
\usepackage{amsmath}
\begin{document}
\begin{align}
W \in \mathbf{M}_N & \rightarrow W' \in \mathbf{M}_{N+1}
\notag\\[-8pt]
(w_{ij})_{1\leq i,j\leq N} & \mapsto (w_{ij})_{1\leq i,j\leq N+1}
\text{ with }
\begin{cases}
w_{ij} = w_{ij} &\text{for } 1\leq i,j\leq N \\
w_{i,N+1} = w_{i,k}\\
w_{N+1,i} = w_{k,i}
\end{cases}
\end{align}
\end{document}


I've also adjusted some of the horizontal spacing of text (\text{ with }) and the vertical spacing between the lines. I've also left out the text{for} as it is implied anyway (and this leaves room for the equation number). But the key point is that align allows one to turn off numbering of select lines with \notag.

Another approach is to use aligned inside equation:

\documentclass[a4paper, 11pt]{book}
\usepackage{amsmath}
\begin{document}

\begin{aligned} W \in \mathbf{M}_N & \rightarrow W' \in \mathbf{M}_{N+1}\\[-8pt] (w_{ij})_{1\leq i,j\leq N} & \mapsto (w_{ij})_{1\leq i,j\leq N+1} \text{ with } \begin{cases} w_{ij} = w_{ij} & 1\leq i,j\leq N \\ w_{i,N+1} = w_{i,k}\\ w_{N+1,i} = w_{k,i} \end{cases} \end{aligned}
\end{document}


The lines of aligned are not numbered, but the equation as a whole is.

-

You could use the cases environment. See section 3.7 of the amsmath package documentation. Here I have split your equation in two so that it does not spill over the right margin.

\documentclass[10pt]{article}
\usepackage{amsmath}
\begin{document}
$$W \in \mathbf{M}_N \rightarrow W' \in \mathbf{M}_{N+1} (w_{ij})_{1\leq i,j\leq N} \mapsto (w_{ij})_{1\leq i,j\leq N+1}$$
with
$$\begin{cases} w_{ij} = w_{ij} & \text{for } \; 1\leq i,j\leq N \\ w_{i,N+1} = w_{i,k} &\\ w_{N+1,i} = w_{k,i} & \end{cases}$$


-
I guess that the OP wants only one number. – Sigur Apr 21 '14 at 14:10
@Sigur Using equation* in one of the two places will handle that. – Ethan Bolker Apr 21 '14 at 14:17
Right. I was thinking about only one number vertical aligned. No problem. – Sigur Apr 21 '14 at 14:18

I realize that you specified you want to place the entire expression on two lines. However, I think the following form, which extends over five lines and uses a split environment inside an equation environment, may have some merit:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\begin{split} W \in \mathbf{M}_N &\rightarrow W' \in \mathbf{M}_{N+1}\\ (w_{ij})_{1\leq i,j\leq N} &\mapsto (w_{ij})_{1\leq i,j\leq N+1}\\[1ex] \text{with}\qquad w_{i,j} &= w_{i,j} \text{ for 1\leq i,j\leq N} \\ w_{i,N+1} &= w_{i,k}\\ w_{N+1,i} &= w_{k,i} \end{split}$$
\end{document}

-

Another solution, using alignat, aligned and cases:

\documentclass[a4paper, 11pt]{book}

\usepackage{amsmath}

\begin{document}

\begin{alignat}{2}
& \begin{aligned}
W \in \mathbf{M}_N & \longrightarrow W' \in \mathbf{M}_{N+1}\\[4pt]
(w_{ij})_{1\leq i,j\leq N} & \longmapsto (w_{ij})_{1\leq i,j\leq N+1}
\end{aligned}
& \enspace \text{with}&
\ \begin{cases}
w_{ij} = w_{ij} \enspace \text{for} \; 1\leq i,j\leq N \\
w_{i,N+1} = w_{i,k}\\
w_{N+1,i} = w_{k,i}
\end{cases}
\end{alignat}

\end{document}


-