I'm making a slideshow with LaTeX beamer class like this :
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{listings}
\usepackage{listingsutf8}
\begin{document}
\begin{frame}[fragile]
\frametitle{Découpage et assemblage de lignes}
\begin{lstlisting}[language=bash]
some code
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
\frametitle{Autres opérations}
\begin{lstlisting}[language=bash]
some code
\end{lstlisting}
\end{frame}
\end{document}
For convenient reasons, I would like the code of each frame to be inside a command created with \newcommand like this :
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{listings}
\usepackage{listingsutf8}
\newcommand{\framei}{%
\begin{frame}[fragile]
\frametitle{Decoupage et assemblage de lignes}
\begin{lstlisting}[language=bash]
some code
\end{lstlisting}
\end{frame}}
\newcommand{\frameii}{%
\begin{frame}[fragile]
\frametitle{Autres operations}
\begin{lstlisting}[language=bash]
some code
\end{lstlisting}
\end{frame}}
\begin{document}
\framei
\frameii
\end{document}
But when I try to build my slideshow with these modifications, pdftex fail with a Runaway argument? error.
Is there something wrong with my sources? or is it a LaTeX/beamer bug ?
\input{framei}could work to grab content from framei.tex. If you want to enforce a consistent style, there may be other options. If you want something else entirely, please clarify. – Mike Renfro Mar 01 '16 at 20:47