LaTeX2Markdown

An AMS-LaTeX compatible converter that maps a subset of LaTeX to Markdown/MathJaX
Download

LaTeX2Markdown Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Other/Proprietary Li...
  • Price:
  • FREE
  • Publisher Name:
  • Andrew Tulloch
  • Publisher web site:
  • https://github.com/ajtulloch/

LaTeX2Markdown Tags


LaTeX2Markdown Description

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.DemonstrationCheck out tullo.ch/projects/LaTeX2Markdown for a live demonstration of the converter.Getting StartedInstallationThe project is available on PyPI, so getting it is as simple as usingpip install latex2markdownoreasy_install latex2markdownUsageThe 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 latex2markdown.py path/to/latex/file path/to/output/markdown/fileFor example, to compile the example LaTeX document, callpython latex2markdown.py examples/latex_sample.tex markdown_example.texTo use it within a Python script, use it as follows:import latex2markdownwith open("latex_file.tex", "r") as f: latex_string = f.read()l2m = latex2markdown.LaTeX2Markdown(latex_string)markdown_string = l2m.to_markdown()with open("markdown_file.md", "w") as f: f.write(markdown_string)Finally, add the following snippet to your HTML when loading this document.< script type="text/x-mathjax-config" > MathJax.Hub.Config({ extensions: , jax: , tex2jax: { inlineMath: , ], displayMath: , "] ], processEscapes: true }, });< /scrip t>< script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" > < /script >For a working example, have a look at the source of the tullo.ch homepage here.Product's homepage


LaTeX2Markdown Related Software