Skip to content

AsciiMath to TeX math converter using ANTLR4

Notifications You must be signed in to change notification settings

rand-asswad/am2t

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AsciiMath to TeX

Setup AM2T

Download ANTLR v4 JAR into lib/:

wget --directory-prefix=lib/ https://www.antlr.org/download/antlr-4.7.2-complete.jar

Generate ANTLR classes from grammar and compile AM2T

make compile

Use AM2T

Create AsciiMath test file:

mkdir test
echo "e^x = lim_(n->oo) (1+x/n)^n" > test/exp.txt

Test program with given file (make sure am2t script is executable)

chmod +x am2t
./am2t -i test/exp.txt

This generates latex math test/exp.katex and a parsing tree png file test/exp.png.

Learn about am2t script usage by passing it with the good'ol -h argument.

Enjoy!