Ich versuche, eine Codeliste in mein Poster einzufügen, erhalte jedoch die folgende Fehlermeldung:
TeX-Kapazität überschritten, entschuldigen Sie [Eingabestapelgröße=5000]
Was mache ich falsch?
\documentclass[portrait, a0paper, 25pt]{tikzposter}
\title{title}
\author{}
\institute{}
\usepackage{color}
\definecolor{bluekeywords}{rgb}{0.13,0.13,1}
\definecolor{greencomments}{rgb}{0,0.5,0}
\definecolor{redstrings}{rgb}{0.9,0,0}
\usepackage{listings}
\lstset{language=[Sharp]C,
showspaces=false,
showtabs=false,
breaklines=true,
showstringspaces=false,
breakatwhitespace=true,
escapeinside={(*@}{@*)},
commentstyle=\color{greencomments},
keywordstyle=\color{bluekeywords}\bfseries,
stringstyle=\color{redstrings},
basicstyle=\ttfamily
}
\begin{document}
\maketitle
\block{Block title}{
\begin{lstlisting}
%some code
\end{lstlisting}
}
\end{document}
\endinput
Antwort1
Kein... Codeformat-... Formatierung... was... also... überhaupt... ich werde... sterben...
Das schwerwiegendere Problem besteht darin, dass der Inhalt der lstlisting
Umgebung behandelt wirdwörtlich, was bedeutet, dass Sie eine solche Umgebung nicht innerhalb des Arguments eines Befehls haben können ( \block
hier ).
Eine gängige Problemumgehung besteht darin, die Liste in eine externe Datei zu schreiben (mit oder ohne filecontents
Paket) und sie mit dem \lstinputlisting
Befehl einzufügen, anstatt die Liste in eine lstlisting
Umgebung einzubetten.
\documentclass[portrait, a0paper, 25pt]{tikzposter}
\title{title}
\author{}
\institute{}
\usepackage{color}
\definecolor{bluekeywords} {rgb}{0.13, 0.13, 1}
\definecolor{greencomments}{rgb}{0 , 0.5 , 0}
\definecolor{redstrings} {rgb}{0.9 , 0, 0}
\usepackage{listings}
\lstset{
language = [Sharp]C,
showspaces = false,
showtabs = false,
breaklines = true,
showstringspaces = false,
breakatwhitespace = true,
escapeinside = {(*@}{@*)},
commentstyle = \color{greencomments},
keywordstyle = \color{bluekeywords}\bfseries,
stringstyle = \color{redstrings},
basicstyle = \ttfamily,
}
% -----
% the following writes to an external file called 'foo.hs'
\usepackage{filecontents}
\begin{filecontents*}{foo.hs}
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
\end{filecontents*}
% -----
\begin{document}
\maketitle
\block{Block title}{%
\lstinputlisting{foo.hs}
}
\end{document}