Monday, 26 August 2013

reaction arrows with reaction rates with subscripts in MiKTeX with mhchem and Sphinx

reaction arrows with reaction rates with subscripts in MiKTeX with mhchem
and Sphinx

I am using Sphinx 1.1.3 to document a reaction rate with an underscore.
\ce{A + $h$\nu ->[k_A] B}
It works perfectly when I make html documentation, using MathJax and a
template file containing the following: {% extends "!layout.html" %}
{% block extrahead %}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
extensions: ["mhchem.js"]
}
});
</script>
{% endblock %}
and including the _templates folder in the templates_path of the conf.py
file.
You can see [my mchem_example
here](http://bwanamarko.alwaysdata.net/mhchem_example/mhchem_example.html.
But when I try to build a latexpdf using MiKTeX, with the preamble
\usepackage[version=3]{mhchem} as stated in the mhchem documentation in
the latex_elements dictionary of the conf.py, I don't get the reaction
rate or the arrow. Instead I get something that looks like this.
A + h \nu ->[k_A] B
I know I am doing something wrong, but I have tried many things, such as
enclosing the reaction rate in curly braces, enclosing in $, inserting \ce
before it. The other examples in the mhchem documentation all work, such
as using +H20 or \alpha, so I think it can be done.

No comments:

Post a Comment