5

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}
1
  • 2
    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, 2013 at 12:18

2 Answers 2

7

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
\begin{equation}
\label{eq1}
x+y=z
\end{equation}

\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}

\begin{equation}
\label{eq2}
x^2+y^2=1
\end{equation}

\begin{equation}
\label{eq3}
x^2-y^2=1
\end{equation}

\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:

Output

2

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .