0

For my chemistry course, our lab-leader insists that we use roman numerals for the numbering of reaction equations, and arabic numerals for the numbering of mathematical equations. So when I write

\begin{equation}

some reaction equation

\end{equation}

I would like LaTeX to use roman numerals to number the equation, and I would like them to follow a counter different from the counter for the arabic numerals. Can I customize it in this way, or if it's difficult, how could I do it manually?

Also, I would like the mathematical equations to be numbered, for instance,(1-1) instead of (1)when it's the first mathematical equation of section 1. How can I do that?

  • This post covers the use of Roman numerals: tex.stackexchange.com/questions/63138/… And this article covers numbering, though the format is "1.1" as opposed to "1-1": en.wikibooks.org/wiki/LaTeX/… – J.D. Oct 2 '16 at 13:06
  • This would use different counters, I suppose? – Bernard Oct 2 '16 at 13:18
  • Please clarify if different counters are to be used for reaction equations and "ordinary" equations. – Mico Oct 2 '16 at 13:19
  • @Bernard Yes, I forgot to specify that. I've edited the post now. – Auclair Oct 2 '16 at 13:57
1

In the following example I use the reaction environment as given by Martin H. to question 11456 and I changed to Roman the numbering.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{chemfig,chemmacros}
\usepackage[version=3]{mhchem}
\usepackage{enumitem}
\newcounter{tmp}
\renewenvironment{reaction}[1][\relax]{%
\setcounter{tmp}{\value{equation}}
\setcounter{equation}{\value{reaction}}
\renewcommand{\theequation}{\Roman{equation}}
\begin{equation}
\addcontentsline{rxs}{reactions}{\protect\numberline{\thereaction}#1}
}{%
\end{equation}
\setcounter{reaction}{\value{equation}}
\setcounter{equation}{\value{tmp}}
}

\begin{document}
In this exemple mathematical equations are numbered with arabic numbers
\begin{equation}
\rho_A(\mathbf r) = \int\hat A(\mathbf r,\mathbf p)F(\mathbf r,\mathbf
p)d\mathbf p
\label{eq:odp}
\end{equation}
where $\hat A(\mathbf r,\mathbf p)$ is a one electron operator and
$F(\mathbf{r, p})$ the joint distribution of position and momentum.
\begin{equation}
\rho_A(\mathbf r)= A(\mathbf r)\rho(\mathbf r) \label{ref:eq21}
\end{equation}
and chemical equations with capital roman letters
\begin{reaction}
\ce{CH4 + 2O2 -> CO2 + 2H2O}
\end{reaction}
\begin{equation}
\langle \hat A\rangle_{\Omega_I}=\int\limits_{\Omega_I} \rho_A(\mathbf r)
d\mathbf r
\end{equation}

\begin{reaction}
\ce{ SO4^2- + Ba^2+ -> BaSO4 v}
\end{reaction}
\end{document}
  • Great, thanks. I actually "solved" it, meaning it looks the way I want it to now. But your solution is probably better, I'll try it out. – Auclair Oct 2 '16 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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