\documentclass{beamer} \usepackage[ fach=Informatik, typ={ohne}, farbig, loesungen=folgend, module={ Aufgaben, }, ]{schule} \begin{document} \begin{frame}[fragile]{Beamer Example} \begin{aufgabe} $2+2=$ \end{aufgabe} \begin{loesung} 4 \end{loesung} \begin{lstlisting}[language=bash] echo $loesung >> newfile.txt \end{lstlisting} \end{frame} \end{document}