0

How is it possible to move the second line of the equation to begin few spaces to the right like this:

enter image description here

So all the after lines will start at the same place.

My code looks as following:

\begin{align}
&b_{PWM}(t) = D + \frac{M}{2} \text{cos}(\omega_{1}t + \theta_{1})
\\
&+ \sum_{m=1}^{+\infty} \frac{1}{m\pi} \left\{\text{sin}\left[m(\omega_{c}t+\theta_{c})\right] -J_{0}(m\pi M) \cdot \text{sin} \left[m(\omega_{c}t+\theta_{c}) - 2mD\pi \right] \right\}
\\
& + \sum_{m=1}^{+\infty} \sum_{n=\pm 1}^{\pm \infty} \frac{J_{n}(m \pi M)}{m \pi} \cdot \text{sin} \left[ \frac{n \pi}{2} - m(\omega_{c}t + \theta_{c}) -n(\omega_{1}t + \theta_{1}) +2mD \pi \right]
\end{align}

and the result I get is:

enter image description here

Thank you

4
  • Please help us with a code showing your problem. What you want to achieve is not clear.
    – Denis
    Sep 21, 2018 at 13:01
  • 4
    (1) welcome, (2) assuming you are using align* from amsmath, align on the right of the = by using = {} & and align in front of the + on the second line using & +
    – daleif
    Sep 21, 2018 at 13:09
  • 1
    \text{cos} is really wrong: \cos is the command to use. Similarly for the sine.
    – egreg
    Sep 21, 2018 at 13:43
  • The last image does not correspond to the code given. Also please always post full minimal examples not just sniplets where others have to guess the test of the document in order to test your code.
    – daleif
    Sep 21, 2018 at 13:50

3 Answers 3

2

If the equation is unnumbered, use align* from the amsmath environment, and set the alignment points to, say, +. If the equation is numbered, insert a split or an aligned environment within equation:

\documentclass{article}

\usepackage{mathtools}
\usepackage{geometry}

\begin{document}

  \begin{equation}
\begin{split}b_{\mathrm{bwp}}(t) = D & +\frac{M}{2}\cos(ω_1t + θ_1) \\
& + \sum_{m=1}^{+\infty}\frac{1}{m\pi}\sin[m(ω_ct + θ_c)]
\end{split}
\end{equation}

\end{document} 

enter image description here

5
  • I get error saying split won't work here
    – Ben
    Sep 21, 2018 at 13:41
  • I can't really understand the difference between “numbered” and “unnumbered”. The solution with split is the same whether you embed it either in equation or in equation*.
    – egreg
    Sep 21, 2018 at 13:42
  • What I had in head is that for unnumbered equation, one doesn't have to nest an environment within another. A single align* will do (b.t.w., thanks for the edit!)
    – Bernard
    Sep 21, 2018 at 13:51
  • @Bernard Yes, it would do, but at the expense of uniformity. Say the coauthor or advisor tells you “that equation must be numbered”, you have to change align* into equation with a nested split; if you use equation* from the outset, you have just to remove a couple of asterisks.
    – egreg
    Sep 21, 2018 at 14:00
  • @ben No, in the example it works, so you seem to be doing something different. We can't know what.
    – egreg
    Sep 21, 2018 at 17:28
0

With align environment it should be very simple, just add this symbol "&" before the "=" symbol, like this: "& =", see below simple example:

\begin{align}

A & = B + B + B

\\\

& = C + C + C

\\\\[2pt]

& = D + D + D

\end{align}

% Note that The [2pt] is just to space between the equation's lines if you like, you can remove it.

1
  • 1
    This does neither address nor solve OPs problem.
    – Roland
    Jan 4, 2022 at 2:58
0

The IEEEeqnarray environment from the IEEEtrantools package can be used. As the 2nd and 3rd lines overlap with equation no, IEEEeqnarraynumspace command can be used to avoid that. If equation no is not expected, they can be suppressed by using the * version of the environment.

\documentclass{article}

\usepackage{IEEEtrantools}
\usepackage{amsmath}

\begin{document}
\begin{IEEEeqnarray}{rCl}
b_{PWM}(t) & = & D + \frac{M}{2} \cos(\omega_{1}t + \theta_{1})
\\
           &   & \negmedspace {} + \sum_{m=1}^{+\infty} \frac{1}{m\pi} \left\{\sin\left[m(\omega_{c}t+\theta_{c})\right] -J_{0}(m\pi M) \cdot \text{sin} \left[m(\omega_{c}t+\theta_{c}) - 2mD\pi \right] \right\}
\IEEEeqnarraynumspace\\
           &   & \negmedspace {} + \sum_{m=1}^{+\infty} \sum_{n=\pm 1}^{\pm \infty} \frac{J_{n}(m \pi M)}{m \pi} \cdot \text{sin} \left[ \frac{n \pi}{2} - m(\omega_{c}t + \theta_{c}) -n(\omega_{1}t + \theta_{1}) +2mD \pi \right]
\IEEEeqnarraynumspace
\end{IEEEeqnarray}
\end{document}

enter image description here

You must log in to answer this question.

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