-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhgb.sty
510 lines (417 loc) · 15.2 KB
/
hgb.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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
%% hgb.sty
%% Autor: Wilhelm Burger (wilhelm.burger@fh-hagenberg.at)
%% Diese Datei ist Teil des hagenberg-Package zur Erstellung von
%% Bachelor- und Diplomarbeiten.
\NeedsTeXFormat{LaTeX2e}
\newcommand{\hgbDate}{2012/05/10} %Versionsdatum
\ProvidesPackage{hgb}[\hgbDate]
% options german/english are passed from the class file
\DeclareOption{english}{\providecommand{\hgb@MainLanguage}{english}}
\DeclareOption{german}{\providecommand{\hgb@MainLanguage}{german}}
\ProcessOptions\relax
%% ------ Shadowing conflicting symbols from other packages -------
% Macros for resolving name conflicts (from symbols.tex by Scott Pakin):
% There are a number of symbols (e.g., \Square) that are defined by %
% multiple packages. In order to typeset all the variants in this %
% document, we have to give glyph a unique name. To do that, we define %
% \savesymbol{XXX}, which renames a symbol from \XXX to \origXXX, and %
% \restoresymbol{yyy}{XXX}, which renames \origXXX back to \XXX and %
% defines a new command, \yyyXXX, which corresponds to the most recently %
% loaded version of \XXX.
% Wilbur: modified to use "orig@" instead of "orig" (not visible to users)
% Save a symbol that we know is going to get redefined.
\def\@savesymbol#1{%
\expandafter\let\expandafter\origsym\expandafter=\csname#1\endcsname
\expandafter\let\csname orig@#1\endcsname=\origsym
\expandafter\let\csname#1\endcsname=\relax
}
% Restore a previously saved symbol, and rename the current one.
\def\@restoresymbol#1#2{%
\expandafter\let\expandafter\newsym\expandafter=\csname#2\endcsname
\expandafter\global\expandafter\let\csname#1#2\endcsname=\newsym
\expandafter\let\expandafter\origsym\expandafter=\csname orig@#2\endcsname
\expandafter\global\expandafter\let\csname#2\endcsname=\origsym
}
% example:
%\@savesymbol{EUR} % shadows \EUR command defined in eurosym-Package
%\RequirePackage{marvosym} % package defines \EUR again
%\@restoresymbol{eurosim}{EUR} %original \EUR is now available as \eurosimEUR
%% ------------------ Required Packages ----------------------
\RequirePackage[latin1]{inputenc}
% T1-Fonts zur besseren Silbentrennung bei Umlauten etc.,
% verwendet automatisch die cm-super Type1 Postscript Schriften
% (in MikTeX ab 2.4 installiert):
\RequirePackage[T1]{fontenc}
\RequirePackage{ifthen}
\RequirePackage[english,german,ngerman]{babel}
\RequirePackage{datetime}
\RequirePackage{eurosym} % provides \euro - conflict with marvosym on \EUR!
%\RequirePackage{marvosym} % provides \EUR and other unusual symbols!
%\@ifundefined{euro}%
% {\newcommand*{\euro}{\EUR}}%
% {}
\@ifundefined{hgb@MainLanguage}%
{\newcommand*{\hgb@MainLanguage}{german}}%
{}
% Hauptsprache einstellen (babel):
\ifthenelse{\equal{\hgb@MainLanguage}{german}}%
{\main@language{ngerman}}{}
\ifthenelse{\equal{\hgb@MainLanguage}{english}}%
{\main@language{english}}{}
%\RequirePackage[fixlanguage]{babelbib} %removed for biblatex
\RequirePackage[dvips]{graphicx} % zur Einbindung von EPS-Grafiken
\RequirePackage[T1,hyphens,obeyspaces,spaces]{url}
\urlstyle{sf}
\RequirePackage{verbatim}
\RequirePackage{moreverb}
\def\verbatimtabsize{2\relax}
%\RequirePackage[noadjust]{cite} % vermeidet zus�tzliches Spacing vor [..]
\RequirePackage{float}
%\floatplacement{figure}{tbp}
%\floatplacement{table}{tbp}
\floatstyle{plain}
% Captions mit Fontgroesse "small" und Abstand vom Seitenrand
\RequirePackage[small,bf]{caption}
\setlength{\captionmargin}{5mm}
\setlength{\abovecaptionskip}{10pt}
\setlength{\belowcaptionskip}{10pt}
%\RequirePackage[small,rm,loose]{subfigure}
%\setlength{\subfigtopskip}{7pt}
%\setlength{\subfigcapskip}{7pt}
%\setlength{\subfigcaptopadj}{0pt}
%\setlength{\subfigbottomskip}{-3pt}
%\setlength{\subfigcapmargin}{0pt}
%\setlength{\subfiglabelskip}{0.33em plus 0.07em minus 0.03em}
\RequirePackage{exscale}
% Skaliert Mathe-Modus Ausgaben in allen Umgebungen richtig.
\RequirePackage{upquote}
% Setzt "richtige" Quotes in verbatim-Umgebung
\RequirePackage{psfrag}
% AMS-Math f�r mathematischen Schriftsatz
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amsbsy}
%% ---------------------- Environments -------------------------
%\newenvironment{sourcecode}%
%{\begin{minipage}{0.95\textwidth}%
% \hrule%
% \bigskip%
% \begin{footnotesize}%
%}%
%{\end{footnotesize}
% \hrule\end{minipage}%
%}
% Umschalten von Deutsch auf Englisch (babel)
\newenvironment{english}%
{\begin{otherlanguage}{english}}%
{\end{otherlanguage}}
\newenvironment{german}%
{\begin{otherlanguage}{ngerman}}%
{\end{otherlanguage}}
%% --------------------- Makros --------------------------------
%\newcommand{\latex}{{\rm \LaTeX}\xspace} % aus Bequemlichkeit
%\newcommand{\latex}{{\sl La\-TeX}\xspace} % kein schnoerkeliges LaTeX mehr
\newcommand{\latex}{La\-TeX\xspace} % kein schnoerkeliges LaTeX mehr
%\newcommand{\tex}{{\sl TeX}\xspace} % kein schnoerkeliges TeX mehr
\newcommand{\tex}{TeX\xspace} % kein schnoerkeliges TeX mehr
%\newcommand{\bs}{\char '134} % Backslash character
\newcommand{\bs}{\textbackslash} % Backslash character
%inline fractions
\def\fraction#1/#2{\leavevmode\kern.0em
\raise.5ex\hbox{\the\scriptfont0 #1}\kern-.1em
/\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}
\newcommand\trennstrich{%
\nopagebreak[4]
\vskip 1.5ex %
% \nopagebreak[4]
\noindent\makebox[\textwidth]{\rule{4cm}{0.4pt}}
\vskip 2.5ex}
%Div. Abk�rzungen (in Anlehnung an Jochen K�pper, jkthesis):
%\usepackage{xspace}
\RequirePackage{xspace}
\newcommand{\bzgl}{bzgl.\@\xspace}
\newcommand{\bzw}{bzw.\@\xspace}
\newcommand{\ca}{ca.\@\xspace}
\newcommand{\dah}{d.\thinspace{}h.\@\xspace}
\newcommand{\Dah}{D.\thinspace{}h.\@\xspace}
\newcommand{\ds}{d.\thinspace{}sind\@\xspace}
\newcommand{\evtl}{evtl.\@\xspace}
\newcommand{\ia}{i.\thinspace{}Allg.\@\xspace}
\newcommand{\sa}{s.\ auch\@\xspace}
\newcommand{\so}{s.\ oben\xspace}
\newcommand{\su}{s.\ unten\@\xspace}
\newcommand{\ua}{u.\thinspace{}a.\@\xspace}
\newcommand{\Ua}{U.\thinspace{}a.\@\xspace}
\newcommand{\uae}{u.\thinspace{}�.\@\xspace}
\newcommand{\usw}{usw.\@\xspace}
\newcommand{\uva}{u.\thinspace{}v.\thinspace{}a.\@\xspace}
\newcommand{\uvm}{u.\thinspace{}v.\thinspace{}m.\@\xspace}
\newcommand{\va}{vor allem\@\xspace}
\newcommand{\vgl}{vgl.\@\xspace}
\newcommand{\zB}{z.\thinspace{}B.\@\xspace}
\newcommand{\ZB}{Zum Beispiel\xspace}
%Zeichen fuer die reellen, komplexen ... Zahlen (AMS Blackboard)
%\RequirePackage{amsfonts}
%\RequirePackage{amsbsy}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Q}{\mathbb{Q}}
%Messbox zur Druckkontrolle:
\newcommand{\Messbox}[2]{% Parameters: #1=Breite, #2=Hoehe
\setlength{\unitlength}{1.0mm}%
\begin{picture}(#1,#2)%
\linethickness{0.05mm}%
\put(0,0){\dashbox{0.2}(#1,#2)%
{\parbox{#1mm}{%
\centering\footnotesize
%{\bf MESSBOX}\\
Breite $ = #1 {\rm\ mm}$\\
H\"ohe $ = #2 {\rm\ mm}$
}}}\end{picture}
}
%% ------------- Einstellungen fuer's Layout --------------
%\nonfrenchspacing % erzeugt breitere Abst�nde zwischen S�tzen
\frenchspacing % erzeugt normale Abst�nde zwischen S�tzen
%\pagestyle{headings} % Normale Kopfzeilen
%% div. Parameter: nur dann �ndern, wenn man genau weiss was man tut!
%\setlength{\hoffset}{-1in}
%\setlength{\voffset}{-1in}
%\setlength{\oddsidemargin}{3cm}
%\setlength{\evensidemargin}{2.5cm}
%\setlength{\textwidth}{15.5cm}
%\setlength{\textheight}{22.8cm}
%\setlength{\topmargin}{2.54cm}
%\setlength{\headheight}{1ex}
%\setlength{\headsep}{1cm}
%\parindent0pt
%\parskip1.5ex plus0.5ex minus0.5ex % flexibler Absatzabstand
% Make float placement easier
\renewcommand{\floatpagefraction}{.9} % vorher: .5
\renewcommand{\textfraction}{.01} % vorher: .2
\renewcommand{\topfraction}{.9} % vorher: .7
\renewcommand{\bottomfraction}{.7} % vorher: .3
\setcounter{topnumber}{3} % vorher: 2
\setcounter{bottomnumber}{2} % vorher: 1
\setcounter{totalnumber}{5} % vorher: 3
%% ------------- Math Stuff --------------
%% Problem mit Satzzeichen im Math-Modus!
%% Verwende Komma (statt Punkt) als Trennzeichen in Dezimalzahlen
%\DeclareMathSymbol{,}{\mathpunct}{letters}{"3B}
%\DeclareMathSymbol{.}{\mathord}{letters}{"3B}
%\DeclareMathSymbol{\decimal}{\mathord}{letters}{"3A}
%% ------------- Algorithms Stuff ---------
% 'algorithm' liefert die Float-Umgebung f�r Algorithmen (\begin{algorithm}...)
\@ifundefined{chapter}%
{\RequirePackage[ruled]{algorithm}}%
{\RequirePackage[ruled,chapter]{algorithm}}
%\floatname{algorithm}{Algorithmus}
%\DeclareCaptionLabelSeparator{colon}{: } % Anpassung an den standard caption style
\DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=colon}
% 'algorithmicx' liefert das Innere der Algorithmen (\begin{algorithmic}[1]...)
\RequirePackage{algorithmicx}
\RequirePackage{algpseudocode}
\algsetlanguage{pseudocode}
\renewcommand{\algorithmicprocedure}{} % use no 'Procedure' keyword
%% ------------- Program environment / code listings --------------
% define the program float environment:
\@ifundefined{chapter}%
{\newfloat{program}{tbp}{lop}}%
{\newfloat{program}{tbp}{lop}[chapter]}
%\floatname{program}{Programm}
%\floatname{program}{\@ProgramName}
\floatstyle{plain}
\restylefloat*{program}
\ifthenelse{\equal{\bbl@main@language}{german} \or \equal{\bbl@main@language}{ngerman}}%
{ \floatname{program}{Programm}
\floatname{algorithm}{Algorithmus}
}{}
\ifthenelse{\equal{\bbl@main@language}{english}}%
{ \floatname{program}{Program}
\floatname{algorithm}{Algorithm}
}{}
\RequirePackage{color}
\definecolor{lightgray}{gray}{0.9}
\definecolor{midgray}{gray}{0.5}
\color{black}
\newcommand{\@MissingArg}[1]{\textcolor{red}{#1}}
\RequirePackage{listings}
\lstset{
%language=Java,%
basicstyle=\ttfamily\footnotesize,%
keywordstyle=,%\ttfamily,%\bfseries,
identifierstyle=,%\sffamily, %\bfseries
commentstyle=\normalfont\itshape,%
stringstyle=\ttfamily,%
showstringspaces=false,%
columns = flexible,% fixed,
breaklines=true,%
tabsize=2, %
backgroundcolor=\color{lightgray},
xleftmargin=6mm,%
frame=none,
framexleftmargin=6mm,
numbers=left,%
numbersep=5pt,%
numberstyle=\normalfont\scriptsize,%
stepnumber=1,%
numberfirstline=true,%
numberblanklines=true,%
texcl=true,% %important: read program comments as Latex content
mathescape=false, %set false by default?
upquote=true,%
keepspaces=true,%
}
\lstnewenvironment{JavaCode} % code environment for Java
{\lstset{%
language=Java,%
escapeinside={/+}{+/},% makes "/+" and "+/" available for Latex escapes (labels etc.)
}}
{}
\lstnewenvironment{CCode} % code environment for C (ANSI)
{\lstset{%
language=[ANSI]C,%
escapeinside={/+}{+/},% makes "/+" and "+/" available for Latex escapes (labels etc.)
}}
{}
\lstnewenvironment{CppCode} % code environment for C++ (ISO)
{\lstset{%
language=[ISO]C++,%
escapeinside={/+}{+/},% makes "/+" and "+/" available for Latex escapes (labels etc.)
}}
{}
\lstnewenvironment{PhpCode}
{\lstset{%
language=PHP,%
% mathescape=false,
escapeinside={/+}{+/}}}%
{}
\lstnewenvironment{LaTeXCode} % code environment for Latex
{\lstset{%
language=[LaTeX]TeX,%
commentstyle={},%
texcl=false,%
escapechar={},%
% escapeinside={},%
escapeinside={/+}{+/}%
% mathescape=false,
}}
{}
\lstnewenvironment{GenericCode} % generic code environment
{\lstset{%
language={},%
keepspaces=true,%
commentstyle={},%
texcl=false,%
escapechar={},%
escapeinside={},%
% mathescape=false,
}}
{}
%% ------------- Experimental --------------
\newenvironment{NarrowList}%
{\begin{list}{}%
{\setlength{\leftmargin}{2.5em}
\setlength{\labelwidth}{1em}
\setlength{\labelsep}{0.5em}
\setlength{\itemsep}{0.5ex}
\setlength{\parsep}{0ex}
\setlength{\topsep}{0ex}
\raggedright
}}%
{\end{list}}
\newenvironment{FileList}[1]%
{\paragraph{Path:} \url{#1}
\begin{list}{}%
{\setlength{\leftmargin}{5cm}
\setlength{\labelwidth}{4cm}
\setlength{\labelsep}{0.25cm}
\setlength{\rightmargin}{0cm}
\setlength{\itemindent}{0cm}
\setlength{\itemsep}{0.5ex}
\setlength{\parsep}{0ex}
\setlength{\topsep}{1ex}
\raggedright
}}%
{\end{list}}
\def\widedotfill{\leaders\hbox to 8pt{\hfil.\hfil}\hfill}
\newcommand{\fitem}[1]{%
%\item[\url{#1}\hfill]
%\item[\url{#1}\dotfill]
\item[\url{#1}\widedotfill]
}
\newcommand{\Frametext}[1]{%
\setlength{\fboxrule}{0.05mm}%
\setlength{\fboxsep}{0.5mm}%
\fbox{\vphantom{Ag}#1}%
}
\newcommand{\FramePic}[1]{%
\setlength{\fboxrule}{0.1mm}%
\setlength{\fboxsep}{0mm}%
\fbox{#1}%
}
\newcommand{\optbreaknh}{\hskip 0pt } %optional break without hyphen: e.g. PlugIn{\optbrknh}Filter
% Erzeugt einen neuen, nicht einger�ckten Absatz
% mit zus�tzlichem Abstand:
\newcommand{\SuperPar}[0]{%
\par\bigskip\noindent%
}
%%% Date-related commands ----------------------------------
\RequirePackage{datetime}
\showdowfalse % do not show day of week
% adapted from \newdate in datetime.sty
\newcommand*{\@modifydate}[4]{%
\@namedef{date@#1@d}{#2}%
\@namedef{date@#1@m}{#3}%
\@namedef{date@#1@y}{#4}%
}
\newdate{hgb@date}{\the\day}{\the\month}{\the\year}
\newcommand{\Date}[3]{% example for use: \Date{16}{5}{2008}
\@modifydate{hgb@date}{#1}{#2}{#3}
}
\newcommand{\hgb@GetDateDay}{\getdateday{hgb@date}}
\newcommand{\hgb@GetDateMonth}{\getdatemonth{hgb@date}}
\newcommand{\hgb@GetDateYear}{\getdateyear{hgb@date}}
\newcommand{\hgb@DisplayDate}{\displaydate{hgb@date}}
%%% Experimental:
\RequirePackage{hyperref} % ignores \pdfinfo commmands
\RequirePackage[all]{hypcap} % fixes hyperref problem with references to float captions
%\RequirePackage[novbox]{pdfsync} % ersetzt durch -synctex=-1 option
%\RequirePackage[noadjust]{cite} % vermeidet zus�tzliches Spacing vor [..] % entfernt wegen biblatex
\RequirePackage{ifpdf}
\ifpdf % LaTeX is in native PDF mode (pdflatex)
\RequirePackage{epstopdf} % zur automatischen Konvertierung von EPS-Dateien nach PDF f�r pdflatex
% \pdfcompresslevel=0 % 0 = keine Kompression, 9 = max. Kompression
% \pdfimageresolution=300
\else % LaTeX is in emulation mode (DVI-PS-PDF)
\RequirePackage[hyphenbreaks]{breakurl} % erlaubt Zeilenumbruch von URLs auch ohne pdflatex (DIV, PS, PDF)
\fi
\RequirePackage{enumitem} % fix excessive vertical spacing in lists
\setlist{%
partopsep = .0ex plus .1ex,
topsep = .6ex plus .3ex,
itemsep = .0ex plus .1ex,
parsep = .4ex plus .2ex
}
%\setlist{nolistsep} % kein Spacing zwischen items
%\setlist{noitemsep} % �berhaupt kein vertik. Spacing
%% -------------------------------------------------------
\newcommand{\TurnWidowsOff}{%
\clubpenalty=10000%
\widowpenalty=10000%
\displaywidowpenalty=10000}
\newenvironment{nowidows}%
{\TurnWidowsOff}%
{}
%%Beispiel
%\begin{nowidows}
%Beliebiger Text, in dem absolut keine Hurenkinder zugelassen werden.
%\end{nowidows}
%%How to display TeX parameters:
\newcommand{\ShowParameter}[1]{\relax\the#1\showthe#1}
%Beispiel: \ShowParameter{\clubpenalty}
\setlength{\parskip}{0pt plus 0.1pt}
%\flushbottom
\raggedbottom
%% -------------------------------------------------------