3

Take a look at this here:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{align*}
\Leftrightarrow \qquad P'_1(t)+\lambda P_1(t)&=\lambda e^{-\lambda t} && (2.6)\\
\Leftrightarrow \qquad e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)&=\lambda e^{\lambda t} e^{-\lambda t}=\lambda \\
\end{align*}
\end{document}

Is it possible to have the equivalences below each other like the equations are?

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{alignat*}{4}
P'_1(t)&=-\lambda P_1(t)+\lambda P_0(t)\\
\Leftrightarrow &&\qquad  P'_1(t)+\lambda P_1(t)&=\lambda e^{-\lambda t} && (2.6)\\
\Leftrightarrow &&  e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)&=\lambda e^{\lambda t} e^{-\lambda t}=\lambda \\
\end{alignat*}
\end{document}

This almost works but i have the mention problem that the first line is pulled to the very left.

  • 2
    Of course, you don't want to add the equation number manually, do you? – egreg Dec 14 '18 at 8:45
3

Like so?

\documentclass{article}

\usepackage{amsmath}
\begin{document}
\begin{align}
\Leftrightarrow&& P'_1(t)+\lambda P_1(t)&=\lambda e^{-\lambda t} \tag{2.6} \\
\Leftrightarrow&& e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)&=\lambda e^{\lambda t} e^{-\lambda t}=\lambda \notag
\end{align}
\end{document}

enter image description here

  • Almost - if i have another line above the first \Leftrightarrow - Line it pulls the term to the very left "&&"-sign :/ – chri11 Dec 14 '18 at 8:57
3

You also might be interested in the ArrowBetweenLines from mathtools:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{amssymb}

\numberwithin{equation}{section}

\begin{document}

\setcounter{section}{2}\setcounter{equation}{5}

\begin{equation}\label{equivalenteqs}
\begin{alignedat}{2}
 & & abc & =def \\
 \ArrowBetweenLines &\qquad& P'_1(t)+\lambda P_1(t)&=\lambda e^{-\lambda t} \\
  \ArrowBetweenLines &\qquad& e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)
                           &=\lambda e^{\lambda t} e^{-\lambda t}=\lambda \\
\end{alignedat}
\end{equation}
As we see in equation~\eqref{equivalenteqs} we can blah blah.

\end{document} 

enter image description here

3

You don't want to manually number your equations and not because of the fact that the numbers would be unaligned to each other, but because maintaining manual numbering is essentially impossible.

Use the \label-\ref mechanism for this.

Your problem can be solved with alignedat:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}

\numberwithin{equation}{section}

\begin{document}

% let's emulate being in section 2 with five
% numbered equations before this one; a real document
% will have nothing like this
\setcounter{section}{2}\setcounter{equation}{5} 

\begin{equation}\label{equivalenteqs}
\begin{alignedat}{2}
  \Leftrightarrow &\qquad& P'_1(t)+\lambda P_1(t)&=\lambda e^{-\lambda t} \\
  \Leftrightarrow &\qquad& e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)
                           &=\lambda e^{\lambda t} e^{-\lambda t}=\lambda \\
\end{alignedat}
\end{equation}
As we see in equation~\eqref{equivalenteqs} we can blah blah.

\end{document}

enter image description here

If you happen to have a first line without the arrows, just add the suitable number of alignment points:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}

\numberwithin{equation}{section}

\begin{document}

% let's emulate being in section 2 with five
% numbered equations before this one
\setcounter{section}{2}\setcounter{equation}{5} 

\begin{equation}
\begin{alignedat}{2}
                &\qquad&  P'_1(t)&=-\lambda P_1(t)+\lambda P_0(t)\\
\Leftrightarrow &      &  P'_1(t)+\lambda P_1(t)&=\lambda e^{-\lambda t} \\
\Leftrightarrow &      &  e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)&=\lambda e^{\lambda t} e^{-\lambda t}=\lambda \\
\Leftrightarrow &      & \frac{d}{dt}(e^{\lambda t}P_1(t))&=e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)=\lambda\\
\end{alignedat}
\end{equation}
As we see in equation~\eqref{equivalenteqs} we can blah blah.

\end{document}

enter image description here

On the other hand, I see no reason for aligning at the equals signs.

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}

\numberwithin{equation}{section}

\begin{document}

% let's emulate being in section 2 with five
% numbered equations before this one
\setcounter{section}{2}\setcounter{equation}{5} 

\begin{equation}\label{equivalenteqs}
\begin{aligned}
                && & P'_1(t)=-\lambda P_1(t)+\lambda P_0(t)\\
\Leftrightarrow && & P'_1(t)+\lambda P_1(t)=\lambda e^{-\lambda t} \\
\Leftrightarrow && & e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)=\lambda e^{\lambda t} e^{-\lambda t}=\lambda \\
\Leftrightarrow && & \frac{d}{dt}(e^{\lambda t}P_1(t))=e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t)=\lambda\\
\end{aligned}
\end{equation}
As we see in equation~\eqref{equivalenteqs} we can blah blah.

\end{document}

enter image description here

2

You can also use alignat:

enter image description here

Code:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{alignat*}{4}
  \Leftrightarrow &&\qquad P'_1(t)+\lambda P_1(t) &=\lambda e^{-\lambda t} && (2.6) \\
  \Leftrightarrow &&\qquad e^{\lambda t}P'_1(t)+\lambda e^{\lambda t}P_1(t) &=\lambda e^{\lambda t} e^{-\lambda t}=\lambda 
\end{alignat*}
\end{document}
  • Same problem here: if i have another line above the first \Leftrightarrow - Line it pulls the term to the very left "&&"-sign :/ – chri11 Dec 14 '18 at 9:06
  • Each & provide right alignment for the text before and left alignment for the left after, but without knowing more details it is difficult to help you further. Please update your test case in the question to more accurately reflect the issue you are having. – Peter Grill Dec 14 '18 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.