From 7a128801fdc60dab27fee6154b2212afd309c1af Mon Sep 17 00:00:00 2001
From: Jan Wille <jan.wille@stud.hs-hannover.de>
Date: Wed, 13 Jul 2022 20:23:48 +0200
Subject: [PATCH] listings settings

---
 Bachelorarbeit.tex |  1 +
 src/HsH-report.cls |  1 +
 src/config.tex     | 17 +++++++++++++++++
 3 files changed, 19 insertions(+)

diff --git a/Bachelorarbeit.tex b/Bachelorarbeit.tex
index b81aea2..8918fb6 100644
--- a/Bachelorarbeit.tex
+++ b/Bachelorarbeit.tex
@@ -59,4 +59,5 @@
 	\printbibliography
 	\listoffigures
 	\listoftables
+	\lstlistoflistings
 \end{document}
diff --git a/src/HsH-report.cls b/src/HsH-report.cls
index c82b4ab..86c56d3 100644
--- a/src/HsH-report.cls
+++ b/src/HsH-report.cls
@@ -103,6 +103,7 @@
 \RequirePackage{csquotes}
 \MakeOuterQuote{"}
 \if@todos
+  \PassOptionsToPackage{svgnames}{xcolor}
   \PassOptionsToPackage{
     textwidth=4.5cm,
     textsize=small,
diff --git a/src/config.tex b/src/config.tex
index 1db5614..b18be3f 100644
--- a/src/config.tex
+++ b/src/config.tex
@@ -51,6 +51,23 @@
     literate={Ö}{{\"O}}1{Ä}{{\"A}}1{Ü}{{\"U}}1{ß}{{\ss}}1{ü}{{\"u}}1{ä}{{\"a}}1{ö}{{\"o}}1,
     escapeinside={(*@}{@*)},
   }
+
+  % listings styling:
+  \renewcommand{\lstlistingname}{Code} % listings name
+  \renewcommand{\lstlistlistingname}{Codeverzeichniss} % list of listings
+  \lstdefinestyle{example}{
+    backgroundcolor=\color{lightgray!20!white},
+    breakatwhitespace=true,
+    breaklines=true,
+    captionpos=t,
+    float=h!tbp,
+    framexleftmargin=2px,
+    framextopmargin=5px,
+    framexbottommargin=5px,
+    numbers=left,
+    numberstyle=\scriptsize\ttfamily\color{gray},
+    numbersep=5pt,
+  }
 }{}
 \@ifpackageloaded{enumitem}{
   \RequirePackage{amssymb}
-- 
GitLab