# Is there a way to write rightleftharpoons with something above and below, while still keeping rightleftharpoons on the same line as the rest of the text? This would be useful for equilibrium reactions and kinetics.

Sep 29, 2015

For example:

${N}_{2} {O}_{5} \text{ " stackrel(k_1)(stackrel(rightleftharpoons)(k_(-1))) " } N {O}_{2} + N {O}_{3}$

Where ${k}_{1}$ would be the rate constant for the forward reaction, and ${k}_{- 1}$ would be for the backwards reaction. Instead of stacking two things on top of one, I think it would be easier to have a way to stack something above and below a specific character.

Maybe a notation like this, with colon-separated above/below stacking:

stk([text above] : [text below])(rightleftharpoons)

EDIT:

Testing!

$\text{Alkene" stackrel(" "H_2)(" "->) " Alkane}$
$\textcolor{w h i t e}{\text{aaaaaaaaa" ""^"Pd/C}}$

$\text{Alkyl Halide" stackrel(" ""t-buOK")(" "->) " Elimination Product}$
color(white)"aaaaaaaaaaaaaa" ""^("t-buOH", Delta)

$\text{Cis" stackrel(k_1)(rightleftharpoons) "Trans}$
${\textcolor{w h i t e}{\text{a"" }}}^{{k}_{- 1}}$

Sep 29, 2015

Here's what I could come up with.

#### Explanation:

A far as I know, there are no predefined functions that allow you to stack three characters on top of each other.

However, like with most interesting things in life, you can bypass that problem.

I have two hacks that could be used in such situations. It's worth mentioning that neither one is perfect, but I think that they both get the job done.

Here's how the first one looks

This basically consists of two stackrel()() funsctions used one on top of the other, i.e. on consecutive code lines. Here's what the framework looks like

• without the hashtags

"A " + "B " stackrel(k_1)(rightleftharpoons) " C" + " D"#
color(white)("aaaaaaaa")stackrel(""^(k_(-1)))(color(white)(x))

• with the hashtags

$\text{A " + "B " stackrel(k_1)(rightleftharpoons) " C" + " D}$
$\textcolor{w h i t e}{{\text{aaaaaaaa")stackrel(}}^{{k}_{- 1}}} \left(\textcolor{w h i t e}{x}\right)$

You could tweak it and maybe make use ${k}_{1}$ as an exponent in the first stackrel function to get something like this

$\text{A " + " B " stackrel(""^(k_1))(rightleftharpoons) " C" + " D}$
$\textcolor{w h i t e}{{\text{aaaaaaaaa")stackrel(}}^{{k}_{- 1}}} \left(\textcolor{w h i t e}{x}\right)$

In this version, the rate constants are alligned better with the "rightleftharpoons" symbol.

The second one is based on a matrix. My starting template was

$\left(\begin{matrix}0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0\end{matrix}\right)$

Then I replaced every value that shouldn't be visible with color(white)(0)

$\left(\begin{matrix}\textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & 0 & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & 0 & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0}\end{matrix}\right)$

Finally, I replaced what's left with the characters I need for the reaction - and boom!

$\left.\begin{matrix}\textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} {k}_{\text{1}} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} \\ A & + & B & r i g h t \le f t h a r p \infty n s & C & + & D \\ \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & {k}_{- 1} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0} & \textcolor{w h i t e}{0}\end{matrix}\right.$