2 %% Autor: Wilhelm Burger (wilhelm.burger@fh-hagenberg.at)
3 %% Diese Datei ist Teil des hagenberg-Package zur Erstellung von
4 %% Bachelor- und Diplomarbeiten.
6 \NeedsTeXFormat{LaTeX2e}
7 \newcommand{\hgbDate}{2013/02/19} %Versionsdatum
8 \ProvidesPackage{hgb}[\hgbDate]
10 % options german/english are passed from the class file
11 \DeclareOption{english}{\providecommand{\hgb@MainLanguage}{english}}
12 \DeclareOption{german}{\providecommand{\hgb@MainLanguage}{german}}
16 %% ------ Shadowing conflicting symbols from other packages -------
18 % Macros for resolving name conflicts (from symbols.tex by Scott Pakin):
19 % There are a number of symbols (e.g., \Square) that are defined by %
20 % multiple packages. In order to typeset all the variants in this %
21 % document, we have to give glyph a unique name. To do that, we define %
22 % \savesymbol{XXX}, which renames a symbol from \XXX to \origXXX, and %
23 % \restoresymbol{yyy}{XXX}, which renames \origXXX back to \XXX and %
24 % defines a new command, \yyyXXX, which corresponds to the most recently %
25 % loaded version of \XXX.
26 % Wilbur: modified to use "orig@" instead of "orig" (not visible to users)
28 % Save a symbol that we know is going to get redefined.
30 \expandafter\let\expandafter\origsym\expandafter=\csname#1\endcsname
31 \expandafter\let\csname orig@#1\endcsname=\origsym
32 \expandafter\let\csname#1\endcsname=\relax
35 % Restore a previously saved symbol, and rename the current one.
36 \def\@restoresymbol#1#2{%
37 \expandafter\let\expandafter\newsym\expandafter=\csname#2\endcsname
38 \expandafter\global\expandafter\let\csname#1#2\endcsname=\newsym
39 \expandafter\let\expandafter\origsym\expandafter=\csname orig@#2\endcsname
40 \expandafter\global\expandafter\let\csname#2\endcsname=\origsym
44 %\@savesymbol{EUR} % shadows \EUR command defined in eurosym-Package
45 %\RequirePackage{marvosym} % package defines \EUR again
46 %\@restoresymbol{eurosim}{EUR} %original \EUR is now available as \eurosimEUR
48 %% ------------------ Required Packages ----------------------
50 \RequirePackage{cmap} %utf8-change
51 %\RequirePackage[latin1]{inputenc} %utf8-change
52 \RequirePackage[utf8]{inputenc} %utf8-change
53 % see http://tex.stackexchange.com/questions/1390/latin-modern-vs-cm-super
54 \RequirePackage{lmodern} %utf8-change, Latin Modern Fonts
56 % T1-Fonts zur besseren Silbentrennung bei Umlauten etc.,
57 % verwendet automatisch die cm-super Type1 Postscript Schriften
58 % (in MikTeX ab 2.4 installiert):
59 \RequirePackage[T1]{fontenc}
61 \RequirePackage{ifthen}
62 \RequirePackage[english,german,ngerman]{babel}
63 \RequirePackage{datetime}
65 \RequirePackage{eurosym} % provides \euro - conflict with marvosym on \EUR!
66 %\RequirePackage{marvosym} % provides \EUR and other unusual symbols!
68 % {\newcommand*{\euro}{\EUR}}%
71 \@ifundefined{hgb@MainLanguage}%
72 {\newcommand*{\hgb@MainLanguage}{german}}%
75 % Hauptsprache einstellen (babel):
76 \ifthenelse{\equal{\hgb@MainLanguage}{german}}%
77 {\main@language{ngerman}}{}
78 \ifthenelse{\equal{\hgb@MainLanguage}{english}}%
79 {\main@language{english}}{}
81 %\RequirePackage[fixlanguage]{babelbib} %removed for biblatex
83 %\RequirePackage[dvips]{graphicx} % zur Einbindung von EPS-Grafiken, %utf8-change
84 \RequirePackage{graphicx} %utf8-change, no dvips any longer
86 \RequirePackage[T1,hyphens,obeyspaces,spaces,lowtilde]{url}
89 \RequirePackage{verbatim}
90 \RequirePackage{moreverb}
91 \def\verbatimtabsize{2\relax}
93 %\RequirePackage[noadjust]{cite} % vermeidet zusätzliches Spacing vor [..]
95 \RequirePackage{float}
96 %\floatplacement{figure}{tbp}
97 %\floatplacement{table}{tbp}
101 % Captions mit Fontgroesse "small" und Abstand vom Seitenrand
102 \RequirePackage[small,bf]{caption}
103 \setlength{\captionmargin}{5mm}
104 \setlength{\abovecaptionskip}{10pt}
105 \setlength{\belowcaptionskip}{10pt}
107 %\RequirePackage[small,rm,loose]{subfigure}
108 %\setlength{\subfigtopskip}{7pt}
109 %\setlength{\subfigcapskip}{7pt}
110 %\setlength{\subfigcaptopadj}{0pt}
111 %\setlength{\subfigbottomskip}{-3pt}
112 %\setlength{\subfigcapmargin}{0pt}
113 %\setlength{\subfiglabelskip}{0.33em plus 0.07em minus 0.03em}
115 \RequirePackage{exscale}
116 % Skaliert Mathe-Modus Ausgaben in allen Umgebungen richtig.
118 \RequirePackage{upquote}
119 % Setzt "richtige" Quotes in verbatim-Umgebung
121 %\RequirePackage{psfrag} %utf8-change, no psfrag no more
123 % AMS-Math für mathematischen Schriftsatz
124 \RequirePackage{amsmath}
125 \RequirePackage{amsfonts}
126 \RequirePackage{amsbsy}
128 %% ---------------------- Environments -------------------------
130 %\newenvironment{sourcecode}%
131 %{\begin{minipage}{0.95\textwidth}%
134 % \begin{footnotesize}%
137 % \hrule\end{minipage}%
140 % Umschalten von Deutsch auf Englisch (babel)
141 \newenvironment{english}%
142 {\begin{otherlanguage}{english}}%
143 {\end{otherlanguage}}
145 \newenvironment{german}%
146 {\begin{otherlanguage}{ngerman}}%
147 {\end{otherlanguage}}
150 %% --------------------- Makros --------------------------------
152 %\newcommand{\latex}{{\rm \LaTeX}\xspace} % aus Bequemlichkeit
153 %\newcommand{\latex}{{\sl La\-TeX}\xspace} % kein schnoerkeliges LaTeX mehr
154 \newcommand{\latex}{La\-TeX\xspace} % kein schnoerkeliges LaTeX mehr
156 %\newcommand{\tex}{{\sl TeX}\xspace} % kein schnoerkeliges TeX mehr
157 \newcommand{\tex}{TeX\xspace} % kein schnoerkeliges TeX mehr
159 %\newcommand{\bs}{\char '134} % Backslash character
160 \newcommand{\bs}{\textbackslash} % Backslash character
163 \def\fraction#1/#2{\leavevmode\kern.0em
164 \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.1em
165 /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}
167 \newcommand\trennstrich{%
171 \noindent\makebox[\textwidth]{\rule{4cm}{0.4pt}}
174 %Div. Abkürzungen (in Anlehnung an Jochen Küpper, jkthesis):
176 \RequirePackage{xspace}
178 \newcommand{\bzgl}{bzgl.\@\xspace}
179 \newcommand{\bzw}{bzw.\@\xspace}
180 \newcommand{\ca}{ca.\@\xspace}
181 \newcommand{\dah}{d.\thinspace{}h.\@\xspace}
182 \newcommand{\Dah}{D.\thinspace{}h.\@\xspace}
183 \newcommand{\ds}{d.\thinspace{}sind\@\xspace}
184 \newcommand{\evtl}{evtl.\@\xspace}
185 \newcommand{\ia}{i.\thinspace{}Allg.\@\xspace}
186 \newcommand{\sa}{s.\ auch\@\xspace}
187 \newcommand{\so}{s.\ oben\xspace}
188 \newcommand{\su}{s.\ unten\@\xspace}
190 \newcommand{\ua}{u.\thinspace{}a.\@\xspace}
191 \newcommand{\Ua}{U.\thinspace{}a.\@\xspace}
192 \newcommand{\uae}{u.\thinspace{}Ä.\@\xspace}
193 \newcommand{\usw}{usw.\@\xspace}
194 \newcommand{\uva}{u.\thinspace{}v.\thinspace{}a.\@\xspace}
195 \newcommand{\uvm}{u.\thinspace{}v.\thinspace{}m.\@\xspace}
196 \newcommand{\va}{vor allem\@\xspace}
197 \newcommand{\vgl}{vgl.\@\xspace}
198 \newcommand{\zB}{z.\thinspace{}B.\@\xspace}
199 \newcommand{\ZB}{Zum Beispiel\xspace}
201 %Zeichen fuer die reellen, komplexen ... Zahlen (AMS Blackboard)
202 %\RequirePackage{amsfonts}
203 %\RequirePackage{amsbsy}
204 \newcommand{\R}{\ensuremath{\mathbb{R}}}
205 \newcommand{\Z}{\ensuremath{\mathbb{Z}}}
206 \newcommand{\N}{\ensuremath{\mathbb{N}}}
207 %\newcommand{\C}{\mathbb{C}} % utf8-change (problem with T1 encoding)
208 \newcommand{\Cpx}{\ensuremath{\mathbb{C}}} % utf8-change
209 \newcommand{\Q}{\ensuremath{\mathbb{Q}}}
211 %Messbox zur Druckkontrolle:
212 \newcommand{\Messbox}[2]{% Parameters: #1=Breite, #2=Hoehe
213 \setlength{\unitlength}{1.0mm}%
214 \begin{picture}(#1,#2)%
215 \linethickness{0.05mm}%
216 \put(0,0){\dashbox{0.2}(#1,#2)%
218 \centering\footnotesize
220 Breite $ = #1 {\rm\ mm}$\\
221 H\"ohe $ = #2 {\rm\ mm}$
225 %% ------------- Einstellungen fuer's Layout --------------
227 %\nonfrenchspacing % erzeugt breitere Abstände zwischen Sätzen
228 \frenchspacing % erzeugt normale Abstände zwischen Sätzen
229 %\pagestyle{headings} % Normale Kopfzeilen
231 %% div. Parameter: nur dann ändern, wenn man genau weiss was man tut!
232 %\setlength{\hoffset}{-1in}
233 %\setlength{\voffset}{-1in}
234 %\setlength{\oddsidemargin}{3cm}
235 %\setlength{\evensidemargin}{2.5cm}
236 %\setlength{\textwidth}{15.5cm}
237 %\setlength{\textheight}{22.8cm}
238 %\setlength{\topmargin}{2.54cm}
239 %\setlength{\headheight}{1ex}
240 %\setlength{\headsep}{1cm}
242 %\parskip1.5ex plus0.5ex minus0.5ex % flexibler Absatzabstand
244 % Make float placement easier
245 \renewcommand{\floatpagefraction}{.9} % vorher: .5
246 \renewcommand{\textfraction}{.01} % vorher: .2
247 \renewcommand{\topfraction}{.9} % vorher: .7
248 \renewcommand{\bottomfraction}{.7} % vorher: .3
249 \setcounter{topnumber}{3} % vorher: 2
250 \setcounter{bottomnumber}{2} % vorher: 1
251 \setcounter{totalnumber}{5} % vorher: 3
253 %% ------------- Math Stuff --------------
254 %% Problem mit Satzzeichen im Math-Modus!
255 %% Verwende Komma (statt Punkt) als Trennzeichen in Dezimalzahlen
256 %\DeclareMathSymbol{,}{\mathpunct}{letters}{"3B}
257 %\DeclareMathSymbol{.}{\mathord}{letters}{"3B}
258 %\DeclareMathSymbol{\decimal}{\mathord}{letters}{"3A}
260 %% ------------- Algorithms Stuff ---------
262 % 'algorithm' liefert die Float-Umgebung für Algorithmen (\begin{algorithm}...)
263 \@ifundefined{chapter}%
264 {\RequirePackage[ruled]{algorithm}}%
265 {\RequirePackage[ruled,chapter]{algorithm}}
267 %\floatname{algorithm}{Algorithmus}
268 %\DeclareCaptionLabelSeparator{colon}{: } % Anpassung an den standard caption style
269 \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=colon}
271 % 'algorithmicx' liefert das Innere der Algorithmen (\begin{algorithmic}[1]...)
272 \RequirePackage{algorithmicx}
273 \RequirePackage{algpseudocode}
274 \algsetlanguage{pseudocode}
275 \renewcommand{\algorithmicprocedure}{} % use no 'Procedure' keyword
279 %% ------------- Program environment / code listings --------------
281 % define the program float environment:
282 \@ifundefined{chapter}%
283 {\newfloat{program}{tbp}{lop}}%
284 {\newfloat{program}{tbp}{lop}[chapter]}
285 %\floatname{program}{Programm}
286 %\floatname{program}{\@ProgramName}
288 \restylefloat*{program}
290 \ifthenelse{\equal{\bbl@main@language}{german} \or \equal{\bbl@main@language}{ngerman}}%
291 { \floatname{program}{Programm}
292 \floatname{algorithm}{Algorithmus}
295 \ifthenelse{\equal{\bbl@main@language}{english}}%
296 { \floatname{program}{Program}
297 \floatname{algorithm}{Algorithm}
301 \RequirePackage{xcolor}
302 \definecolor{lightgray}{gray}{0.9}
303 \definecolor{midgray}{gray}{0.5}
305 \newcommand{\@MissingArg}[1]{\textcolor{red}{#1}}
307 %\RequirePackage{listings} % utf8-change
308 \RequirePackage{listingsutf8} % utf8-change
311 inputencoding=utf8, % utf8-change
312 extendedchars=true, % utf8-change
313 basicstyle=\ttfamily\footnotesize,%
314 keywordstyle=,%\ttfamily,%\bfseries,
315 identifierstyle=,%\sffamily, %\bfseries
316 commentstyle=\normalfont\itshape,%
317 stringstyle=\ttfamily,%
318 showstringspaces=false,%
319 columns = flexible,% fixed,
322 backgroundcolor=\color{lightgray},
325 framexleftmargin=6mm,
328 numberstyle=\normalfont\scriptsize,%
330 numberfirstline=true,%
331 numberblanklines=true,%
332 texcl=true,% %important: read program comments as Latex content
333 mathescape=false, %set false by default?
338 \lstset{literate=% to allow Umlauts etc. in listed code % utf8-change
348 \lstnewenvironment{JavaCode}[1][] % code environment for Java
351 escapeinside={/+}{+/},% makes "/+" and "+/" available for Latex escapes (labels etc.)
355 \lstnewenvironment{CCode}[1][] % code environment for C (ANSI)
358 escapeinside={/+}{+/},% makes "/+" and "+/" available for Latex escapes (labels etc.)
362 \lstnewenvironment{CppCode}[1][] % code environment for C++ (ISO)
365 escapeinside={/+}{+/},% makes "/+" and "+/" available for Latex escapes (labels etc.)
369 \lstnewenvironment{PhpCode}[1][]
373 escapeinside={/+}{+/},
377 \lstnewenvironment{HtmlCode}[1][]
381 escapeinside={/+}{+/},
385 \lstdefinelanguage{CSS}
386 { morekeywords={color,background,margin,padding,font,weight,display,position,top,%
387 left,right,bottom,list,style,border,size,white,space,min,width},
390 morecomment=[s]{/*}{*/},
394 \lstnewenvironment{CssCode}[1][]
398 escapeinside={/+}{+/},
402 \lstnewenvironment{XmlCode}[1][]
406 escapeinside={/+}{+/},
410 \lstdefinelanguage{JavaScript}
411 { keywords={attributes, class, classend, do, empty, endif, endwhile, fail, function,%
412 functionend, if, implements, in, inherit, inout, not, of, operations, out,
413 return, set, then, types, while, use},
416 morecomment=[s]{/*}{*/}
419 \lstnewenvironment{JsCode}[1][]
423 escapeinside={/+}{+/},
427 \lstnewenvironment{LaTeXCode}[1][] % code environment for Latex
434 escapeinside={/+}{+/},
438 \lstnewenvironment{GenericCode}[1][] % generic code environment
450 %% ------------- Experimental --------------
452 \newenvironment{NarrowList}%
454 {\setlength{\leftmargin}{2.5em}
455 \setlength{\labelwidth}{1em}
456 \setlength{\labelsep}{0.5em}
457 \setlength{\itemsep}{0.5ex}
458 \setlength{\parsep}{0ex}
459 \setlength{\topsep}{0ex}
464 \newenvironment{FileList}[1]%
465 {\paragraph{Pfad:} \url{#1}
467 {\setlength{\leftmargin}{5cm}
468 \setlength{\labelwidth}{4cm}
469 \setlength{\labelsep}{0.25cm}
470 \setlength{\rightmargin}{0cm}
471 \setlength{\itemindent}{0cm}
472 \setlength{\itemsep}{0.5ex}
473 \setlength{\parsep}{0ex}
474 \setlength{\topsep}{1ex}
479 \def\widedotfill{\leaders\hbox to 8pt{\hfil.\hfil}\hfill}
481 \newcommand{\fitem}[1]{%
482 %\item[\url{#1}\hfill]
483 %\item[\url{#1}\dotfill]
484 \item[\url{#1}\widedotfill]
487 \newcommand{\Frametext}[1]{%
488 \setlength{\fboxrule}{0.05mm}%
489 \setlength{\fboxsep}{0.5mm}%
490 \fbox{\vphantom{Ag}#1}%
493 \newcommand{\FramePic}[1]{%
494 \setlength{\fboxrule}{0.1mm}%
495 \setlength{\fboxsep}{0mm}%
499 \newcommand{\optbreaknh}{\hskip 0pt } %optional break without hyphen: e.g. PlugIn{\optbrknh}Filter
501 % Erzeugt einen neuen, nicht eingerückten Absatz
502 % mit zusätzlichem Abstand:
503 \newcommand{\SuperPar}[0]{%
504 \par\bigskip\noindent%
507 %%% Date-related commands ----------------------------------
509 \RequirePackage{datetime}
510 \showdowfalse % do not show day of week
512 % adapted from \newdate in datetime.sty
513 \newcommand*{\@modifydate}[4]{%
514 \@namedef{date@#1@d}{#2}%
515 \@namedef{date@#1@m}{#3}%
516 \@namedef{date@#1@y}{#4}%
519 \newdate{hgb@date}{\the\day}{\the\month}{\the\year}
520 \newcommand{\Date}[3]{% example for use: \Date{16}{5}{2008}
521 \@modifydate{hgb@date}{#1}{#2}{#3}
524 \newcommand{\hgb@GetDateDay}{\getdateday{hgb@date}}
525 \newcommand{\hgb@GetDateMonth}{\getdatemonth{hgb@date}}
526 \newcommand{\hgb@GetDateYear}{\getdateyear{hgb@date}}
527 \newcommand{\hgb@DisplayDate}{\displaydate{hgb@date}}
530 %\RequirePackage{hyperref} % ignores \pdfinfo commmands % utf8-change
531 \RequirePackage[unicode]{hyperref} % utf8-change
532 \definecolor{@darkblue}{RGB}{0,0,140}
533 \definecolor{@darkgreen}{RGB}{0,100,70}
535 colorlinks = true, %Colours links instead of ugly boxes
536 urlcolor = @darkblue, %Colour for external hyperlinks
537 linkcolor = @darkblue, %Colour of internal links
538 citecolor = @darkgreen %Colour of citations
539 } %see https://www.tug.org/applications/hyperref/manual.html
542 \RequirePackage[all]{hypcap} % fixes hyperref problem with references to float captions
543 %\RequirePackage[novbox]{pdfsync} % ersetzt durch -synctex=-1 option
544 %\RequirePackage[noadjust]{cite} % vermeidet zusätzliches Spacing vor [..] % entfernt wegen biblatex
546 \RequirePackage{ifpdf}
547 \ifpdf % LaTeX is in native PDF mode (pdflatex)
548 \RequirePackage{epstopdf} % zur automatischen Konvertierung von EPS-Dateien nach PDF für pdflatex
549 % \pdfcompresslevel=0 % 0 = keine Kompression, 9 = max. Kompression
550 % \pdfimageresolution=300
551 \else % LaTeX is in emulation mode (DVI-PS-PDF)
552 \RequirePackage[hyphenbreaks]{breakurl} % erlaubt Zeilenumbruch von URLs auch ohne pdflatex (DIV, PS, PDF)
555 \RequirePackage{enumitem} % fix excessive vertical spacing in lists
557 partopsep = .0ex plus .1ex,
558 topsep = .6ex plus .3ex,
559 itemsep = .0ex plus .1ex,
560 parsep = .4ex plus .2ex
562 %\setlist{nolistsep} % kein Spacing zwischen items
563 %\setlist{noitemsep} % überhaupt kein vertik. Spacing
565 %% -------------------------------------------------------
567 \newcommand{\TurnWidowsOff}{%
570 \displaywidowpenalty=10000}
572 \newenvironment{nowidows}%
578 %Beliebiger Text, in dem absolut keine Hurenkinder zugelassen werden.
581 %%How to display TeX parameters:
582 \newcommand{\ShowParameter}[1]{\relax\the#1\showthe#1}
583 %Beispiel: \ShowParameter{\clubpenalty}
585 \setlength{\parskip}{0pt plus 0.1pt}
589 %% -------------------------------------------------------