beamer add tag
topnush
Why doesn't this render?

```
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamersize{text margin left=10mm,text margin right=5mm} 
\setbeamertemplate{frametitle}[default][center]
\usepackage[many]{tcolorbox}
\usepackage{listings}
\lstdefinestyle{duckstyle}{%
    moredelim=[is][\color{red}]{|}{|},
    mathescape=true,
    escapechar=@,
    basicstyle=\ttfamily,
    columns=fullflexible
}
\lstset{style=duckstyle}

\begin{document}


\begin{frame}[fragile]
A line
\visible<1->{
\begin{tcolorbox}[top=0pt, left=5pt,right=5pt, colback=blue!5!white, text height=4.8cm]
\begin{lstlisting}[ mathescape, name=foo, basewidth = {.3em}]
stream $\langle a_1, \dots, a_m \rangle$,$a_i \in [n]$
\end{lstlisting}
\end{tcolorbox}
}%
\end{frame}

\end{document}
```

If I comment out the \visible part it works and I comment out the lstling part it works too.
Top Answer
samcarter
You must not use fragile content like listings in a macro. 

```
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamersize{text margin left=10mm,text margin right=5mm} 
\setbeamertemplate{frametitle}[default][center]
\usepackage[many]{tcolorbox}
\usepackage{listings}
\lstdefinestyle{duckstyle}{%
    moredelim=[is][\color{red}]{|}{|},
    mathescape=true,
    escapechar=@,
    basicstyle=\ttfamily,
    columns=fullflexible
}
\lstset{style=duckstyle}

\begin{document}


\begin{frame}[fragile]
A line
\begin{visibleenv}<2->
\begin{tcolorbox}[top=0pt, left=5pt,right=5pt, colback=blue!5!white, text height=4.8cm]
\begin{lstlisting}[ mathescape, name=foo, basewidth = {.3em}]
stream $\langle a_1, \dots, a_m \rangle$,$a_i \in [n]$
\end{lstlisting}
\end{tcolorbox}
\end{visibleenv}%
\end{frame}

\end{document}
```

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.