Skip to content

Removes all user-defined macros in a .tex file and substitutes back in definitions. Helpful for pre-processing LaTeX source code to train NLP models.

Notifications You must be signed in to change notification settings

JamesMcGreivy/expand-latex-macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Removes all user-defined macros -- \newcommand or \def -- in latex_source.tex and substitutes back in their raw definition. Helpful for pre-processing LaTeX source before training NLP models.

pip install expand-latex-macros
import expand_latex_macros

latex_source = open("path/to/latex_source.tex").read()
expand_latex_macros.expand_latex_macros(latex_source)

About

Removes all user-defined macros in a .tex file and substitutes back in definitions. Helpful for pre-processing LaTeX source code to train NLP models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages