30

I have some equations that I have written inside the align environment. Because some of these equations are rather long, they tend to spill over the page. I have tried using the split environment inside the align environment to split some of these equations over two lines but this appears to break the code. I would be very grateful for some advice on how to modify my code in order to achieve the desired outcome. My (original) code and the output produced by LaTeX are shown below.

enter image description here

\documentclass[11pt]{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm, bm}

\begin{document}

\begin{align}
\dot{v}       & = \dfrac{1}{m}[T\cos\beta\cos(\alpha+\epsilon)-D]-g\sin\gamma +\dot{w}_{x} \cos\gamma\cos\chi+\dot{w}_{y}\cos\gamma\sin\chi \\[2pt]
\dot{\gamma}  & = \dfrac{1}{m}[(Y-T\sin\beta\cos(\alpha+\epsilon))\sin\mu + (T\sin(\alpha +\epsilon)+L)\cos\mu] - \dfrac{g}{v}\cos\gamma +\dfrac{1}{v}[\dot{w}_{x}\sin\gamma\cos\chi + \dot{w}_{y}\sin\gamma\sin\chi] \\[2pt]
\dot{\chi}    & = \dfrac{1}{mv\cos\gamma}[(L+T\sin(\alpha+\epsilon) )\sin\mu + (T\sin\beta \cos(\alpha  + \epsilon) - Y)\cos\mu] + \dfrac{1}{v\cos\gamma}[\dot{w}_{x}\sin\chi-\dot{w}_{y}\cos\chi] 
\end{align}

\end{document} 
egreg
  • 1,121,712
Bob1986
  • 479

4 Answers4

35

You can use split inside align:

\documentclass[11pt]{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm, bm}

\begin{document}

\begin{align}
\begin{split}
  \dot{v}     & = \dfrac{1}{m}[T\cos\beta\cos(\alpha+\epsilon)-D]-g\sin\gamma \\
              &\qquad +\dot{w}_{x} \cos\gamma\cos\chi+\dot{w}_{y}\cos\gamma\sin\chi
\end{split}
\\[2ex]
\begin{split}
\dot{\gamma}  & = \dfrac{1}{m}[(Y-T\sin\beta\cos(\alpha+\epsilon))\sin\mu \\
              &\qquad + (T\sin(\alpha +\epsilon)+L)\cos\mu] - \dfrac{g}{v}\cos\gamma \\
              &\qquad +\dfrac{1}{v}[\dot{w}_{x}\sin\gamma\cos\chi + \dot{w}_{y}\sin\gamma\sin\chi]
\end{split}
\\[2ex]
\begin{split}
\dot{\chi}    & = \dfrac{1}{mv\cos\gamma}[(L+T\sin(\alpha+\epsilon) )\sin\mu \\
              &\qquad + (T\sin\beta \cos(\alpha  + \epsilon) - Y)\cos\mu] \\
              &\qquad + \dfrac{1}{v\cos\gamma}[\dot{w}_{x}\sin\chi-\dot{w}_{y}\cos\chi]
\end{split}
\end{align}

\end{document} 

enter image description here

egreg
  • 1,121,712
  • Very helpful! In a similar situation where I wanted to use \phantom{PREVIOUS LINE} instead of \qquad to get an alignment further to the right, I found that I needed two things: first a % at the end of the previous line, secondly an extra ~ before the \phantom command. These alignment issues can be challenging at times. – PatrickT Apr 01 '21 at 01:04
  • Can we add a control so that the sign = after \dot{v}, \dot{\gamma}, and \dot{\chi} are aligned? – Akira Oct 20 '21 at 13:30
  • @Akira They are. See this picture that I got from the very example, just adding the rule. – egreg Oct 20 '21 at 13:35
  • Thank you so much your your comment. It works like a charm <3 https://i.stack.imgur.com/Zn1PJ.png – Akira Oct 20 '21 at 13:39
  • @egreg What is \[2ex] command? I've seen it in a few examples but I cannot find what it does? – David Waterworth Oct 27 '22 at 22:58
  • 1
    @DavidWaterworth It tells TeX to end the line and to add some vertical space. – egreg Oct 28 '22 at 06:12
5

Choose manually some suitable points at which the equations can break and add the \notag or \nonumber command to remove the equation label at that line.

\documentclass[11pt]{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm, bm}

\begin{document}

\begin{align}
\dot{v}        ={} &\dfrac{1}{m}[T\cos\beta\cos(\alpha+\epsilon)-D]-g\sin\gamma +\dot{w}_{x} \cos\gamma\cos\chi+\dot{w}_{y}\cos\gamma\sin\chi \\[2pt]
\dot{\gamma}   ={} &\dfrac{1}{m}[(Y-T\sin\beta\cos(\alpha+\epsilon))\sin\mu + (T\sin(\alpha +\epsilon)+L)\cos\mu] - \dfrac{g}{v}\cos\gamma \notag\\
                   &{}+\dfrac{1}{v}[\dot{w}_{x}\sin\gamma\cos\chi+ \dot{w}_{y}\sin\gamma\sin\chi] \\[2pt]
\dot{\chi}     ={} &\dfrac{1}{mv\cos\gamma}[(L+T\sin(\alpha+\epsilon) )\sin\mu + (T\sin\beta \cos(\alpha  + \epsilon) - Y)\cos\mu] \notag\\ 
                   &{}+\dfrac{1}{v\cos\gamma}[\dot{w}_{x}\sin\chi-\dot{w}_{y}\cos\chi] 
\end{align}

\end{document}

enter image description here

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
  • Dear 'AboAmmar', many thanks for sharing your solution, this is precisely what I was after. Thanks. Regards – Bob1986 Mar 15 '17 at 18:56
5

Here is a solution with aligned and the fleqn environment from nccmath:

\documentclass[11pt]{book}
\usepackage{mathtools,amsfonts,amssymb,amsthm, bm, nccmath}
%\usepackage{geometry}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.3pt}

\begin{document}

\begin{fleqn}% comment if you uncomment \usepackage{geometry}
  \begin{align}
    \dot{v} & = \dfrac{1}{m}[T\cosβ\cos(\alpha+ϵ)-D]-g\sinγ+\dot{w}_{x} \cosγ\cos\chi+\dot{w}_{y}\cosγ\sinχ\!\! \\[2pt]
    \dot{γ} & =\begin{aligned}[t] \dfrac{1}{m}\bigl[(Y-T\sinβ\cos(\alpha+ϵ))\sinμ+ (T\sin(α+ϵ)+L)\cosμ\bigr] \\[-1.2ex]%
    {}- \dfrac{g}{v}\cosγ+\dfrac{1}{v}\bigl[\dot{w}_{x}\sinγ\cosχ+ \dot{w}_{y}\sinγ\sinχ\bigr]\end{aligned} \\[2pt]
    \dot{χ} & =\begin{aligned}[t] \dfrac{1}{mv\cosγ}\bigl[(L+T\sin(\alpha+ϵ) )\sinμ+ (T\sinβ\cos(α+ ϵ) - Y)\cosμ\bigr] \\[-1.2ex]%
    {}+ \dfrac{1}{v\cosγ}\bigl[\dot{w}_{x}\sin\chi-\dot{w}_{y}\cosχ\bigr]\end{aligned}
  \end{align}
\end{fleqn}

\end{document} 

enter image description here

Note that, if you load geometry, you have more sensible outside margins, so you don't need any more fleqn:

enter image description here

Bernard
  • 271,350
  • 1
    if you're submitting an article for publication in a journal, don't use geometry. if the display doesn't fit within the journal's required margins, you're leaving yourself at the mercy of their copyeditors. – barbara beeton Mar 15 '17 at 17:04
  • Dear All, Many thanks for sharing your respective solutions. The one provided by 'AboAmmar' is essentially what I was looking to achieve. Kind regards, Bob – Bob1986 Mar 15 '17 at 18:58
5

You can keep using the align environment. At suitable locations, insert \notag \\ &\qquad directives to (a) introduce line breaks and (b) provide an alignment anchor for the remaining stub.

enter image description here

\documentclass[11pt]{book}
\usepackage{amsmath}

\begin{document}
\begin{align}
\dot{v}       
&= \frac{1}{m}\bigl[T\cos\beta\cos(\alpha+\epsilon)-D\bigr]-g\sin\gamma \notag\\
&\qquad +\dot{w}_x \cos\gamma\cos\chi+\dot{w}_y\cos\gamma\sin\chi \\[2pt]
\dot{\gamma} 
&= \frac{1}{m}\bigl[(Y-T\sin\beta\cos(\alpha+\epsilon))\sin\mu + (T\sin(\alpha +\epsilon)+L)\cos\mu\bigr]\notag\\
&\qquad -\frac{g}{v}\cos\gamma +\frac{1}{v}(\dot{w}_x\sin\gamma\cos\chi + \dot{w}_y\sin\gamma\sin\chi) \\[2pt]
\dot{\chi}    
&= \frac{1}{mv\cos\gamma}\bigl[(L+T\sin(\alpha+\epsilon) )\sin\mu + (T\sin\beta \cos(\alpha  + \epsilon) - Y)\cos\mu\bigr] \notag\\
&\qquad +\frac{1}{v\cos\gamma}(\dot{w}_x\sin\chi-\dot{w}_y\cos\chi)
\end{align}

\end{document} 
Mico
  • 506,678