I cannot find a way to apply \only<n>{content}
to a whole itemize environment.
My first approach was:
\only<1>{\begin{itemize}
\item A
\end{itemize}}
But I get multiple error messages at compile time. I have also tried multiple variations found on the web. But I cannot find a way of hide (not occupying space) the whole list.
EDIT:
Here a minimum non-working example, after reading the comment of @Schrödinger's cat I realized that the problem arises when I use the lstMakeShortInline, in this case, |First|
. Without it, it works.
\documentclass{beamer}
\usepackage{listings}
\lstMakeShortInline[language=C,basicstyle=\ttfamily]|
\begin{document}
\begin{frame}[fragile]{Title}
\begin{columns}[T]
\column{0.55\textwidth}
\column{0.45\textwidth}
\only<1>{
\begin{itemize}
\item My code: |First|
\end{itemize}
}
\only<2>{
\begin{itemize}
\item Second
\end{itemize}
}
\end{columns}
\end{frame}
\end{document}
\documentclass{beamer} \begin{document} \begin{frame}[t] \frametitle{Test} \only<1>{\begin{itemize} \item A \end{itemize}} \pause \only<2>{\begin{itemize} \item B \end{itemize}} \end{frame} \end{document}
works fine.\only
and thelisting
package.