Skip to content

convert \ce notation to latex ready to be used with katex

Notifications You must be signed in to change notification settings

brunovcosta/mchem4katex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

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.

About

convert \ce notation to latex ready to be used with katex

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages