简体   繁体   中英

Is there a way to use latex expression of chemarr for `gitbook` format of bookdown package?

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.

PDF-乳胶

On the other hand, for gitbook format there is an error message.

gitbook-乳胶

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)?

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 ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM