附录后不需要按章节编号的公式

附录后不需要按章节编号的公式

可能有一个简单的解决方法,但我需要在 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}

在此处输入图片描述

相关内容