1

I want to use \onslide<2-> with verbatim environment inside in beamer, e.g.:

\onslide<2->{
\verb+foo+
}

This does not work due to overlays and verbatim conflicts... I found out that there is a onlyenv environment that fixes the issue for \only but I cannot find anything for \onslide.

Is there some equivalent to onlyenv for onslide?

0

According to, e.g., this answer: Uncover lstlisting on a particular slide using \onslide or \uncover, there is no such equivalent, and I also could not find any. You can user \onlyenv with an overlayarea environment to avoid jumps due to overlay animations. This however forces you to initially fix the dimensions of the animated area, which you don't have to when you're using \onslide...

I sometimes resort to creating overlays with external programs. My currently preferred solution is Inkscape + the TexText plugin + this script I developed which crates you several PDF from layer specifications and provides you with a snippet to include in your LaTeX file. Sometimes it's just nice to have a graphical editor, even when you like to use LaTeX.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.