# j2kun/tex-convert-delimiters

A simple demonstration of how to define a parser that converts latex mathmode delimiters
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
convert-delimiters.py Apr 21, 2019
display-parsed-tree.py Apr 21, 2019
regex_converter.sh
requirements.txt Apr 20, 2019
test.tex

# A Working Mathematician's Guide to Parsing

Associated blog post

This scripts requires a working Python installation (version 2 or 3).

To install the parser generator library Lark, run

pip install lark-parser


Then run the script in this repository (either by first copy/pasting its source to a file, or cloning the repository with git):

python convert-delimiters.py < file.tex > output.tex


Example input:

# test.tex
\begin{document}

This is a doc with $math$ in it. $W o W linebreak$

Now we have the following $offset equation$

Now we have another $$offset equation$$ why would you use this one though

\end{document}


Example output:

\begin{document}

This is a doc with $$math$$ in it. $$W o W linebreak$$

Now we have the following $offset equation$

Now we have another $offset equation$ why would you use this one though

\end{document}

You can’t perform that action at this time.