[Tex/LaTex] How to reuse an equation number and continue numbering from previous subequation environment

alignnumberingsubequations

Herein in my given code, I am having four equations which are getting numbered as, 1a, 1b, 2a and 2b respectively. I want them to get numbered as 1a, 1b, 1b and 1c (because if you check then eq.1b and eq.2a are the same). Unfortunately, I'm having to use one line of text in between, since I want to propagate a certain logic which causes a change in the equation form, hence I'm having to break the align and the subequation environment which is causing this issue. Is there some way around this? Or is there any suggestion from the experienced guys at this portal as to how I cold write it any better? I am extremely new to Latex and I'm writing my first report using it.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{subequations}
\begin{align}
  \vec{a}\cdot\vec{b} &=\pi\\
  (\vec{a_1}+\vec{a_2})\cdot(\vec{b_1}+\vec{b_2}) &=\pi
\end{align}
\end{subequations}  
since $\vec{a_1}\cdot\vec{b_2}$ and $\vec{a_2}\cdot\vec{b_1}$ is equal to zero, hence
\begin{subequations}
\begin{align}
(\vec{a_1}+\vec{a_2})\cdot(\vec{b_1}+\vec{b_2}) &=\pi\\
\vec{a_1}\cdot\vec{b_1}+\vec{a_2}\cdot\vec{b_2} &=\pi
\end{align}
\end{subequations}
\end{document}

Best Answer

subequations can enclose text. it only influence on equation numbering:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{subequations}
\begin{align}
  \vec{a}\cdot\vec{b} &=\pi\\
  (\vec{a_1}+\vec{a_2})\cdot(\vec{b_1}+\vec{b_2}) &=\pi
\end{align}
since $\vec{a_1}\cdot\vec{b_2}$ and $\vec{a_2}\cdot\vec{b_1}$ is equal to zero, hence
\begin{align}
(\vec{a_1}+\vec{a_2})\cdot(\vec{b_1}+\vec{b_2}) &=\pi\\
\vec{a_1}\cdot\vec{b_1}+\vec{a_2}\cdot\vec{b_2} &=\pi
\end{align}
\end{subequations}
\end{document}

enter image description here

edit: it seems that the problem is retyping equation (1b). i don't see any reasons to do this, i would simply escape this repetition and wrote as:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{subequations}
    \begin{align}
  \vec{a}\cdot\vec{b} &=\pi
            \label{eq:step-1}   \\
  (\vec{a_1}+\vec{a_2})\cdot(\vec{b_1}+\vec{b_2}) &=\pi
            \label{eq:step-2}
\intertext{since $\vec{a_1}\cdot\vec{b_2}$ and $\vec{a_2}\cdot\vec{b_1}$ is equal to zero, hence \eqref{eq:step-2} becomes}
\vec{a_1}\cdot\vec{b_1}+\vec{a_2}\cdot\vec{b_2} &=\pi
            \label{eq:step-3}
    \end{align}
\end{subequations}
\end{document}

where for text between equations is used intertext{...}. with this all three equation is aligned at sign =:

enter image description here

in \intertext{...} i add \eqref{eq:step-2} becomes only for show that you can equation (1b) refered, if you wish. without this addition the evaluation is also very clear (to my taste).

if you persist with repetition of equation (1b) and give it the same number as it has, than you can try:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{subequations}
    \begin{align}
  \vec{a}\cdot\vec{b} &=\pi
            \label{eq:step-1}   \\
  (\vec{a_1}+\vec{a_2})\cdot(\vec{b_1}+\vec{b_2}) &=\pi
            \label{eq:step-2}
\intertext{since $\vec{a_1}\cdot\vec{b_2}$ and $\vec{a_2}\cdot\vec{b_1}$ is equal to zero, hence}
\addtocounter{equation}{-1} % <---- added
  (\vec{a_1}+\vec{a_2})\cdot(\vec{b_1}+\vec{b_2}) &=\pi\\
\vec{a_1}\cdot\vec{b_1}+\vec{a_2}\cdot\vec{b_2} &=\pi
            \label{eq:step-3}
    \end{align}
\end{subequations}
\end{document}

enter image description here

Related Question