# LaTeX locally change equation numbering in empheq

The following short sample generates a list of numbered chemical reactions. I would like to change the numbering from the default (1) and (2) to (R1) and (R2).

\documentclass[]{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\usepackage{empheq}
\begin{document}
\ce{CH3CHO &-> CH3CO + H} \\
\ce{CH3CHO &-> CH2CHO + H}
\end{empheq}
\end{document}


I tried using the technique given here, shown below, changing what's given in the link to align, but it errors out reporting Package keyval Error: reaction undefined.

\documentclass[]{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\usepackage{empheq}
\newcounter{defcounter}
\setcounter{defcounter}{0}
\newenvironment{reaction}{%
\refstepcounter{defcounter}
\renewcommand\theequation{R\thedefcounter}
\begin{align}}
{\end{align}}

\begin{document}
\ce{CH3CHO &-> CH3CO + H} \\
\ce{CH3CHO &-> CH2CHO + H}
\end{empheq}

\end{document}

• Welcome to TeX.SX! Can you please clarify what you are trying to do. Specifically, do you want ALL equations numbered as (R1), (R2), ... or just some of them? If the latter, please say whether you want the numbering to look like (1), (2), (R3), (R4), (5), ..., or for the R-numbers to be independent of the other equation numbers. – Andrew Jul 1 '15 at 22:52

The empheq package provides clever means to create nice equations. Using wrappers for some other setup requires some work to do (see section 6 Creating something new for examples and descriptions)

I've decided to use a special reactempheq environment which uses the common equation counter but applies the (R1) format. The usual empheq environment is not changed by this.

\documentclass[]{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\usepackage{empheq}
\begin{document}

\newenvironment{reactempheq}[2][]{%
\renewcommand{\theequation}{R\arabic{equation}}
\setkeys{EmphEqEnv}{#2}%
\setkeys{EmphEqOpt}{#1}%
\EmphEqMainEnv%
}{%
\endEmphEqMainEnv%
}