Skip to content

streamich/asciimath2tex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asciimath2tex

JavaScript library to convert AsciiMath to TeX.

I wrote this so I could use KaTeX to render AsciiMath.

Usage

The library is written as an ECMAScript module. As of the end of 2017, support for those in browsers is limited, so I plan to run it through babel to get a browser-usable version.

However, in environments where modules are supported, usage goes like this:

import AsciiMathParser from './asciimath2tex.js';

const parser = new AsciiMathParser();
const tex = parser.parse("int_(i=1)^10 x^2/2 dx");

parser.parse returns a string of TeX.

Tests

There are some unit tests in test.html, copied from the asciimath repository.

All of the tests are rendered correctly by KaTeX, apart from \twoheadrightarrowtail, which it apparently doesn't support.

About

JavaScript library to convert AsciiMath to TeX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.7%
  • HTML 2.3%