LoginSignup
2
0

More than 3 years have passed since last update.

お知らせ: KaTeXにmhchemがやってくる

Last updated at Posted at 2018-12-14

さて、2018年11月25日 8:52 JSTに新たにKaTeXにmergeされたpluginがある。mhchemだ。

mhchemというのは

$\ce{CO2 + C -> 2 CO}$

のように書くと

$\mathrm{CO}_{2} + \mathrm{C} \rightarrow 2\mathrm{CO}$

のように変換してくれる、化学徒の強い味方である。

$\mathrm{CO}_{2} + \mathrm{C} \rightarrow 2\mathrm{CO}$

と比べれば書きやすさは一目瞭然である(Qiitaでmhchemが使えないので頑張って再現した)

\ce\puが追加される。マニュアルは

にある。もっといろいろできることがわかる。

もともとMathJax向けに実装されていたのをKaTeX

現在KaTeXは0.10.0が最新だが、これには含まれていない(0.10.0が出たのが2018年10月29日 13:23 JSTだからそれはそう)。次のReleaseまで待てない人は

を各自サーバーに置いて試すと良い(伝統と信頼のcdn.jsdelivr.netsさんから持ってこれないか画策したがうまくいかない)。

追記

そういえばKaTeX0.10.1で取り込まれましたので

<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mhchem.min.js" integrity="sha384-oa0lfxCGjaU1LdYckhq8LZcP+JTf8cyJXe69O6VE6UrShzWveT6KiCElJrck/stm" crossorigin="anonymous"></script>

を追記すればいいと思います。

License

CC BY 4.0

CC-BY icon.svg

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0