-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
5,411 additions
and
4,717 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,52 @@ | ||
License | ||
======= | ||
|
||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
Content | ||
======= | ||
|
||
This release contains the following files: | ||
|
||
- README.md: this file. | ||
- TeXZilla.js: TeXZilla parser generated by Jison. | ||
- TeXZilla-min.js: TeXZilla.js minified with Google Closure. | ||
|
||
TeXZilla | ||
======== | ||
|
||
This is a work in progress. See http://fred-wang.github.io/TeXZilla/ for a demo. | ||
This is TeXZilla 0.9, a Javascript TeX-to-MathML converter which is compatible | ||
with Unicode. This is still a work in progress and things may change in the | ||
future. See https://github.com/fred-wang/TeXZilla/issues for known issues. | ||
You can use TeXZilla in a commonJS program: | ||
|
||
var parser = require("./TeXZilla").parser; | ||
console.log(parser.toMathMLString("\\sqrt{\\frac{x}{2}+y}")); | ||
|
||
or from a Web page: | ||
|
||
<script type="text/javascript" src="TeXZilla-min.js"></script> | ||
... | ||
var MathMLElement = TeXZilla.toMathML("\\sqrt{\\frac{x}{2}+y}"); | ||
|
||
Dependencies | ||
----------- | ||
See also http://fred-wang.github.io/TeXZilla/ for a live demo. | ||
|
||
Required to generate `TeXZilla.js`: | ||
The public API is: | ||
|
||
- [coreutils](https://www.gnu.org/software/coreutils/), [sed](https://www.gnu.org/software/sed/), [wget](https://www.gnu.org/software/wget/), [make](https://www.gnu.org/software/make/) | ||
- [xsltproc](http://xmlsoft.org/XSLT/xsltproc2.html) | ||
- [Python](http://www.python.org/) | ||
- [Jison](http://zaach.github.io/jison) and NodeJS. | ||
getTeXSource = function(aMathMLElement) | ||
|
||
Optional: | ||
returns the TeX source attached to aMathMLElement via a semantics annotation | ||
or null if none is found. aMathMLElement is either a string or a MathML DOM | ||
element. | ||
|
||
toMathMLString = function(aTeX, aDisplay, aRTL) | ||
|
||
- To run unit tests: [slimerJS](http://slimerjs.org/) | ||
- To generate the minified version `TeXZilla-min.js`: [Google Closure Compiler](https://developers.google.com/closure/compiler/) and Java. | ||
converts the TeX string aTeX into a MathML source. The optional boolean | ||
aDisplay and aRTL indicates whether the MathML output should be in display | ||
mode and in RTL direction respectively. | ||
|
||
Compiling | ||
--------- | ||
toMathML = function(aTeX, aDisplay, aRTL) | ||
|
||
Update config.cfg and try "make help". | ||
Same as toMathMLString, but returns a MathML DOM element. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.