Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 823 Bytes

README.md

File metadata and controls

35 lines (26 loc) · 823 Bytes

depygmentize

It inlines the highlighted code from the minted package. The resulting tex file can be compiled without the shell-escape option. Which can be necessary if, for instance, the tex file must be compiled on the editor's servers.

Also it can greatly reduce compile times.

Usage

python3 depygmentize.py -i main.tex -o final.tex -l coq

looks for

\usepackage{minted}
\newminted{coq}{fontsize=\\footnotesize,mathescape}

and replaces all occurences of

\begin{coqcode}
...
\end{coqcode}

by the highlighting tex code generated by pygments.

Other options

-m x changes the name of the defined macro in \newminted{x}. By default it is the same as -l.

-p x changes the name of file that minted uses to define its macros. By default it is pygments_prelude.tex.