我想对 gitbook
使用 chemarr 的 latex 表达bookdown 包的格式。
\begin{equation}
[C] + [R]
\xrightleftharpoons[k_{-1}]{k_1}
[CR] + [C]
\xrightleftharpoons[k_{-2}]{k_2}
[C2R]
(\#eq:multiplebinding)
\end{equation}
对于 PDF 格式,显示方程没有问题。另一方面,对于 gitbook 格式,有一条错误消息。
这主要是因为我无法为
gitbook
定义以下 yaml header 格式。header-includes:
- \usepackage{chemarr}
有没有办法使用 chemarr 的 latex 表达 gitbook
bookdown 包的格式?如果不可能,有没有办法使用include_graphics
函数并添加方程编号(例如,在本例中为 19.16)?
最佳答案
谢一辉已经给出了很好的解决方案:
将此代码放入您的文档(您希望方程式出现的位置):
$$
\require{mhchem}
\begin{equation}
[C] + [R]
\xrightleftharpoons[k_{-1}]{k_1}
[CR] + [C]
\xrightleftharpoons[k_{-2}]{k_2}
[C2R]
(\#eq:multiplebinding)
\end{equation}
$$
需要使用mhchem
的箭头而不是 chemarr
因为只有第一个是 MathJax 的一部分。但我认为无论如何它应该基本相同。此方法适用于 MathJax ( http://docs.mathjax.org/en/latest/input/tex/macros/index.html ) 支持的所有 Latex 命令。
关于r - 有没有办法将 chemarr 的 latex 表达式用于 `gitbook` 格式的 bookdown 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63516359/