I would like to use latex expression of chemarr for gitbook
format of bookdown package.
\begin{equation}
[C] + [R]
\xrightleftharpoons[k_{-1}]{k_1}
[CR] + [C]
\xrightleftharpoons[k_{-2}]{k_2}
[C2R]
(\#eq:multiplebinding)
\end{equation}
For PDF format, there is no problem of displaying the equation.
On the other hand, for gitbook format there is an error message.
It's mainly because I cannot define the following yaml header for gitbook
format.
header-includes:
- \usepackage{chemarr}
Is there a way to use latex expression of chemarr for gitbook
format of bookdown package? If it's impossible, is there a way to use include_graphics
function and add equation numbering (say, 19.16 in this example)?
As of rmarkdown version 1.4 it has been possible to use the extra_dependencies parameter to list a character vector of LaTeX packages. This is useful if you need to load multiple packages:
How do you use summation (∑) in LaTeX? LaTeX provides us with the default or amsmath package which gives us commands to beautifully typeset summations. In this article, we shall explore the various commands to typeset summations with numerous examples. In mathematics, summation is denoted by the Greek capital letter sigma (∑).
Bookdown introduces some additional functionality on top of R Markdown that makes it particularly useful for writing a thesis. You can automatically handle all the numbering of your sections, figures, and tables with bookdown, as well as automatically generating contents pages, and lists of tables and figures.
For PhD students who might want to use bookdown for their thesis I’d strongly recommend using markdown for any analysis reports or papers you write along the way. Markdown has many benefits by itself, and using it also sets you up nicely to use bookdown for your thesis. Why bookdown?
Yihui Xie already gave a good hint to the solution:
Put this code into your document (where you want the equation to appear):
$$
\require{mhchem}
\begin{equation}
[C] + [R]
\xrightleftharpoons[k_{-1}]{k_1}
[CR] + [C]
\xrightleftharpoons[k_{-2}]{k_2}
[C2R]
(\#eq:multiplebinding)
\end{equation}
$$
Needs to use the arrow of mhchem
instead of chemarr
since only the first is part of MathJax. But I think it should anyway be basically the same.
This method should work for all Latex commands supported by MathJax (http://docs.mathjax.org/en/latest/input/tex/macros/index.html).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With