20

I'm working on the Chemwiki Dynamic Textbook Project at UC Davis, California and I've run into a problem. I need to formulate a symbol containing double harpoons (as in a reversible reaction, e.g. \rightleftharpoons); however, I need to have text both above and below the harpoons. I have an image I can email, but I can't post with an image because I'm new to this.

I can find code for \overleftrightarrow and \underleftrightarrow, but that's not quite what I need. I need both, on the same expression. If anyone has a minute to help me, I would greatly appreciate it!

2

4 Answers 4

31

You could use the features provided by the mhchem package. A little example, taken from the package documentation:

\documentclass{article}
\usepackage{mhchem}

\begin{document}

\ce{
Zn^2+
<=>[\ce{+ 2OH-}][\ce{+ 2H+}]
$\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$
<=>[\ce{+2OH-}][\ce{+ 2H+}]
$\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$
}

\end{document}

The result:

1
  • I think there is a typo in the last line: It should be "\ce{[Zn(OH)4]^2-}", right?
    – user408858
    Mar 9, 2022 at 19:11
17
\documentclass{article}
\usepackage{mathtools}
\begin{document}

$\mathrm{A} \xrightleftharpoons[k_2]{k_1} \mathrm{B}$

\end{document}
4
  • Welcome, can you please extend your answer to cover the duplicate suggested under the question?
    – percusse
    Jul 2, 2014 at 23:49
  • done. I replaced \rightleftharpoons with \xrightleftharpoons. Jul 5, 2014 at 17:55
  • \rm was deprecated around twenty years ago. It's not part of the LaTeX commands.
    – Manuel
    Jul 5, 2014 at 19:12
  • Yes, I know. It still works, though, and it's shorter than \mathrm but point taken. I edited my response. Jul 7, 2014 at 19:50
11

A simple one-line solution which worked for me was:

X \underset{k_2}{\stackrel{k_1}{\rightleftharpoons}} Y

enter image description here

But the harpoon arrows don't extend when the text above and below is longer.

7

An alternative to mhchem would be the chemmacros bundle (including chemformula) by our user @cgnieder.

The syntax is simple and (pretty) intuitive, in many ways similar to the syntax of mhchem.

Here is a minimal example and the output.

\documentclass[border=10pt]{standalone}
\usepackage{chemformula}%loaded by chemmacros
\begin{document}
\ch{Zn^2+ 
<>[ + 2 OH- ][ + 2 H+ ]%Reaction in both directions
!(amphoteres~Hydroxid)( Zn(OH)2 v )
<=>[ + 2 OH- ][ + 2 H+ ]%Equilibrium arrow
!(Hydroxozikat)( [Zn(OH)4]^2- )
}
\end{document}![chemmacros output][1]

There is much more handy stuff in the bundle. Check out the documentation for more or the blog of the author.

You must log in to answer this question.