I'm trying to use multido package to create a sequence of slides with multiple code snippets using listing. Unfortunately the fragile option leads to the following error:
! File ended while scanning use of \next.
Is there any workaround? Here is a minimal code to reproduce the error:
\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{multido}
\usepackage{listings}
\begin{document}
\begin{frame}[fragile]
\frametitle{test}
\begin{lstlisting}
import numpy as np
\end{lstlisting}
\end{frame}
\multido{\i=1+1}{7}{%
\begin{frame}[fragile]
\frametitle{\i}
\begin{lstlisting}
import numpy as np
\end{lstlisting}
\end{frame}
}
\end{document}
Clarification from Manuel:
From my understanding, the question of the OP is the following.
- The OP wants to include
listings(\usepackage{listings}) inbeamerframes. - In order to use
listings,beamerrequires thefragileframe option - In addition, the OP wants to programmatically create the code for the frames, e. g. using
\usepackage{multido}orpgfforpackage. - The problem is that
multidodoes not work together with thefragileoption. - Question: How can the OP programmatically create code for frames that contain
listings.
