4

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

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}
2
  • 2
    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.
    – Ted Black
    Commented Jun 19 at 12:01

3 Answers 3

4

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{equation}
  \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{equation}

\end{document}

enter image description here

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

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

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

enter image description here

\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)  \\
&\qquad\qquad\begin{aligned}[t]
&=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)   \\
&\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) \bigr]
\end{aligned} 
\end{align*}

\end{document}
1
  • Thanks. Is there a way of adding a number, as in the typewritten example?
    – Ted Black
    Commented Jun 19 at 13:06
3

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 \\
  &\qquad\qquad = q \iota (v_1,\ldots, v_{t-1},cv_t+dv'_t  ,v_{t+1},\ldots,v_m) \nonumber \\
  &\qquad\qquad\qquad - c q \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m) \nonumber \\
  &\qquad\qquad\qquad - d q \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m) \nonumber \\
  &\qquad\qquad = q \bigl( \iota (v_1,\ldots, v_{t-1},cv_t+dv'_t  ,v_{t+1},\ldots,v_m) \nonumber \\
  &\qquad\qquad\qquad - c \iota (v_1,\ldots,v_{t-1},v_t,v_{t+1},\ldots,v_m) \nonumber \\
  &\qquad\qquad\qquad - d \iota (v_1,\ldots,v_{t-1},v'_t,v_{t+1},\ldots,v_m) \bigr)
  \end{align}
\end{document}

LaTeX result

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

ConTeXt output

You must log in to answer this question.

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