0

I have written a document describing a Python module and used minted with pygmentize. I have now hit an unexpected roadblock, as I need to hand control of the document to my company's publishing department for final formatting. That department has LaTeX but not Python and so I do not think they can install pygmentize, which requires Python.

Before abandoning minted and formatting a different way, I'm wondering if there's a way I can prepare the document so that they can compile it (assuming no changes to the code).

For example, if I had a .pygtex file for an inline compilation that said something like \mintedinline{python}|hello_world|:

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{hello\PYGZus{}world}
\end{Verbatim}

Is there a way to put that into my document instead?

What about something like,

\begin{minted}{python}
print(p.__dict__())
#{
# 'lat': 90.0,
# 'lon': 0.0
}
\end{minted}

which creates the file

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{p}\PYG{o}{.}\PYG{n+nv+vm}{\PYGZus{}\PYGZus{}dict\PYGZus{}\PYGZus{}}\PYG{p}{())}
\PYG{c+c1}{\PYGZsh{}\PYGZob{}}
\PYG{c+c1}{\PYGZsh{} \PYGZsq{}lat\PYGZsq{}: 90.0,}
\PYG{c+c1}{\PYGZsh{} \PYGZsq{}lon\PYGZsq{}: 0.0}
\PYG{c+c1}{\PYGZsh{}\PYGZcb{}}
\end{Verbatim}

I believe that the list as ordered in the .aux file gives the order that they are used in the document (some are used more than once), so I could identify the.pygtex file that needs to be used at each location, but I can't figure out how to insert and compile the information.

ramzeek
  • 197
  • 6

0 Answers0