8

I want to align some equations on the left side in a document. And additionally I want to have some aligned text behind every equation. Also the equations need to be numbered. With the code below my goal is almost achieved. I just need to bring the text aligned to the right... How do I do that? Thanks

\documentclass[a4paper, 11pt]{book}
\usepackage{amsmath}
\begin{document}
\begin{flalign}
    &u_\mathrm{L} = L \cdot \frac{\text{d}i_\mathrm{L}}{\text{d}t} \quad(\text{Differentialform}) &\label{eq:2_19} \\
    &i_\mathrm{L} = \frac{1}{L} \cdot \int\limits_t u_\mathrm{L} \text{d}t + i_\mathrm{L}(t=0) \quad (\text{Integralform}) &\label{eq:2_20}
\end{flalign}
\end{document}

3 Answers 3

4

... or just rearrange ampersands:

\documentclass[a4paper, 11pt]{book}
    \usepackage{amsmath}
\begin{document}
    \begin{flalign}
u_\mathrm{L}    &   = L \cdot \frac{\text{d}i_\mathrm{L}}{\text{d}t}       
    &       
                &   \text{(Differentialform)}       &       &   \\
i_\mathrm{L}    & = \frac{1}{L} \cdot \int\limits_t u_\mathrm{L} \text{d}t + i_\mathrm{L}(t=0)     
    &       
                &   \text{(Integralform)}           &       &   
    \end{flalign}
\end{document} 
5

It's just a matter of using \mathllapfrom the mathtools package for (part of) the longest equation:

 \documentclass[a4paper, 11pt]{book}

\usepackage{mathtools}

\begin{document}

\begin{flalign}
& u_\mathrm{L} = L · \frac{\text{d}i_\mathrm{L}}{\text{d}t} & & \text{(Differentialform)} & & \label{eq:2_19} \\
& \mathrlap{i_\mathrm{L} = \frac{1}{L} · \int\limits_t u_\mathrm{L} \text{d}t + i_\mathrm{L}(t=0) } & & \text{(Integralform)} & & \label{eq:2_20}
\end{flalign}

\end{document} 

enter image description here

7
  • I don't want the text all the way on the right side. I want the text to start on the same height. say \qquad behind the end of the longer equation.
    – Dave
    Apr 12, 2014 at 20:57
  • Sorry, I misunderstood what you want. I'll modify my answer in a moment.
    – Bernard
    Apr 12, 2014 at 21:42
  • @Dave: I modified my answer. Hope the spacing is correct for you.
    – Bernard
    Apr 12, 2014 at 21:59
  • I got some conflict with the mathtools package. I will try your solution at some other point. The solution with rearranging the ampersands is the easiest solution I guess.
    – Dave
    Apr 12, 2014 at 22:29
  • Strange… In my opinion, mathtools is one of the really fundamental packages for maths, as it extends amsmath (and corrects two bugs).
    – Bernard
    Apr 12, 2014 at 22:45
1

You can use the [fleqn] option to the amsmath pacakge and and control the left indent via the \mathindent length:

enter image description here

Notes:

  • The showframe package was used just to show the page margins. It is not needed in your actual use case.

Code:

\documentclass{book}
\usepackage[fleqn]{amsmath}
\usepackage{showframe}

\begin{document}

{%\setlength{\mathindent}{0pt}% <-- brace group to keep these changes local.
\begin{alignat}{3}
    u_\mathrm{L} &= L \cdot \frac{\text{d}i_\mathrm{L}}{\text{d}t} &&\quad(\text{Differential form}) &\label{eq:2_19} \\
   i_\mathrm{L} &= \frac{1}{L} \cdot \int\limits_t u_\mathrm{L} \text{d}t + i_\mathrm{L}(t=0)  &&\quad(\text{Integral form}) \label{eq:2_20}
\end{alignat}
}

\end{document}

You must log in to answer this question.

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