I have align environments in each section of my TeX file and I use \numberthis\label to label the last equation in the align environment. But this labels or numbers the equations in the order they are in the file. Can I have a sectionwise numbering of the equations in the align environments? For example, the last equations of the 1st and 2nd align environments(assuming I have only got 'align' environments) in section A to be labeled as A.1 and A.2?
MWE-
\documentclass[english,aps,amsmath,amssymb]{revtex4-1}
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}
\begin{document}
\section{section1}
\begin{align*}
x&= 1\\
&= 21313\numberthis\label{eqn}
\end{align*}
\begin{align*}
x&= 1\\
&= 2324\numberthis\label{eqn}
\end{align*}
\section{section2}
\begin{align*}
x&= 1\\
&= 34\numberthis\label{eqn}
\end{align*}
\begin{align*}
x&= 2\\
&= 345\numberthis\label{eqn}
\end{align*}
\end{document}
In this example, I have 4 equations and they get numbered from 1 to 4. I want to keep using the align environment and \numberthis command. And want to have numbering based on section like 1.1 and 1.2 (or A.1 and A.2) for the equations in the first section. How do I change the scope of numbering with \numberthis?
\documentclassand\end{document}. Related: Continuous v. per-chapter/section numbering of figures, tables, and other document elements or Change the type of equation numbering in document class article – Bobyandbob Jul 31 '17 at 14:26\usepackage{nameref}and an redefinition of\renewcommand*{\theequation}(Numbering equations differently before sections start within chapter)(with \currentname )you can get it. If you need further help please provide a MWE. – Bobyandbob Jul 31 '17 at 14:35\documentclassandamsmathis missing as well – Jul 31 '17 at 15:02\numberwithin{equation}{section}? BTW, the\addtocounter{equation}{1}should really be\refstepcounter{equation}. – campa Jul 31 '17 at 15:06equationandalign, in this respectequationis used as a catch-all for all numbered display math, so it also coversalign,gather, etc. – barbara beeton Jul 31 '17 at 15:21align*environments, which by design don't generate any equation numbers. How do you expect to generate equation numbers of any kind usingalign*environments? Also, using the same argument for\labelfour [4!] times is bound to create havoc. It certainly will generate lots of warning messages... – Mico Jul 31 '17 at 15:57