A while ago StefanK help me to create a series of new tags and enviroments so that I could autogenerate a Listof... page for chemical equations which were numbered in my document separate from mathematical equations.
This was greatly sucessful and has worked on many reports I have written.
Now I'm writting my thesis and have started a series of chapers. I've noticed that the counter keeps incrementing even though I have changed chapter.
So my chemical equation in chapter one are numbered [1.1], second [1.2].
However at the start of chapter two they are numbered [2.3] and not [2.1] as I'd like.
Any ideas?
The code is :
Code: Select all
% Special Symbols Defined for Main Preamble
%%%%% to create a chemicalequation float
\usepackage{float}
\newfloat{chemicalequation}{htbp}{cex}[chapter]
\floatname{chemicalequation}{}
%%%%% create chemequation environment
\newcounter{chemequation}
\renewcommand*\thechemequation{[\thechapter.\arabic{chemequation}]}
\newenvironment{chemequation}{%
\stepcounter{chemequation}%
\begin{equation}}%
{\tag*{\thechemequation}%
\end{equation}}
%%%%% create chemtag to iterate and ref chemequations in an align environment
\newcommand*\chemtag{%
\stepcounter{chemequation}%
\tag*{\thechemequation}}
%%%%%
\newcommand\chemicalcaption[1]{%
\refstepcounter{chemicalequation}
\addcontentsline{cex}{section}%
{\protect\numberline{\thechemicalequation}{\ignorespaces #1}}
}
%%%%%
Using the following packages:
Code: Select all
%%%% Math Packages
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
%%%% Chemistry Specific
\usepackage{sistyle} % includes SI style sheets
\usepackage[version=3]{mhchem}
Code: Select all
\begin{chemicalequation} [H]
\begin{align}
\ce{O2 + H2O + 2e} ~& \ce{<=> HO2^{-} + OH^{-}}
~& E\stst : \SI{-0.076}{V} \chemtag \\
\ce{O2 + 2H2O + 2e} ~& \ce{<=> H2O2 + 2OH^{-}}
~& E\stst : \SI{-0.146}{V} \chemtag \\
\ce{O2 + 2H2O + 4e} ~& \ce{<=> 4OH^{-}}
~& E\stst : \SI{+0.401}{V} \chemtag \\
\ce{HO2^{-} + H2O + 2e} ~& \ce{<=> 3OH-}
~& E\stst : \SI{+0.878}{V} \chemtag
\end{align}
\chemicalcaption{Chemical_Equations_O}
\label{chem:Chemical_Equations_O}
\end{chemicalequation}