Converter from markdown file using KaTeX to .tex files. The conversion is very close to the original markdown file compared to pandoc. A related blog post can be found here.
Install the package when in the root directory (where the setup.py file is), then run:
pip install -e .A variable environnement needs to be created to indicate where the folder md2latex/ is. In your .bashrc or .zshrc:
export MDTOLATEX_HOME=path/to/md2latexTo convert markdown files along with macros defined in KaTeX:
md2latex -f markdown_filename -m macros_filenameA demo is provided in the example/ folder. Go into the folder and execute
md2latex -f example.md -m macros.mdmd2latex uses regex to parse the markdown file and convert the entries to LaTeX. An initial template is given to the python script (template.tex in md2latex/). As of now the following conversions are made:
$$..$$and related toequation,alignenvironments- Lists in
1. 2. 3.are converted toenumerateenvironment,- - -initemizeenvironment - Markdown tables are converted to LaTeX tables
For all these conversions to work the original markdown file must follow the standard markdown format where tables, lists and equations are surrounded by blank lines.