I'm trying to add code listings from an external file to a document I'm working on. Unfortunately, in the resulting PDF all I get is the caption and a rectangle with the right width and background color. But it does not have any content.
I'm including my listings like this:
\lstset{language=[Objective]C, basicstyle=\footnotesize, showstringspaces=false, tabsize=2}
\lstinputlisting[label=lst:Animation, caption=foo]{Ressourcen/Animation.txt}
lstset is configured as follows:
\usepackage{listings}
\usepackage{xcolor}
\definecolor{hellgelb}{rgb}{1,1,0.9}
\definecolor{colKeys}{rgb}{0,0,1}
\definecolor{colIdentifier}{rgb}{0,0,0}
\definecolor{colComments}{rgb}{1,0,0}
\definecolor{colString}{rgb}{0,0.5,0}
\lstset{
float=hbp,
basicstyle=\ttfamily\color{black}\small\smaller,
identifierstyle=\color{colIdentifier},
keywordstyle=\color{colKeys},
stringstyle=\color{colString},
commentstyle=\color{colComments},
columns=flexible,
tabsize=2,
frame=single,
extendedchars=true,
showspaces=false,
showstringspaces=false,
numbers=left,
numberstyle=\tiny,
breaklines=true,
backgroundcolor=\color{hellgelb},
breakautoindent=true
}
Any idea what I'm doing wrong?
Update
Minimal example:
\documentclass[
11pt, % Schriftgröfle
DIV10,
ngerman, % für Umlaute, Silbentrennung etc.
a4paper, % Papierformat
oneside, % einseitiges Dokument
titlepage, % es wird eine Titelseite verwendet
parskip=half, % Abstand zwischen Absätzen (halbe Zeile)
headings=normal, % Größe der Überschriften verkleinern
listof=totoc, % Verzeichnisse im Inhaltsverzeichnis aufführen
bibliography=totoc, % Literaturverzeichnis im Inhaltsverzeichnis aufführen
index=totoc, % Index im Inhaltsverzeichnis aufführen
captions=tableheading, % Beschriftung von Tabellen unterhalb ausgeben
draft % Status des Dokuments (final/draft)
]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{xcolor}
\definecolor{hellgelb}{rgb}{1,1,0.9}
\definecolor{colKeys}{rgb}{0,0,1}
\definecolor{colIdentifier}{rgb}{0,0,0}
\definecolor{colComments}{rgb}{1,0,0}
\definecolor{colString}{rgb}{0,0.5,0}
\lstset{
float=hbp,
basicstyle=\ttfamily\color{black}\small\smaller,
identifierstyle=\color{colIdentifier},
keywordstyle=\color{colKeys},
stringstyle=\color{colString},
commentstyle=\color{colComments},
columns=flexible,
tabsize=2,
frame=single,
extendedchars=true,
showspaces=false,
showstringspaces=false,
numbers=left,
numberstyle=\tiny,
breaklines=true,
backgroundcolor=\color{hellgelb},
breakautoindent=true
}
\begin{document}
\lstset{language=[Objective]C, basicstyle=\footnotesize, showstringspaces=false, tabsize=2}
\lstinputlisting[label=lst:Animation, caption=foo]{Animation.txt}
\end{document}
Animation.txtwould be useful. – egreg Dec 13 '12 at 14:27