0

The following example works fine:

\begin{frame}[fragile]
  \begin{columns}
    \column{.5\textwidth}
    \begin{itemize}[<+->]
    \item First
    \item Second
    \end{itemize}
    \column{.5\textwidth}
    \visible<3>{
      Third
      }
  \end{columns}
\end{frame}

However, I've tried to set Third as a verbatim text. With

\begin{frame}[fragile]
  \begin{columns}
    \column{.5\textwidth}
    \begin{itemize}[<+->]
    \item First
    \item Second
    \end{itemize}
    \column{.5\textwidth}
    \visible<3>{
\begin{verbatim}
      Third
\end{verbatim}
      }
  \end{columns}
\end{frame}

it can't be compiled. I've got an error message:

Runaway argument?
  \end{columns}rbatim} \beamer@endinvisible 
! File ended while scanning use of \@xverbatim.
<inserted text> 
\par 
l.17 \end{frame}

However, the following is compiling, but it results in summary of four overlays, but it should have only three (overlays two and three are identical):

\begin{frame}[fragile]
  \begin{columns}
    \column{.5\textwidth}
    \begin{itemize}[<+->]
    \item First
    \item Second
    \end{itemize}
    \column{.5\textwidth}
    \pause
\begin{verbatim}
      Third
\end{verbatim}
  \end{columns}
\end{frame}
Micha
  • 2,869
  • 1
    \begin{onlyenv}<3> \begin{verbatim} Third \end{verbatim} \end{onlyenv} works (there is probably a duplicate question somewhere, I'll take a look). – Marijn Mar 12 '20 at 10:58
  • Sort of a mix between https://tex.stackexchange.com/questions/250958/changing-verbatim-input-in-beamer-slide and https://tex.stackexchange.com/questions/223787/beamer-overlays-with-tikz-nodes-break-verbatim-whitespace-handling/, I guess this one can stay open. – Marijn Mar 12 '20 at 11:45

1 Answers1

0
\begin{frame}[fragile]
  \begin{columns}
    \column{.5\textwidth}
    \begin{itemize}[<+->]
    \item First
    \item Second
    \end{itemize}
    \column{.5\textwidth}
    \begin{visibleenv}<3>
\begin{verbatim}
      Third
\end{verbatim}
    \end{visibleenv}
  \end{columns}
\end{frame}
Micha
  • 2,869