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!

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036

4 Answers4

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:

Gonzalo Medina
  • 505,128
17
\documentclass{article}
\usepackage{mathtools}
\begin{document}

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

\end{document}
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.

Johannes_B
  • 24,235
  • 10
  • 93
  • 248