Here is an example listing:
Code: Select all
\begin{lstlisting}[caption={Manipulation und Substitution durch bufferorientierte Implementierung.}]{}
int main()
{
printf("hello, world");
return 0;
}
\end{lstlisting}
Code: Select all
\usepackage{listings}
\usepackage{courier}
\lstset{
basicstyle=\tiny, % Standardschrift
numberstyle=\tiny, % Stil der Zeilennummern
numbersep=5pt, % Abstand der Nummern zum Text
tabsize=2, % Groesse von Tabs
extendedchars=true, %
breaklines=true, % Zeilen werden Umgebrochen
keywordstyle=\color{red},
frame=b,
stringstyle=\color{white}\ttfamily, % Farbe der String
showspaces=false, % Leerzeichen anzeigen ?
showtabs=false, % Tabs anzeigen ?
captionpos=b,
xleftmargin=17pt,
framexleftmargin=17pt,
framexrightmargin=5pt,
framexbottommargin=4pt,
backgroundcolor=\color{lightgray},
showstringspaces=false % Leerzeichen in Strings anzeigen ?
}
\lstloadlanguages{% Check Dokumentation for further languages ...
C++
}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox[cmyk]{0.43, 0.35, 0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize}}