I have found new ways to optimally create some references to the main equations and therefore to the subequations. I have so far written about 200 pages of a free student book and I would like to make some changes to the equations and sub equations that I have already written, but this is simpler. The biggest problem is to change all the references in the part where he writes the explanations to the equations, this puts me in a bad mood. is there a way to automatically change references? I give a small example:
\documentclass{article}
\usepackage[english,italian]{babel}
\usepackage{amsmath}
\usepackage[colorlinks]{hyperref}
\usepackage{lipsum}
%https://tex.stackexchange.com/questions/101002/interrupting-and-resuming-subequations
%https://tex.stackexchange.com/questions/225517/subequations-with-main-equation-number
\makeatletter
\def\user@resume{resume}
\def\user@intermezzo{intermezzo}
%
\newcounter{previousequation}
\newcounter{lastsubequation}
\newcounter{savedparentequation}
\setcounter{savedparentequation}{1}
%
\renewenvironment{subequations}[1][]{%
\def\user@decides{#1}%
\setcounter{previousequation}{\value{equation}}%
\ifx\user@decides\user@resume
\setcounter{equation}{\value{savedparentequation}}%
\else
\ifx\user@decides\user@intermezzo
\refstepcounter{equation}%
\else
\setcounter{lastsubequation}{0}%
\refstepcounter{equation}%
\fi\fi
\protected@edef\theHparentequation{%
@ifundefined {theHequation}\theequation \theHequation}%
\protected@edef\theparentequation{\theequation}%
\setcounter{parentequation}{\value{equation}}%
\ifx\user@decides\user@resume
\setcounter{equation}{\value{lastsubequation}}%
\else
\setcounter{equation}{0}%
\fi
\def\theequation {\theparentequation \alph{equation}}%
\def\theHequation {\theHparentequation \alph{equation}}%
\ignorespaces
}{%
% \arabic{equation};\arabic{savedparentequation};\arabic{lastsubequation}
\ifx\user@decides\user@resume
\setcounter{lastsubequation}{\value{equation}}%
\setcounter{equation}{\value{previousequation}}%
\else
\ifx\user@decides\user@intermezzo
\setcounter{equation}{\value{parentequation}}%
\else
\setcounter{lastsubequation}{\value{equation}}%
\setcounter{savedparentequation}{\value{parentequation}}%
\setcounter{equation}{\value{parentequation}}%
\fi\fi
% \arabic{equation};\arabic{savedparentequation};\arabic{lastsubequation}
\ignorespacesafterend
}
\makeatother
\begin{document}
\begin{center}
\textbf{OLD OPTION}
\end{center}
In elementary algebra, the quadratic formula is a formula that provides the solution(s) to a quadratic equation. There are other ways of solving a quadratic equation instead of using the quadratic formula, such as factoring (direct factoring, grouping, AC method), completing the square, graphing and others.[1]
Given a general quadratic equation of the form
\begin{subequations}
\begin{equation}
ax^2+bx+c=0 \label{eq10a}
\end{equation}
\end{subequations}
with x representing an unknown, \textit{a}, \textit{b} and \textit{c} representing constants with $a\neq 0$, the quadratic formula is:
\begin{subequations}[resume]
\begin{equation}
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\label{eq10b}
\end{equation}
\end{subequations}
Here are some references: \eqref{eq10a}, \eqref{eq10b}
\begin{center}
\textbf{NEW OPTION}
\end{center}
In elementary algebra, the quadratic formula is a formula that provides the solution(s) to a quadratic equation. There are other ways of solving a quadratic equation instead of using the quadratic formula, such as factoring (direct factoring, grouping, AC method), completing the square, graphing and others.[1]
Given a general quadratic equation of the form
\begin{subequations}\label{eq10}
\begin{equation}
ax^2+bx+c=0 \tag{\ref{eq10}}
\end{equation}
\end{subequations}
with x representing an unknown, \textit{a}, \textit{b} and \textit{c} representing constants with $a\neq 0$, the quadratic formula is:
\begin{subequations}[resume]
\begin{equation}
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\label{eq10:a}
\end{equation}
\end{subequations}
Here are some references: \eqref{eq10}, \eqref{eq10:a}
\end{document}
to change the references I should use the "FIND" and it is too long and cumbersome work, is there a way to have a database of the labels and which can be changed automatically in the written part of the mathematical explanations?
subequationswhich instead of numbering(Xa),(Xb),(Xc)... it does(X),(Xa),(Xb)... Is it so or am I completely misunderstanding? – campa Nov 26 '20 at 08:36\ label{}of equation (1) for example\labeb{1a}to\label{1}, I want to change the\ eqref {1a}in the text automatically to\ eqref{1}– Antonio Nov 26 '20 at 11:43\label{2a}I would use labels that describe the equations, e.g.\label{sol:quadratic}for the solution to the quadratic equation. Then there is no need to change the label when additional equations are inserted. Using labels that match the equation numbers defeats the object of the\label&\refsystem - you may as well manually number the equations. – Ian Thompson Nov 26 '20 at 12:39