Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 608 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 608 Bytes

mchem4katex

This project is an simple adaptation of mhchem/MathJax-mhchem to be used with Khan/KaTeX.

Usage

var latex = mchem.parse("C6H12O + O2 -> CO2 + H2O");
console.log(katex.renderToString(latex));

adaptations:

remove spaces "\vphantom","\hphantom","\mathrel" -> "" "\mkern*","\mskip*" -> "\ "

remove long from arrows "\long*" -> "\*"

replacing xrightarrow and alike with arrays

TODO

Refine spacing details.

Warning

This is not intended to be an official Mchem support to KaTeX.