I want to put some PHP code in my slide with the package listings but I have this error message:
Argument of \frame has an extra }.<inserted text>\par }
My latex code :
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}
\usepackage{setspace}
\usepackage{color}
\usepackage{listings}
\usetheme{CambridgeUS}
\begin{frame}
\begin{large}
Contexte : \newline \pause
\end{large}
\begin{itemize}
\item Avertir Drupal
\end{itemize}
\begin{lstlisting}
// Gestion du contexte ete2013
// Utilisation d'un nouveau template
if (%variables['ctpage'] == "ete2013") {
variables['template_files']=array('page-ete');
}
\end{lstlisting}
\end{frame}
\begin{document}
and\end{document}
. Whenever a frame constains a listing, you should start the frame environment by\begin{frame}[fragile]
; that does the trick, here. A suggestion somewhat peripheral to the problem: pass the key=value pairlanguage=PHP
to yourlstlisting
environement to get syntax highlighting of your code.