0.2.1 Other/Proprietary License
  not rated
An AMS-LaTeX compatible converter that maps a subset of LaTeX to Markdown/MathJaX




LaTeX2Markdown is an AMS-LaTeX compatible converter from (a subset of) LaTeX to MathJaX compatible Markdown.

Who should use this?

Anyone who writes LaTeX documents using the AMS-LaTeX packages (amsmath, amsthm, amssymb) and wants to convert these documents to Markdown format to use with MathJaX. The outputted Markdown files can then be easily added to any web platform - Jekyll blogs, Wordpress, basic HTML sites, etc.

In short, if you seek to use MathJaX to view your LaTeX documents online, then you might be interested in this.


Check out for a live demonstration of the converter.

Getting Started


The project is available on PyPI, so getting it is as simple as using

pip install latex2markdown


easy_install latex2markdown


The utility can be called from the command line, or from within a Python script.

For the command line, the syntax to convert a LaTeX file to a Markdown file is as follows:

python path/to/latex/file path/to/output/markdown/file

For example, to compile the example LaTeX document, call

python examples/latex_sample.tex markdown_example.tex

To use it within a Python script, use it as follows:

import latex2markdown
with open("latex_file.tex", "r") as f:
 latex_string =

l2m = latex2markdown.LaTeX2Markdown(latex_string)

markdown_string = l2m.to_markdown()

with open("", "w") as f:

Finally, add the following snippet to your HTML when loading this document.

< script type="text/x-mathjax-config" >
 extensions: ["tex2jax.js", "AMSmath.js"],
 jax: ["input/TeX", "output/HTML-CSS"],
 tex2jax: {
 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
 displayMath: [ ['$$','$$'], ["\[","\]"] ],
 processEscapes: true
< /scrip t>
< script type="text/javascript" src="" >
< /script >

For a working example, have a look at the source of the homepage here.
Last updated on April 2nd, 2012

0 User reviews so far.