7

I'm trying to write a chemical equation with k_f and k_b (in math mode) above and below a double harpoon, respectively. I wrote the following code, which uses the chemmacros package:

\begin{equation}
\sum_{s=1}^{N_s}\nu'_s \ch{X}_s  \ch{<=>[$k_f$][$k_b$]}   \sum_{s=1}^{N_s}\nu''_s \ch{X}_s 
\label{eq:chemical_reaction_f_b}
\end{equation}

The result is the following:

enter image description here

As you can see, the f and b in the two k letters aren't in subscript as desired. How can I correct this?

  • Did any errors get reported in the log? Specifically regarding math mode? – barbara beeton Aug 28 at 17:01
  • 3
    add blank spaces \ch{<=>[ $k_f$ ][ $k_b$ ]} – polyn Aug 28 at 21:54
  • @polyn it indeed also works. – Élio Pereira Aug 29 at 9:57
10

The processing of the arrow arguments somehow interferes with math mode. A workaround is to define two small macros that hide the content long enough to be processed normally:

\documentclass{article}
\usepackage{chemmacros}
\def\kf{k_f}
\def\kb{k_b}
\begin{document}
\begin{equation}
\sum_{s=1}^{N_s}\nu'_s \ch{X}_s  \ch{<=>[$\kf$][$\kb$]}   \sum_{s=1}^{N_s}\nu''_s \ch{X}_s 
\end{equation}
\end{document}

enter image description here

It's of course not ideal but if you don't need a lot of different variable-subscript combinations then it may be an acceptable solution.

5

Strictly speaking, this expression isn't an equation; rather, it's a reaction (a definition of a generic elementary reaction in chemical kinetics, to be precise). I think using labeled reaction environment from chemmacros's reactions module suits this case much better: this way one can also address it later both in text and in the list of reactions.

As for the troubles with math inside the chemical environment, chemformula's manual covers this case well (this has also been mentioned by polyn in the comments):

8.2. Math

If you especially want to input math you just enclose it with $ $. This output is different from the escaped text as it is followed by a space. The reasoning behind this is that I assume math will mostly be used to replace stoichiometric factors.

\ch{ $⟨escaped math⟩$ }
One of two possibilities to escape chemformula’s parsing into math mode.

\ch{ \(⟨escaped math⟩\) }
The second of two possibilities to escape chemformula’s parsing into math mode.

Additionally, I would use roman typeface for the textual subscripts instead of italics, and also denote forward and reverse rates with more common notations used in kinetics: k_fwd and k_rev instead of k_f and k_b, correspondingly. The subscript "f", for instance, is ambiguous and denotes "formation" or "fusion" in physical chemistry.

enter image description here

\documentclass[12pt]{article}
\usepackage{chemmacros}
    \chemsetup{modules=all}

\begin{document}

\begin{reaction}
    $\sum_{s=1}^{N\sb{s}}\nu'_s$ X_{$s$} 
    <=>[ $k_\mathrm{fwd}$ ][ $k_\mathrm{rev}$ ]
    $\sum_{s=1}^{N\sb{s}}\nu''_s$ X_{$s$}
    "\label{rxn:generic-kinetic-model}"
\end{reaction}

Reaction \ref{rxn:generic-kinetic-model} is elementary.

\listofreactions

\end{document}

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.