-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhgbtermreport.cls
180 lines (146 loc) · 6.08 KB
/
hgbtermreport.cls
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
%% hgbtermreport.cls
%% Autor: Wilhelm Burger (wilhelm.burger@fh-hagenberg.at)
%% Diese Datei ist Teil des hagenberg-Package zur Erstellung von
%% Bachelor- und Diplomarbeiten.
\NeedsTeXFormat{LaTeX2e}
\newcommand{\hgbtermreportDate}{2012/05/10} %Versionsdatum
\ProvidesClass{hgbtermreport}[\hgbtermreportDate\space LaTeX-Vorlage fuer Semester- und Projektberichte]
\RequirePackage{ifthen}
\newcommand{\hgb@MainLanguage}{german} % also referenced in hgb.sty
%% begin class options ---------------------------------------------
\DeclareOption{english}{\renewcommand{\hgb@MainLanguage}{english}}
\DeclareOption{german}{\renewcommand{\hgb@MainLanguage}{german}}
\DeclareOption*{\ClassWarning{hgbtermreport}{Unknown document option "\CurrentOption"}}
\ProcessOptions
%% end class options ---------------------------------------------
\LoadClass[a4paper,11pt,oneside]{report}
\RequirePackage{hgb} % load associated style file hgb.sty
%------------ Automatischer Eintrag der PDF Metadaten ------------
%\renewcommand{\maketitle}{ %replace standard LaTeX-command
%\hypersetup{
% pdftitle={\@title},
% pdfauthor={\@author},
% pdfsubject={\@studiengang, \@studienort},
% pdfcreator={LaTeX using class hgbtermreport},
% pdfproducer={},
% pdfkeywords={}
%}%
%\@maketitlepages
%}
%% ---------------------------------------------------------------
%% ---------------------------------------------------------------
%% ---------------------------------------------------------------
%%% VVV move stuff below into hgb.sty ???
%% ---------------------------------------------------------------
%% ---------------------------------------------------------------
%% ---------------------------------------------------------------
%% --------------- Headings --------------------------------------
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\@ifundefined{chapter}%
{}%
{\renewcommand{\chaptermark}[1]{%
\ifthenelse{\value{chapter} < 1}%
{\markboth{#1}{}}%
{\markboth{\thechapter.\ #1}{}}
}}
\addtolength{\headheight}{\baselineskip}
\renewcommand{\headrulewidth}{0pt} %% thin line under header
%\renewcommand{\headrulewidth}{0.4pt} %% no line under header
\renewcommand{\footrulewidth}{0pt}
\fancyhf{} %% Clear all fields.
%\fancyhead[LE,RO]{\sffamily\thepage} %{\bf \rightmark}
%\fancyhead[LO,RE]{\sffamily\nouppercase{\leftmark}} %{\slshape \leftmark}
\fancyhead[R]{\sffamily\thepage} %{\bf \rightmark}
\fancyhead[L]{\sffamily\nouppercase{\leftmark}} %{\slshape \leftmark}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\sffamily\thepage} % except the center
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
%% ------------ biblatex -----------------------------------------
\usepackage{csquotes} % recommended for biblatex
\usepackage[style=numeric-comp]{biblatex}[2011/05/12]
% do not use these:
%\usepackage[style=alphabetic]{biblatex}[2011/05/12]
%\usepackage[style=authoryear]{biblatex}[2011/05/12]
%\usepackage[style=ieee]{biblatex}[2011/05/12]
%\usepackage[style=nature]{biblatex}[2011/05/12]
\ExecuteBibliographyOptions{sortcites=true,defernumbers=true,isbn=false,doi=false}
%% 3 categories of references:
\newcommand{\@bibtitleLiteratur}{Literatur}
\newcommand{\@bibtitleAvmedia}{Filme und audiovisuelle Medien}
\newcommand{\@bibtitleOnline}{Online-Quellen}
\defbibfilter{literature}{
not ( type=movie or type=video or type=music or type=audio or
type=online or type=electronic or type=www )}
\defbibfilter{avmedia}{%
( type=movie or type=video or type=music or type=audio )}
\defbibfilter{online}{%
( type=online or type=electronic or type=www )}
\defbibheading{noheader}[]{} % 'none' should be defined but isn't
% German format in biblatex is flawed: it adds wrong spaces and prohibits
% line breaking within date strings. Corrected by Wilbur as follows.
% Taken from german.lbx: replaced \thinspace by breaking zero space \hskip0pt
\DefineBibliographyExtras{ngerman}{%
\def\mkbibdatelong#1#2#3{%
\iffieldundef{#3}
{\hskip0pt}
{\mkbibordinal{\thefield{#3}}%
\iffieldundef{#2}{}{\space}}% %was: \nobreakspace
\iffieldundef{#2}
{\hskip0pt}
{\mkbibmonth{\thefield{#2}}%
\iffieldundef{#1}{\hskip0pt}{\space}}%
\stripzeros{\thefield{#1}}}%
%
\def\mkbibdateshort#1#2#3{%
\iffieldundef{#3}
{\hskip0pt}
{\mkdatezeros{\thefield{#3}}\adddot
\iffieldundef{#2}{}{\hskip0pt}}%
\iffieldundef{#2}
{\hskip0pt}
{\mkdatezeros{\thefield{#2}}%
\iffieldundef{#1}
{\hskip0pt}
{\iffieldundef{#3}{/}{\adddot\hskip0pt}}}%
\mkdatezeros{\thefield{#1}}}%
}
%This is only a wrapper to \addbibresource to allow the use
%of the classic bibtex-workflow in the future.
\newcommand{\AddBibFile}[1]{
\addbibresource{#1}%
}
%See http://www.jr-x.de/publikationen/latex/tipps/zeilenumbruch.html
\newenvironment{bibhyphenation}%
{\hyphenpenalty=20% (50)
\tolerance=9999% (200)
\exhyphenpenalty=0% (50)
\linepenalty=0% (10)
\setlength{\emergencystretch}{3em}}%
{}
% Currently the only public macro:
\newcommand{\MakeBibliography}[2][]{
% opt. arg (#1): optional argument "nosplit" to get a 1-piece bibliography
% req. arg (#2): main title of bibliography
\clearpage
\ifthenelse{\equal{#1}{nosplit}}%
{% create a single bibliography with all entries:
\printbibheading[heading=bibintoc,title={#2}]
\begin{bibhyphenation}
\printbibliography[heading=noheader]
\end{bibhyphenation}
}
{% split the bibliography using the predefined categories:
\printbibheading[heading=bibintoc,title={#2}]
\begin{bibhyphenation}
\printbibliography[filter=literature,heading=subbibintoc,title={\@bibtitleLiteratur}]
\printbibliography[filter=avmedia,heading=subbibintoc,title={\@bibtitleAvmedia}]
\printbibliography[filter=online,heading=subbibintoc,title={\@bibtitleOnline}]
\end{bibhyphenation}
}%
}
%%-------------------------------------------------------------
\endinput