# [Ipe-discuss] Minted environment for code highlighting in IPE

Lluís Alemany-Puig lluis.alemany.puig at upc.edu
Thu Apr 29 20:24:48 CEST 2021

Hello all,

I am preparing a talk for which I need to put code in my slides. I
thought I would try IPE but I ran into problems soon after I started
making the presentation. I'm using the minted environment in order to
put code in the slides, mostly so that I can copy and paste the latex
code that I already have somewhere in the document on which I'm basing
the presentation, and I would like to stick to it. A minimal working
example of what I'm using is this:

\documentclass{article}
\usepackage{minted}
\usepackage{tcolorbox}
\BeforeBeginEnvironment{minted}{\begin{tcolorbox}}
\AfterEndEnvironment{minted}{\end{tcolorbox}}
\begin{document}
\begin{minted}{python}
var = 3 # this is a comment
print(var)
\end{minted}
\end{document}

In order to compile this we have to pass the -shell-escape flag to
pdflatex, like so:

pdflatex -shell-espace main.tex

Does anyone know how I can do this in IPE? I mean, how do I pass the
-shell-escape flag to pdflatex?

Thanks a lot!

Lluís Alemany.



More information about the Ipe-discuss mailing list