From b585d932530f755e80829bfc5d28d97b5afe1e15 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Wed, 5 Oct 2016 23:56:16 +0200 Subject: Restructuring main latex file. --- latexHeaders/listings.tex | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 latexHeaders/listings.tex (limited to 'latexHeaders/listings.tex') diff --git a/latexHeaders/listings.tex b/latexHeaders/listings.tex new file mode 100644 index 0000000..02b34bd --- /dev/null +++ b/latexHeaders/listings.tex @@ -0,0 +1,44 @@ +% Colors, used for syntax highlighting. +% To print this document, set all colors to black! +\usepackage{xcolor} +\definecolor{keyword}{rgb}{0, 0, 1} +\definecolor{string}{rgb}{1, 0, 0} +\definecolor{comment}{rgb}{0.2, 0.6, 0.2} +\definecolor{identifier}{rgb}{0, 0, 0} + +% Source code listings. +\usepackage{pxfonts} +\usepackage{listings} +\lstset{ + language={C++}, + numbers=left, + stepnumber=1, + numbersep=6pt, + numberstyle=\footnotesize, + breaklines=true, + breakautoindent=true, + breakatwhitespace=false, + postbreak=\space, + tabsize=2, + basicstyle=\ttfamily\footnotesize, + showspaces=false, + showstringspaces=false, + extendedchars=true, + keywordstyle=\color{keyword}\bfseries, + stringstyle=\color{string}\bfseries, + commentstyle=\color{comment}\bfseries, + identifierstyle=\color{identifier}, + frame=trbl +} + +% Listings doesn't support UTF8. This is just enough for German umlauts. +\lstset{literate=% + {Ö}{{\"O}}1 + {Ä}{{\"A}}1 + {Ü}{{\"U}}1 + {ß}{{\ss}}1 + {ü}{{\"u}}1 + {ä}{{\"a}}1 + {ö}{{\"o}}1 + {~}{{\textasciitilde}}1 +} -- cgit v1.2.3