I'm using minted to highlight some code. With the escapeinside I can add custom LaTeX code. For example:

def f(x):
    y = x|\colorbox{green}{**}|2
    return y

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?

  • 1
    You can help us to help you by providing the code for a small document that shows your problem. Just edit your question and add the code. Feb 14, 2017 at 0:09
  • Does the \colorbox{green} work? If yes you could simply use a custom colour and redefine it from white to green between the overlay. Feb 14, 2017 at 0:11
  • @samcarter, the \colorbox{} works. The text is rendered highlighted and the ** is enclosed in a green box.
    – mmoya
    Feb 14, 2017 at 10:02
  • Can you make your code compilabale? This would be a great staring point. Feb 14, 2017 at 10:08
  • I filled a request in GH, check the suggestion there.
    – mmoya
    Mar 2, 2017 at 8:21

1 Answer 1


Instead of trying to bring overlays into minted, maybe redefining the colour between the overlays could be enough:






enter image description here


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .