# How to force a special numbering for a specific equation

I want to introduce a set of chemical reactions (see code below) within a text containing some standard equations. Standard equations should be numbered continuously, but the chemical reactions should be numbered R1-Rn. How can i do that ?

\begin{align}
\ce{CH4} &+ \frac{3}{2}\ce{O2} \rightarrow \ce{CO} + 2\ce{H2O} \label{eqn:hom2}\\
\ce{CO}  &+ \frac{1}{2}\ce{O2} \rightarrow \ce{CO2} \label{eqn:hom3}
\end{align}

-
Welcome to TeX.SX! Are you using any chemistry package? Could you provide an example of the equations and how you typeset them in your document? – Ludovic C. Dec 1 '13 at 12:18

Here is a solution:

\documentclass{article}

\newcounter{chem}
\newcounter{temp}

\usepackage{amsmath}
\usepackage{mhchem}

\newenvironment{chequation}{%
\setcounter{temp}{\value{equation}}%
\setcounter{equation}{\value{chem}}%
\renewcommand{\theequation}{R\arabic{equation}}%
}{%
\setcounter{chem}{\value{equation}}%
\setcounter{equation}{\value{temp}}%
}

\begin{document}

\noindent
A \hfill Z
$$\label{eq1} x+y=z$$

\begin{chequation}
\begin{align}
\ce{CH4} &+ \frac{3}{2}\ce{O2} \rightarrow \ce{CO} + 2\ce{H2O} \label{eqn:hom2}\\
\ce{CO}  &+ \frac{1}{2}\ce{O2} \rightarrow \ce{CO2} \label{eqn:hom3}
\end{align}
\end{chequation}

$$\label{eq2} x^2+y^2=1$$

$$\label{eq3} x^2-y^2=1$$

\begin{chequation}
\begin{align}
\ce{CH4} &+ \frac{3}{2}\ce{O2} \rightarrow \ce{CO} + 2\ce{H2O} \label{eqn:foo}\\
\ce{CO}  &+ \frac{1}{2}\ce{O2} \rightarrow \ce{CO2} \label{eqn:bar}
\end{align}
\end{chequation}

In this example I have Reactions~\ref{eqn:hom2},~\ref{eqn:hom3},~\ref{eqn:foo} and~\ref{eqn:bar}, as well as Equations~\ref{eq1},~\ref{eq2} and~\ref{eq3}.

\noindent A \hfill Z

\end{document}


and its output:

-

Math tools allows to define ‘tag styles’: load mathtools and define in the preamble:

\newtagform{reaction}[r.]()


and in the body of your document:

\usetagform{reaction}


at the point from which you want to use this tag style. If at a later point, you want to go back to the standard tag, use:

\usetagform{default}

-