Code: Select all
\documentclass{beamer}
\usepackage{listings}
\begin{document}
\begin{frame}[fragile]
\color<2>[rgb]{1,0,0}{% works
\begin{lstlisting}
COLOR
\end{lstlisting}
}
\only<1>{% don't work
\begin{lstlisting}
ONLY
\end{lstlisting}
}
\end{frame}
\end{document}
Code: Select all
Package Listings Warning: Text dropped after begin of listing on input line 11.
)
! Missing } inserted.
<inserted text>
}
l.17 \end{frame}
?