TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to typeset some chemical equations in my thesis, and I would like to have the chemical equations have a unique counter from regular equations.

I also need to have some of them align over the -> . I know I can use \cee{} from the mhchem package within the align environment, but I don't know to separate the counters.

I tried fiddling with creating a new environment, but couldn't get it to work right at all (first time trying that out...). I would love to have an aligned environment "chemical" that did all this.

Thanks in advance for any help!

share|improve this question
What did you try? How didn't it work? – Seamus Jun 27 '12 at 13:27
Well, I tried something like this: \newenvironment{chemical}% {\renewcommand{\theequation}{\thereaction}% \begin{align}}% {\end{align} \renewcommand{\theequation}{\arabic{equation}}} where \thereaction is related to a custom "reaction" counter. But I couldn't figure out how to force the align environment to temporarily increment the reaction counter instead of the equation counter, so I was stuck. – Brian Jun 27 '12 at 13:38
I was referring specifically to the reactions environment, which gives you the alignment and the separate numbering. – Jellby Jun 27 '12 at 15:19
You can use \usepackage[method=mhchem]{chemmacros} and ignore its formula building macros (i.e., the complete part III of the manual). You can then still use chemmacros's reaction environments (section 12 of the manual). – clemens Jun 27 '12 at 15:41
See also the other question about numbering mhchem reactions... – clemens Jun 27 '12 at 16:42

So, I figured out how to get what I wanted working by creating a new environment (modeled on the subequations implementation). I additionally created a "subreaction" environment as well.









    A = B

        \cee{2H2 + O2 &-> 2H2O}\\
        \cee{CH4 + 2O2 &-> 2H2O + CO2}

        \cee{H2O2 + H2 &-> 3H2O}\\
        \cee{2C2H6 + 7O2 -> 4CO2 + 6H2O}

    C = D

This works perfectly, preserving the correct last value of the equation counter, while working well with the reaction counter too.

Sorry for the wall-o-code. I couldn't figure out how to post a MWE (new to the forum).

I hope this helps people. And if someone can find a better way to implement this, let me know!

EDIT: This is the hard way to go about this. See comments above for more efficient options.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.