# Non-standard alignment of multiline equation

In the old days when people used typewriters instead of LaTeX it was fairly easy to achieve the following non-standard multiline split

Now that we have environments like align and alignat it is not as easy. Any ideas? I have written the code for this long expression without proper alignment.

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\nu (v_1,\ldots, v_{t-1},cv_t+dv'_t  , v_{t+1},\ldots,v_m)  \nonumber \\
&  - c \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m)  \nonumber  \\
& \; - d \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m)  \nonumber  \\
&=q \iota (v_1,\ldots, v_{t-1},cv_t+dv'_t  ,v_{t+1},\ldots,v_m)   \nonumber  \\
&- c q \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m)  \nonumber  \\
& - d q \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m)   \nonumber \\
&=q \left( \iota (v_1,\ldots, v_{t-1},cv_t+dv'_t  ,v_{t+1},\ldots,v_m)  \right. \nonumber  \\
&- c \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m)  \nonumber  \\
& \left. - d \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m) \right)
\end{align}
\end{document}

• it doesn't look that hard but harder is typing all that in, can you provide a test file with the long expression, incorrectly aligned Commented Jun 19 at 11:53
• @DavidCarlisle sorry for the omission I have typed in the long equation. Commented Jun 19 at 12:01

Use aligned inside aligned inside equation. With bottom alignment we get the number attached to the last line. I also add some vertical separation between the blocks.

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{aligned}[b] & \begin{aligned}[b] &\nu (v_1,\dots, v_{t-1},cv_t+dv'_t , v_{t+1},\dots,v_m) \\ &\qquad - c \iota (v_1,\dots,v_{t-1},v_t,v_{t+1},\dots,v_m) \\ &\qquad - d \iota (v_1,\dots,v_{t-1},v'_t,v_{t+1},\dots,v_m) \end{aligned} \\[1ex] &\qquad\qquad \begin{aligned}[b] &=q \iota (v_1,\dots, v_{t-1},cv_t+dv'_t ,v_{t+1},\dots,v_m) \\ &\qquad - c q \iota (v_1,\dots,v_{t-1},v_t,v_{t+1},\dots,v_m) \\ &\qquad - d q \iota (v_1,\dots,v_{t-1},v'_t,v_{t+1},\dots,v_m) \\[1ex] &= q \bigl( \iota (v_1,\dots, v_{t-1},cv_t+dv'_t ,v_{t+1},\dots,v_m) \\ &\qquad - c \iota (v_1,\dots,v_{t-1},v_t,v_{t+1},\dots,v_m) \\ &\qquad - d \iota (v_1,\dots,v_{t-1},v'_t,v_{t+1},\dots,v_m) \bigr) \end{aligned} \end{aligned}

\end{document}


Note that \ldots should better be \dots and no \left and \right have been used. Yours would not make the parentheses larger.

• I hope you don't plan retiring! Commented Jun 19 at 13:45
• @TedBlack Actually, with the typewriter it was easier! And yes, I used a typewriter for my graduation thesis. Commented Jun 19 at 13:51

I suggest you nest an aligned environment inside an align* environment.

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
&\nu (\nu_1,\dots, \nu_{t-1},c\nu_t+d\nu'_t  , \nu_{t+1},\dots,\nu_m)  \\
&\qquad - c \iota (\nu_1,\dots,\nu_{t-1},\nu_t,\nu_{t+1},\dots,\nu_m)  \\
&\qquad - d \iota (\nu_1,\dots,\nu_{t-1},\nu'_t,\nu_{t+1},\dots,\nu_m)  \\
&=q \iota (\nu_1,\dots, \nu_{t-1},c\nu_t+d\nu'_t  ,\nu_{t+1},\dots,\nu_m)   \\
&\qquad- c q \iota (\nu_1,\dots,\nu_{t-1},\nu_t,\nu_{t+1},\dots,\nu_m)  \\
&\qquad - d q \iota (\nu_1,\dots,\nu_{t-1},\nu'_t,\nu_{t+1},\dots,\nu_m)   \\
&=q \bigl[ \iota (\nu_1,\dots, \nu_{t-1},c\nu_t+d\nu'_t  ,\nu_{t+1},\dots,\nu_m)   \\
\end{aligned}
\end{align*}

\end{document}

• Thanks. Is there a way of adding a number, as in the typewritten example? Commented Jun 19 at 13:06

Just for fun. Thinking a bit as with the typewriter, we can just add the amount of \qquad needed here.

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
&\nu (v_1,\ldots, v_{t-1},cv_t+dv'_t  , v_{t+1},\ldots,v_m) \nonumber \\
&\qquad - c \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m) \nonumber \\
&\qquad - d \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m) \nonumber \\
\end{align}
\end{document}


Just for the fun of it, here is a similar solution for ConTeXt:

\starttext

\samplefile{knuthmath}

\startformula
[textdistance=2em]
\alignhere
\nu (v_1,\ldots, v_{t-1},cv_t+dv'_t  , v_{t+1},\ldots,v_m) \breakhere
- c \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m) \breakhere
- d \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m) \breakhere
\skiphere[1]
= q \iota (v_1,\ldots, v_{t-1},cv_t+dv'_t  ,v_{t+1},\ldots,v_m) \breakhere
\skiphere[2]
- c q \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m) \breakhere
\skiphere[2]
- d q \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m) \breakhere
\skiphere[1]
= q \left( \iota (v_1,\ldots, v_{t-1},cv_t+dv'_t  ,v_{t+1},\ldots,v_m) \breakhere
\skiphere[2]
- c \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m) \breakhere
\skiphere[2]
- d \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m) \right) \numberhere[eq:foo]
\stopformula

We refer to \in{Equation}[eq:foo]. \samplefile{knuthmath}

\stoptext