Remove outdated package ngerman as it breaks compilation
[Misc/Vorlage-Abschlussarbeiten.git] / thesisclass.cls
1 %% LaTeX2e class for diploma theses\r
2 %% Based on wissdoc.cls by Roland Bless, 1996-2001\r
3 %% bless@telematik.informatik.uni-karlsruhe.de\r
4 %%\r
5 %% Adapted by: Timo Rohrberg, 2009\r
6 %% timo.rohrberg@student.kit.edu\r
7 %%\r
8 %% Additions by: Thorsten Haberecht, IPD - Chair Prof. Böhm, 2010\r
9 %% thorsten.haberecht@kit.edu\r
10 %%\r
11 %% Minor changes by: Moritz Baum, ITI, 2012\r
12 %% moritz.baum@kit.edu\r
13 \r
14 \r
15 \NeedsTeXFormat{LaTeX2e}                                                                                % We do need LaTeX2e\r
16 \ProvidesClass{thesisclass}\r
17 \LoadClass[a4paper,11pt,titlepage]{scrbook}     % Class based on scrbook\r
18 \r
19 \r
20 \r
21 %% -------------------------------\r
22 %% |          Packages           |\r
23 %% -------------------------------\r
24 \r
25 % Set document encoding to UTF-8.\r
26 \usepackage[utf8]{inputenc}\r
27 % \usepackage[latin1]{inputenc} % Input in ISO 8859-1 (Latin1)\r
28 % Use vector glyphs of Computer Modern font with T1 encoding.\r
29 \usepackage{lmodern}\r
30 \usepackage[T1]{fontenc}\r
31 % Activate micro-typographic improvements.\r
32 \usepackage[protrusion=true,expansion=true]{microtype}\r
33 % \usepackage{ae}               % Almost european, virtual T1-Font\r
34 % Activate color definitions.\r
35 \usepackage[pdftex]{xcolor}\r
36 % Make including other pdfs available.\r
37 \usepackage[pdftex]{graphicx}\r
38 % Additional math symbols.\r
39 \usepackage{amssymb,amsmath,amsthm}\r
40 % Smart spacing for macros.\r
41 \usepackage{xspace}\r
42 % Rotated table head labels.\r
43 \usepackage{rotating}\r
44 % Nice table separator lines.\r
45 \usepackage{booktabs}\r
46 \r
47 \usepackage{vmargin}          % Adjust margins in a simple way\r
48 \usepackage{fancyhdr}         % Define simple headings\r
49 \usepackage{subfigure}\r
50 \usepackage{url}\r
51 \usepackage[absolute,overlay]{textpos}\r
52 \usepackage{tikz}\r
53 \usepackage[english,ngerman]{babel}\r
54 \usepackage[ruled, vlined, linesnumbered]{algorithm2e}\r
55 \usepackage[raiselinks=true,\r
56                                                 bookmarks=true,\r
57                                                 bookmarksopenlevel=1,\r
58                                                 bookmarksopen=true,\r
59                                                 bookmarksnumbered=true,\r
60                                                 hyperindex=true,\r
61                                                 plainpages=false,\r
62                                                 pdfpagelabels=true,\r
63                                                 pdfborder={0 0 0.5},\r
64                                                 colorlinks=false,                                               \r
65                                                 linkbordercolor={0 0.61 0.50},   \r
66                                                 citebordercolor={0 0.61 0.50}]{hyperref}  %{0.57 0.74 0.57}\r
67                                                 \r
68 \usepackage[fixlanguage]{babelbib}      % sets german style for literature entries\r
69 \selectbiblanguage{ngerman}             % for \bibliographystyle{babalpha}\r
70 %% --- End of Packages ---\r
71 \r
72 \r
73 \r
74 %% -------------------------------\r
75 %% |        Declarations         |\r
76 %% -------------------------------\r
77 \DeclareGraphicsExtensions{.svg}\r
78 %% --- End of Declarations ---\r
79 \r
80 \r
81 \r
82 %% -------------------------------\r
83 %% |         New commands        |\r
84 %% -------------------------------\r
85 \newcommand{\changefont}[3]{\fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}\r
86 \newcommand{\chapterheadfont}{}\r
87 \newcommand{\blankpage}{\r
88  \clearpage{\pagestyle{empty}\cleardoublepage}\r
89 }\r
90 %% --- End of New Commands ---\r
91 \r
92 \r
93 \r
94 %% -------------------------------\r
95 %% |      Globale Settings       |\r
96 %% -------------------------------\r
97 \setcounter{secnumdepth}{3} % Numbering also for \subsubsections\r
98 \setcounter{tocdepth}{3}    % Register \subsubsections in content directory\r
99 \r
100 \setpapersize{A4}\r
101 \setmarginsrb{3cm}{1cm}{3cm}{1cm}{6mm}{7mm}{5mm}{15mm}\r
102 \r
103 \parindent 0cm                     % Do not indent beginning of paragraph\r
104 \parskip1.5ex plus0.5ex minus0.5ex % Margin between paragraphs\r
105 %% --- End of global Settings ---\r
106 \r
107 \r
108 \r
109 %% -------------------------------\r
110 %% |          Headings           |\r
111 %% -------------------------------\r
112 \pagestyle{fancy}\r
113 \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}\r
114 \fancyhf{}\r
115 \fancyhead[RO]{\headfont\nouppercase{\rightmark}}       % Header for left page (odd)\r
116 \fancyhead[LE]{\headfont\nouppercase{\leftmark}}        % Header for right page (even)\r
117 \fancyfoot[C]{\thepage}\r
118 \renewcommand{\headrulewidth}{0.5pt}\r
119 \renewcommand{\footrulewidth}{0pt}\r
120 \fancypagestyle{plain}{%\r
121 \fancyhf{}                                              % No Header and Footer fields\r
122 \renewcommand{\headrulewidth}{0pt}\r
123 \renewcommand{\footrulewidth}{0pt}\r
124 \fancyfoot[C]{\thepage}\r
125 }\r
126 %% --- End of Headings ---\r
127 \r
128 \r
129 \r
130 %% -------------------------------\r
131 %% |      Style of captions      |\r
132 %% -------------------------------\r
133 \renewcommand{\chaptername}{}\r
134 \r
135 \renewcommand{\section}{%\r
136 \@startsection{section}%\r
137 {1}             % Structure level\r
138 {0mm}   % Indention\r
139 {2ex plus 1ex minus 1ex}                % Pre-Margin\r
140 {0.5ex plus 0.5ex minus 0.5ex}          % Post-Margin\r
141 {\chapterheadfont\Large\bfseries}       % Style\r
142 }\r
143 \renewcommand{\subsection}{%\r
144 \@startsection{subsection}%\r
145 {2}             % Structure level\r
146 {0mm}   % Indention\r
147 {1.5ex plus 1ex minus 0.5ex}            % Pre-Margin\r
148 {0.3ex plus 0.3ex minus 0.3ex}          % Post-Margin\r
149 {\chapterheadfont\large\bfseries}       % Style\r
150 }\r
151 \renewcommand{\subsubsection}{%\r
152 \@startsection{subsubsection}%\r
153 {3}             % Structure level\r
154 {0mm}   % Indention\r
155 {1.5ex plus 1ex minus 0.5ex}            % Pre-Margin\r
156 {0.2ex plus 0.2ex minus 0.2ex}          % Post-Margin\r
157 {\chapterheadfont\normalsize\bfseries}  % Style\r
158 }\r
159 \renewcommand{\paragraph}{%\r
160 \@startsection{paragraph}%\r
161 {4}             % Structure level\r
162 {0mm}   % Indention\r
163 {1.3ex plus 1ex minus 0.3ex}                    % Pre-Margin\r
164 {0.2ex plus 0.2ex minus 0.2ex}                  % Post-Margin\r
165 {\chapterheadfont\normalsize\bfseries}  % Style\r
166 }\r
167 \renewcommand{\subparagraph}{\@startsection\r
168 {subparagraph}% % the name\r
169 {5}% % the level\r
170 {0 pt}% % the indent\r
171 {5pt}% % the beforeskip\r
172 {-7pt}% % the afterskip\r
173 {\chapterheadfont\normalsize\bfseries}% % the style\r
174 }\r
175 %% --- End of captions style ---\r
176 \r
177 \r
178 \r
179 %% ---------------------------------\r
180 %% |   Style of chapter captions   |\r
181 %% ---------------------------------\r
182 \newlength{\chapnolen}\r
183 \newlength{\chapparlen}\r
184 \newsavebox{\chapno}\r
185 \renewcommand{\@makechapterhead}[1]{\r
186   \vspace*{0.2\textheight}\r
187   \vskip 15\p@\r
188   {\parindent \z@ \raggedright \normalfont\r
189     \ifnum \c@secnumdepth >\m@ne\r
190       \if@mainmatter\r
191         \savebox{\chapno}{\chapterheadfont\huge\bfseries \thechapter.}\r
192         \settowidth{\chapnolen}{\usebox{\chapno}}\r
193         \parbox[t]{\chapnolen}{\usebox{\chapno}}\nobreak\leavevmode\r
194       \fi\r
195     \fi\r
196     \interlinepenalty\@MM\r
197     \setlength{\chapparlen}{\textwidth}\r
198     \addtolength{\chapparlen}{-1.0\chapnolen}\r
199     \addtolength{\chapparlen}{-2ex}\r
200     \leavevmode\nobreak\r
201     \parbox[t]{\chapparlen}{\raggedright\chapterheadfont\huge \bfseries #1\par\nobreak}\r
202     \vskip 40\p@\r
203   }}\r
204 \r
205 \renewcommand{\@makeschapterhead}[1]{\r
206   \vspace*{50\p@}\r
207   {\parindent \z@ \raggedright\r
208     \normalfont\r
209     \interlinepenalty\@M\r
210     \chapterheadfont \huge \bfseries  #1\par\nobreak\r
211     \vskip 40\p@\r
212   }\r
213 }\r
214 %% --- End of chapter captions style ---\r
215 \r
216 \r
217 \r
218 %% ---------------------------------\r
219 %% |  Style of content directory   |\r
220 %% ---------------------------------\r
221 \let\oldtableofcontents\tableofcontents\r
222 \renewcommand{\tableofcontents}{{\pdfbookmark{\contentsname}{\contentsname}\chapterheadfont\oldtableofcontents}}\r
223 \let\@olddottedtocline\@dottedtocline\r
224 \renewcommand{\@dottedtocline}[5]{\@olddottedtocline{#1}{#2}{#3}{#4}{\chapterheadfont #5}}\r
225 %% --- End of content directory style ---\r
226 \r
227 \r
228 %% ----------------------------------\r
229 %% |  Style of appendix numbering   |\r
230 %% ----------------------------------\r
231  \renewcommand\appendix{\par \r
232    \setcounter{section}{0}% \r
233    \setcounter{subsection}{0}% \r
234    \setcounter{figure}{0}%\r
235    \renewcommand\thesection{\Alph{section}}% \r
236    \renewcommand\thefigure{\Alph{section}.\arabic{figure}} \r
237    \renewcommand\thetable{\Alph{section}.\arabic{table}}}\r
238 %% --- End of appenix numbering style ---\r
239 \r
240 \r
241 %% ----------------------------------\r
242 %% |  Some additional options       |\r
243 %% ----------------------------------\r
244 \setlength{\algomargin}{2em}    % Leave space for line numbering\r
245 \numberwithin{algocf}{chapter}  % Algorithms numbered as Chapternumber.Algonumber\r
246 \clubpenalty = 10000            % Avoid widows and club lines\r
247 \widowpenalty = 10000\r
248 \displaywidowpenalty = 10000\r
249 \setkomafont{descriptionlabel}{\normalfont\bfseries}    % Normal Font in description environment\r
250 \addtokomafont{sectioning}{\normalfont\bfseries}        % Normal Font for table of contents\r
251 \r
252 %% --- End of additional options ---\r
253 \r
254 \r
255 %% **** END OF CLASS ****\r