-
Notifications
You must be signed in to change notification settings - Fork 0
/
basilea.sty
251 lines (210 loc) · 8.9 KB
/
basilea.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
%%
%% This file is originally based on 'ECSthesis.cls' by Steve R. Gunn
%% and 'phdthesis.sty' by Jamie Stevens. In this new version many parts
%% have been replaced by calls to the memoir package. Many existing
%% templates using the memoir served as model.
%%
%% v.2.0
%%
%% 2014, Ivan Giangreco
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{basilea}[2014]
\newcommand*{\basileaBibStyle}{thesis}
%%
%% Provides the option to use \citet to get the authors name
%% Internally, this changes the bibliographystyle from thesis to plainnat
%%
\DeclareOption{citeauthor}{
\renewcommand*{\basileaBibStyle}{plainnat}
}
%%
%% Provides the default option to not use \citet to get the authors name
%% Internally, this sets the bibliographystyle to thesis
%%
\DeclareOption{citenumber}{
\renewcommand*{\basileaBibStyle}{thesis}
}
\ExecuteOptions{citenumber}
\ProcessOptions\relax
\usepackage[ngerman, english]{babel}
\usepackage[utf8]{inputenc}
% text to be set for frontpage
\newcommand*{\supervisor}[1]{\def\supervisorint{#1}}
% \newcommand*{\cosupervisor}[1]{\def\cosupervisorint{#1}}
\newcommand*{\examiner}[1]{\def\examinerint{#1}}
\newcommand*{\authors}[1]{\def\authorsint{#1}}
\newcommand*{\email}[1]{\def\emailint{#1}}
\newcommand*{\ulogo}[1]{\def\universitylogoint{#1}}
\newcommand*{\department}[1]{\def\departmentint{#1}}
\newcommand*{\faculty}[1]{\def\facultyint{#1}}
\newcommand*{\research}[1]{\def\researchgroupint{#1}}
\newcommand*{\thesistype}[1]{\def\thesistypeint{#1}}
\newcommand*{\immatriculnr}[1]{\def\immatriculnrint{#1}}
\def\titleint{\@title}
\def\dateint{\@date}
% settings for nomenclature (i.e. the abbreviations)
% - for using in text use e.g. \nomenclature{LED}{Light-Emitting Diode}
% this will print the text directly as Light-Emitting Diode (LED)
% - the abbreviations for the whole document can be printed with the command \thesisnomencl
% - invoke MakeIndex to create a *.nlo file (see also documentation of nomenclature package)
\usepackage{nomencl}
\newcommand*{\nomenclint}{}
\let\nomenclint\nomenclature
\renewcommand*{\nomenclature}[2]{\textit{#2} (#1) \nomenclint{#1}{#2}}
\newcommand*{\thesisnomencl}{\renewcommand{\nomname}{\iflanguage{english}{Abbreviations}{Abkürzungsverzeichnis}}\printnomenclature\addcontentsline{toc}{chapter}{\iflanguage{english}{Abbreviations}{Abkürzungsverzeichnis}}}
% graphics
% (see also floats section in this document for more options)
\usepackage{eso-pic}
\usepackage{everyshi}
\usepackage{ifthen}
\usepackage{calc}
\usepackage{pdfpages}
\graphicspath{{Figures/}}
\newsubfloat{figure}
% definition of fonts (phv is Helvetica, pcr is Courrier)
\renewcommand{\sfdefault}{phv}
\renewcommand{\ttdefault}{pcr}
% definition of colors
\usepackage{color,graphicx}
\definecolor{chaptercolor}{rgb}{.7,.7,.7}
\definecolor{emphasizecolor}{rgb}{.7,.7,.7}
% margins
\setlrmarginsandblock{3.5cm}{3.5cm}{*}
\setulmarginsandblock{3.5cm}{3.5cm}{*}
\checkandfixthelayout
% document organization
\setsecnumdepth{subsubsection}
\setcounter{tocdepth}{3}
\newcounter{dummy}
\newcommand\addtotoc[1]{
\refstepcounter{dummy}
\addcontentsline{toc}{chapter}{#1}}
% definition of chapter style (i.e. large number and text)
\setlength{\beforechapskip}{50pt}
\setlength{\afterchapskip}{1pt}
\newcommand*{\colorchapnumber}{\color{chaptercolor}}
\newcommand*{\fontchapnumber}{\usefont{T1}{phv}{b}{n}\fontsize{100}{130}\selectfont}
\newcommand*{\fontchaptitle}{\bfseries\huge}
\renewcommand*{\afterchapternum}{}
\renewcommand*{\printchaptername}{}
\setlength{\midchapskip}{20mm}
\renewcommand*{\chapternamenum}{}
\renewcommand*{\printchapternum}{\raggedleft{\colorchapnumber\fontchapnumber\thechapter}\par}
\renewcommand*{\printchaptertitle}[1]{\raggedleft\fontchaptitle{#1}\par \vspace{30pt} \nobreak}
% definition of (subsub)section styles
\setsecheadstyle{\bfseries \Large}
\setbeforesecskip{25pt}
\setaftersecskip{1pt}
\setsubsecheadstyle{\bfseries\large}
\setbeforesubsecskip{20pt}
\setaftersubsecskip{1pt}
\setsubsubsecheadstyle{\bfseries\normalsize}
\setbeforesubsubsecskip{20pt}
\setaftersubsubsecskip{1pt}
% definition of line spacing, indent of paragraph, etc.
\OnehalfSpacing
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\raggedbottom
% header, footer
\nouppercaseheads
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
\makepagestyle{thesis}
\makeevenhead{thesis}{\leftmark}{}{\thepage}
\makeoddhead{thesis}{\leftmark}{}{\thepage}
\makeheadrule{thesis}{\textwidth}{0.2pt}
\makeevenfoot{thesis}{}{}{}
\makeoddfoot{thesis}{}{}{}
\copypagestyle{chapter}{empty}
% footnotes
\setlength{\skip\footins}{20pt}
\usepackage[hang]{footmisc}
\setlength{\footnotemargin}{10pt}
\usepackage{chngcntr}
\counterwithout{footnote}{chapter}
% add highlighting possibilities
% use \hlt to highlight parts of text, e.g. \hlt{this is important}
\usepackage{soul}
\newcommand{\hlt}[1]{\hl{#1}}
% various imports
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm}
% clearing pages
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\newcommand*{\tmpcleardoublepage}{}
\let\tmpcleardoublepage\cleardoublepage
% floats
\captionstyle{\raggedright}
\setfloatlocations{figure}{ht!}
\setlength{\intextsep}{10pt}
\setlength{\textfloatsep}{10pt}
% definition of table of contents (i.e. title, header text, appearance in pdf-TOC, etc.)
\newcommand*{\thesistoc}{\cleardoublepage\renewcommand*{\contentsname}{\iflanguage{english}{Table of Contents}{Inhaltsverzeichnis}} \createplainmark{toc}{both}{\iflanguage{english}{Table of Contents}{Inhaltsverzeichnis}} \currentpdfbookmark{\iflanguage{english}{Table of Contents}{Inhaltsverzeichnis}}{toc} \tableofcontents*}
% adds the word "Appendix" in front of chapters in the appendix section
\renewcommand*{\cftappendixname}{\iflanguage{english}{Appendix}{Anhang}\space}
% definition of bibliography
\newcommand*{\thesisbib}{\cleardoublepage\renewcommand*{\contentsname}{\iflanguage{english}{Bibliography}{Literaturverzeichnis}} \createplainmark{bib}{both}{\iflanguage{english}{Bibliography}{Literaturverzeichnis}}\bibliographystyle{\basileaBibStyle}\bibliography{thesis}}
\usepackage[square, numbers, comma, sort&compress]{natbib}
% document structure
\newcommand*{\thesisfront}{\frontmatter \let\cleardoublepage\clearpage }
\newcommand*{\thesismain}{ \addtocontents{toc}{\vspace{2em}} \mainmatter \let\cleardoublepage\tmpcleardoublepage }
\newcommand*{\thesisappendix}{ \addtocontents{toc}{\vspace{2em}} \appendix \let\cleardoublepage\clearpage}
\newcommand*{\thesisback}{ \addtocontents{toc}{\vspace{2em}} \backmatter \let\cleardoublepage\clearpage}
\renewcommand\maketitle{
\hypersetup{pdftitle={\@title}}
\hypersetup{pdfauthor=\authorsint}
\thispagestyle{empty}
{\raggedright\includegraphics{\universitylogoint}}\par
\begin{center}
\vspace{3cm}
{\Huge \bfseries \@title \par}
\vspace{0.5cm}
{\thesistypeint \par}
\vspace{3cm}
{\facultyint \par}
{\departmentint \par}
{\researchgroupint \par}
\vspace{1.5cm}
{\iflanguage{english}{Examiner}{Beurteiler}: \examinerint \par}
{\iflanguage{english}{Supervisor}{Zweitbeurteiler}: \supervisorint \par}
% {\iflanguage{english}{Co-Supervisor}{Co-Zweitbeurteiler}: \cosupervisorint \par}
\vspace{1.5cm}
{\authorsint \par}
{\emailint \par}
{\immatriculnrint \par}
\vfill
{\@date \par}
\end{center}
}
% declaration
\newcommand{\formlabel}[2]{\vspace{0.25cm}\textbf{\footnotesize #1 --- #2}\\}
% urls
\usepackage{url}
\urlstyle{same}
% footnotes
\usepackage{chngcntr}
\counterwithout{footnote}{chapter}
% math
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
% reference settings
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,
colorlinks,linkcolor={black},citecolor={black},urlcolor={black}, filecolor={black},
pdfstartview={FitV}, breaklinks=true, unicode]{hyperref}
\usepackage[capitalize]{cleveref}
% todos
\usepackage[colorinlistoftodos, textwidth=4cm]{todonotes} % add ",disable" in [] to remove all todos, missing figures and the todo list
\newcommand{\todoEmpty}[2][]{\todo[fancyline, #1]{#2}}
\newcommand{\todoMissing}[2][]{\todoEmpty[color=magenta!80, linecolor=magenta!80, #1]{Missing: #2}}
\newcommand{\todoCheck}[2][]{\todoEmpty[color=red!80, linecolor=red!80, #1]{Check: #2}}
\newcommand{\todoRevise}[2][]{\todoEmpty[color=orange!80, linecolor=orange!80, #1]{Revise: #2}}
\newcommand{\todoCitation}[2][]{\todoEmpty[color=yellow!80, linecolor=yellow!80, #1]{Citation: #2}}
\newcommand{\todoLanguage}[2][]{\todoEmpty[color=blue!40!white, linecolor=blue!40!white, #1]{Language: #2}}
\newcommand{\todoQuestion}[2][]{\todoEmpty[color=green!80!white, linecolor=green!80!white, #1]{Question: #2}}
\newcommand{\todoNote}[2][]{\todoEmpty[color=black!20!white, linecolor=black!20!white, #1]{Note: #2}}
\newcommand{\todoFigure}[5]{\begin{figure}[#1]\centering\missingfigure[figwidth=#2]{#3}\caption{#4}\label{#5}\end{figure}}
\endinput
%% End of file 'basilea.sty'