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} 
3

5 Answers 5

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

6
  • 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 1, 2021 at 1:04
  • Can we add a control so that the sign = after \dot{v}, \dot{\gamma}, and \dot{\chi} are aligned?
    – Akira
    Oct 20, 2021 at 13:30
  • @Akira They are. See this picture that I got from the very example, just adding the rule.
    – egreg
    Oct 20, 2021 at 13:35
  • Thank you so much your your comment. It works like a charm <3 i.sstatic.net/Zn1PJ.png
    – Akira
    Oct 20, 2021 at 13:39
  • 1
    @DavidWaterworth It tells TeX to end the line and to add some vertical space.
    – egreg
    Oct 28, 2022 at 6: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

1
  • Dear 'AboAmmar', many thanks for sharing your solution, this is precisely what I was after. Thanks. Regards
    – Bob1986
    Mar 15, 2017 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

2
  • 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. Mar 15, 2017 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, 2017 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} 
0

I would use \begin{multlined}[t] ... \end{multlined} to split long equation. In this way, you don't need to use \qquad nor {}.

enter image description here

\documentclass[11pt]{article}
\usepackage{mathtools}
\usepackage[hypertexnames=false]{hyperref}
\hypersetup{
  colorlinks=true,
  linkcolor=blue,
  filecolor=blue,
  urlcolor=red,
  citecolor=magenta
}
\usepackage{amsmath}
\usepackage[noabbrev,capitalize,nameinlink]{cleveref}
\usepackage{autonum}

\begin{document}

\begin{align}
\dot{v} &= \begin{multlined}[t]
\frac{1}{m}\bigl[T\cos\beta\cos(\alpha+\epsilon)-D\bigr]-g\sin\gamma \\
+\dot{w}_x \cos\gamma\cos\chi+\dot{w}_y\cos\gamma\sin\chi
\end{multlined} \label{eq1}\\
\dot{\gamma}  &= \begin{multlined}[t]
\frac{1}{m}\bigl[(Y-T\sin\beta\cos(\alpha+\epsilon))\sin\mu + (T\sin(\alpha +\epsilon)+L)\cos\mu\bigr]\\
-\frac{g}{v}\cos\gamma +\frac{1}{v}(\dot{w}_x\sin\gamma\cos\chi + \dot{w}_y\sin\gamma\sin\chi)
\end{multlined} \label{eq2} \\
\dot{\chi} &= \begin{multlined}[t]
\frac{1}{mv\cos\gamma}\bigl[(L+T\sin(\alpha+\epsilon) )\sin\mu + (T\sin\beta \cos(\alpha  + \epsilon) - Y)\cos\mu\bigr] \\
+\frac{1}{v\cos\gamma}(\dot{w}_x\sin\chi-\dot{w}_y\cos\chi)
\end{multlined} \label{eq3}
\end{align}

Only numbering of \eqref{eq1} will be displayed.

\begin{align}
F & =\begin{multlined}[t]
\{F_{x} \in  F_{c} : (|S| > |C|) \\
\cap (\mathrm{minPixels}  < |S| < \mathrm{maxPixels}) \\
\cap (|S_{\mathrm{connected}}| > |S| - \epsilon) \}
\end{multlined}
\end{align}

\end{document} 

You must log in to answer this question.

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