1

Actually I’m working on some pascal documentation but I noticed that some features that need escapeinside option did not work well. Surprisingly, when I changed the language (to phyton or another) and all things are fine.

Here my MWE

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{minted}
\usepackage{xcolor}
\usepackage{graphics}
\usepackage[most]{tcolorbox}

% source: tcolorbox package (p. 16)
\newtcbox{\mybox}[1][red]{on line,
    arc=0pt,outer arc=0pt,colback=#1!10!white,colframe=#1!50!black,
    boxsep=0pt,left=1pt,right=1pt,top=2pt,bottom=2pt,
    boxrule=0pt,bottomrule=1pt,toprule=1pt}

\begin{document}

% source: minted package (p. 22)
\noindent phyton code
\begin{minted}[escapeinside=??]{py}
def f(x):
    y = x?\colorbox{green}{**}?2
    y = x?\mybox[green]{**}?2
return y
\end{minted}

\noindent pascal code
\begin{minted}[escapeinside=??]{pascal}
    a ?\colorbox{green}{:=}? b + c
    a ?\mybox[green]{:=}? b + c
\end{minted}

\end{document}

The result is

enter image description here

  • 1
    The documentation of minted about escapeinside mentions that it is fragile with some Pygmentize lexers. – egreg Oct 3 '16 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.