Pregunta

Estoy tratando de agregar algún código en una presentación realizada con látex. Usé Beamer, agregué algunos cuadros sin problemas, pero una vez que agrego el listado, ya no puedo compilar la presentación.

\begin{frame}{Code}
\begin{lstlisting}
Sample Code
\end{lstlisting}
\end{frame}

El error que me dio pdflatex es:

Package Listings Warning: Text dropped after begin of listing on input line 80.

¿Hay algo especial que agregar para que funcione?

¿Fue útil?

Solución

Intente hacer un marco frágil:

\begin{frame}[fragile]

Otros consejos

los fragile La opción no funcionó para mí, pero esto lo hizo:

\begin{frame}[containsverbatim]

Los listados proporcionan funciones de cuadro:

\begin{lstlisting}[frame=single]
Sample Code
\end{lstlisting}

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top