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