0.6.2 • Published 7 years ago

latex-parser v0.6.2

Weekly downloads
573
License
MIT
Repository
github
Last release
7 years ago

JavaScript LaTeX parser

npm version Build Status License Code Climate

Live demo in browser

This is a library designed to build abstract syntax trees for LaTeX documents using JavaScript / TypeScript.

⚠ Warning

This project only parses a subset of what can be considered "canonical" LaTeX. As I see it, a full LaTeX parser would be a complete port of the TeX code, and I am not crazy enough to attempt that. Of course, we can still make something that works most of the time. This approach is similar to KaTeX, a Javascript library which focuses on math typesetting. This library focuses more on parsing text mode.

If you don't believe parsing LaTeX is necessarily difficult, prepare to be outsmugged:

Usage

Download the latest standalone JavaScript file (ES5) or install from NPM:

npm install latex-parser
import {latexParser} from "latex-parser";

// tokens :: LaTeX[]
const tokens = latexParser.parse("hello \\author[opt]{name}");

See live demo in browser

Contribute

Pull requests are welcome. If you find a bug or an omission, don't be afraid to open an issue.

History on project

This project used to be a TypeScript fork of the TeXnous project, but after v0.3.0 is modeled after the Haskell LaTeX library HaTeX.

Contact

Inquiries go to maartentrompper@freedom.nl.

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago