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.

2 Answers
Sep 29, 2015

For example:

#N_2O_5 " " stackrel(k_1)(stackrel(rightleftharpoons)(k_(-1))) " " NO_2 + NO_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)



#"Alkene" stackrel(" "H_2)(" "->) " Alkane"#
#color(white)"aaaaaaaaa" ""^"Pd/C"#

#"Alkyl Halide" stackrel(" ""t-buOK")(" "->) " Elimination Product"#
#color(white)"aaaaaaaaaaaaaa" ""^("t-buOH", Delta)#

#"Cis" stackrel(k_1)(rightleftharpoons) "Trans"#
#color(white)"a"" """^(k_(-1))#

Sep 29, 2015

Here's what I could come up with.


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"#

  • with the hashtags

#"A " + "B " stackrel(k_1)(rightleftharpoons) " C" + " D"#

You could tweak it and maybe make use #k_1# as an exponent in the first stackrel function to get something like this

#"A " + " B " stackrel(""^(k_1))(rightleftharpoons) " C" + " D"#

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

#( (0, 0, 0, 0, 0, 0, 0), (1, 1, 1, 1, 1, 1, 1), (0, 0, 0, 0, 0, 0, 0) )#

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

#( (color(white)(0), color(white)(0), color(white)(0), 0, color(white)(0), color(white)(0), color(white)(0)), (1, 1, 1, 1, 1, 1, 1), (color(white)(0), color(white)(0), color(white)(0), 0, color(white)(0), color(white)(0), color(white)(0)) )#

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

#{:(color(white)(0), color(white)(0), color(white)(0), color(white)(0)k_"1", color(white)(0), color(white)(0), color(white)(0)), (A, +, B, rightleftharpoons, C, +, D), (color(white)(0), color(white)(0), color(white)(0), k_(-1), color(white)(0), color(white)(0), color(white)(0)) :}#