![附录后不需要按章节编号的公式](https://linux22.com/image/403979/%E9%99%84%E5%BD%95%E5%90%8E%E4%B8%8D%E9%9C%80%E8%A6%81%E6%8C%89%E7%AB%A0%E8%8A%82%E7%BC%96%E5%8F%B7%E7%9A%84%E5%85%AC%E5%BC%8F.png)
可能有一个简单的解决方法,但我需要在 revtex4-1 中调用附录后,方程编号在每个部分不重置。我该怎么做?
这是一个最小的(不是?)工作示例:
\documentclass[aps,twocolumn,showpacs,amsmath,amssymb,nofootinbib]{revtex4-1}
\begin{document}
\title{I don't want the equation numbers to change by section after the appendix}
\maketitle
\section{Before appendix}
Here is an equation
\begin{equation}
1+1=2
\end{equation}
And another
\begin{equation}
F=ma
\end{equation}
\section{Just before appendix}
Next...
\begin{equation}
E=mc^2
\end{equation}
\begin{appendix}
\section{An appendix}
La la la...everything is normal here
\begin{equation}
\underset{x\rightarrow0}\lim x=0
\end{equation}
\end{appendix}
\section{After appendix}
Here is an equation
\begin{equation}
1+1=2
\end{equation}
And another
\begin{equation}
F=ma
\end{equation}
\section{I wanted (3)!}
Next...
\begin{equation}
E=mc^2
\end{equation}
\end{document}
答案1
欢迎!问题是,在附录中,方程计数器在新章节开始时被重置。根据这个答案一种方法是加载chngcntr
然后添加
\counterwithout{equation}{section}
\addtocounter{equation}{-1}
后\end{appendix}
。
\documentclass[aps,twocolumn,showpacs,amsmath,amssymb,nofootinbib]{revtex4-1}
\usepackage{chngcntr}
\begin{document}
\title{I don't want the equation numbers to change by section after the appendix}
\maketitle
\section{Before appendix}
Here is an equation
\begin{equation}
1+1=2
\end{equation}
And another
\begin{equation}
F=ma
\end{equation}
\section{Just before appendix}
Next...
\begin{equation}
E=mc^2
\end{equation}
\begin{appendix}
\section{An appendix}
La la la...everything is normal here
\begin{equation}
\underset{x\rightarrow0}\lim x=0
\end{equation}
\end{appendix}
\counterwithout{equation}{section}
\addtocounter{equation}{-1}
\section{After appendix}
Here is an equation
\begin{equation}
1+1=2
\end{equation}
And another
\begin{equation}
F=ma
\end{equation}
\section{I wanted (3)!}
Next...
\begin{equation}
E=mc^2
\end{equation}
\end{document}
当然,你仍然会遇到方程编号不唯一的问题。所以你也许更喜欢这样的东西:
\documentclass[aps,twocolumn,showpacs,amsmath,amssymb,nofootinbib]{revtex4-1}
\usepackage{chngcntr}
\newcounter{lastequationbeforeappendix}
\begin{document}
\title{I don't want the equation numbers to change by section after the appendix}
\maketitle
\section{Before appendix}
Here is an equation
\begin{equation}
1+1=2
\end{equation}
And another
\begin{equation}
F=ma
\end{equation}
\section{Just before appendix}
Next...
\begin{equation}
E=mc^2
\end{equation}
\setcounter{lastequationbeforeappendix}{\number\value{equation}}
\begin{appendix}
\section{An appendix}
La la la...everything is normal here
\begin{equation}
\underset{x\rightarrow0}\lim x=0
\end{equation}
\end{appendix}
\counterwithout{equation}{section}
\setcounter{equation}{\number\value{lastequationbeforeappendix}}
\section{After appendix}
Here is an equation
\begin{equation}
1+1=2
\end{equation}
And another
\begin{equation}
F=ma
\end{equation}
\section{I wanted (3)!}
Next...
\begin{equation}
E=mc^2
\end{equation}
\end{document}