I'm using minted to highlight some code. With the escapeinside
I can add custom LaTeX code. For example:
\begin{minted}[escapeinside=||]{py}
def f(x):
y = x|\colorbox{green}{**}|2
return y
\end{minted}
now I'd like to add an efect to the beamer frame:
- show the code without the colorbox
- advance the presentation
- show the code with the colorbox
that would be a typical beamer transition modifier like <2->
.
Trying to merge both features I tried:
...
y = x|<2->\colorbox{green}{**}|2
...
but it didn't worked: the <2->
was rendered as it.
Is it possible to add some effects like <2->
or \pause
or equivalent inside a minted environment?
\colorbox{green}
work? If yes you could simply use a custom colour and redefine it from white to green between the overlay.\colorbox{}
works. The text is rendered highlighted and the**
is enclosed in a green box.