改变方程的参考

改变方程的参考

我找到了新的方法来最佳地创造一些参考到主方程,然后到子方程。到目前为止,我已经写了大约 200 页的免费学生书,我想对已经写好的方程和子方程做一些修改,但这样更简单。最大的问题是更改他写方程解释部分的所有参考文献,这让我心情很不好。有没有办法自动更改参考文献?我举一个小例子:

\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}

在此处输入图片描述 要更改参考文献,我应该使用“查找”,这项工作太长且繁琐,有没有办法拥有一个标签数据库,并且可以在数学解释的书面部分自动更改?

相关内容