I've been working on a set of slides in beamer, and one feature I really like as I'm learning is alert. In one part of my presentation, I have a relatively complex bit of code that's 12 lines long that I'm displaying with minted. Is there some sort of way to highlight separate parts of the code so that I can go over them one at a time? For example, in this example:
\documentclass{beamer}
\usetheme{Madrid}
\usepackage[cache=false]{minted}
\begin{document}
\begin{frame}
\frametitle{Slide with Alerts}
\begin{itemize}
\item<alert@1> First Slide
\item<alert@2> Second Slide
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Camera}
\begin{minted}{python}{
class Example:
def init(self, x, y, z):
self.length = x ** 2 + y ** 2 + z ** 2
self.slope = z / (x ** 2 + y ** 2)
\end{minted}
\end{frame}
\end{document}
both bullet points are shown on each of the first two slides, but each one is highlighted separately. Is it possible to do something similar with the code in the next frame? Highlighting sets of lines separately, while showing the whole thing? Right now the best I can see is using the escapeinside option and manually highlighting it, but I'd like to take advantage of beamer's abilities, if possible.
minted(by adding background color on the whole line) is achievable with itshighlightlinesoption. But if what you want is beamer overlay, then I'm afraid there is no such ready-made utility. Similar questions: Beamer vs. Minted: overlays (asked in 2011), Minted in beamer overlays (asked in 2017 and answered by one of beamer maintainers). – muzimuzhi Z Dec 24 '20 at 06:12