jlcode icon indicating copy to clipboard operation
jlcode copied to clipboard

interaction with beamer overlays

Open BeastyBlacksmith opened this issue 2 years ago • 3 comments

usually you can specify to show environments on certain beamer overlays with

\begin{env}<2->
\end{env}

for showing that only at the second overlay. However, this doesn't seem to work with jllisting.

BeastyBlacksmith avatar Apr 20 '23 12:04 BeastyBlacksmith

Could you maybe create a MWE which I can run myself so that I can have a closer look ath this issue?

wg030 avatar Apr 20 '23 13:04 wg030

\documentclass{beamer}

\usepackage{jlcode}

\begin{document}

\begin{frame}[fragile]

\begin{jllisting}<1>
Hello
\end{jllisting}

\begin{jllisting}<2>
World
\end{jllisting}
% shows both
\end{frame}

\begin{frame}[fragile]

\onslide<2>{
\begin{jllisting}
Hello
\end{jllisting}
} % errors

\end{frame}

\end{document}

BeastyBlacksmith avatar Apr 20 '23 14:04 BeastyBlacksmith

Thank you for the MWE.

I had a quick look at the problem and I figured out that this problem does not seem to be a problem of the jlcode package specifically, but rather a problem of the listings package in general. That's because testing the code

\documentclass{beamer}

\usepackage{listings}

\begin{document}

\begin{frame}[fragile]

\begin{lstlisting}<1>
Hello
\end{lstlisting}

\begin{lstlisting}<2>
World
\end{lstlisting}
% shows both
\end{frame}

\begin{frame}[fragile]

\onslide<2>{
\begin{lstlisting}
Hello
\end{lstlisting}
} % errors

\end{frame}

\end{document}

yields exactly the same problem. Hence I cannot really help you here I guess. ☹️

wg030 avatar Apr 21 '23 06:04 wg030