masterthesis-latex/masterthesis.sty

196 lines
4.8 KiB
Plaintext
Raw Normal View History

\NeedsTeXFormat{LaTeX2e} % specify required latex format
\ProvidesPackage{masterthesis}[2019/01/03 Masterthesis Package]
% define licence option to include a licence statement
\newif\if@uselicence\@uselicencefalse
\DeclareOption{licence}{%
\@uselicencetrue
}
% define acknowledge option to include an acknowledgement
\newif\if@acknowledge\@acknowledgefalse
\DeclareOption{acknowledge}{%
\@acknowledgetrue
}
% define abstract option to include an acknowledgement
\newif\if@abstract\@abstractfalse
\DeclareOption{abstract}{%
\@abstracttrue
}
\newif\if@library\@libraryfalse
\DeclareOption{library}{%
\@librarytrue
}
\newif\if@writeprof\@writeproffalse
\DeclareOption{writeprof}{%
\@writeproftrue
}
\newif\if@expose\@exposefalse
\DeclareOption{expose}{%
\@exposetrue
}
\ProcessOptions\relax
% load packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} % euro quality fonts [T1] (togeth. w/ textcomp)
\usepackage{textcomp, amssymb} % additional symbols (there are more packages)
\usepackage[all]{xy} % creating figures within latex
\usepackage[tight]{subfigure} % figures within figures
\usepackage{geometry}
\usepackage{soul}
\usepackage{ifpdf}
% load biblatex
\usepackage[
backend=biber,
bibstyle=ieee,
citestyle=ieee,
backref=true,
minnames=1,
maxnames=2,
]{biblatex}
% check if pdflatex is used
\ifpdf
\usepackage[pdftex]{graphicx}
\usepackage[pdftex]{color}
\usepackage[pdftex]{thumbpdf}
\usepackage[pdftex,
hidelinks = true,
colorlinks = false,%
%pagebackref=true, % bibliography -> text
linktocpage=true, % toc etc: make page number active (not name)
plainpages=false, % distinguish roman and arabic pagenumbers
bookmarksopen=true,%
bookmarksnumbered=true,%
pdfauthor={\@author},%
pdftitle={\@title},%
pdfsubject={\@subject},%
pdfkeywords={\keywords},%
]{hyperref} % clickabe references
\else
\usepackage[hypertex,
plainpages=false, % distinguish roman and arabic pagenumbers
linktocpage=true, % toc etc: make page number active (not name)
]{hyperref} % clickabe references in .dvi
% purposely included before color package
\usepackage[dvips]{color} % color package, required by xy
\usepackage[dvips]{graphicx} % graphics package
\fi
\usepackage{xcolor}
%%% load further packages
\usepackage{listings}
% simplify quoting
\usepackage{csquotes}
% support both german and english
\usepackage[ngerman,english]{babel}
\selectlanguage{english}
\KOMAoption{toc}{bibliography, index, listof}
\usepackage{makeidx}
\makeindex
\usepackage[xindy]{glossaries} % for \printglossary
\makeglossaries
%%% conditional includes
\newif\if@privatedefs\@privatedefsfalse
\IfFileExists{./private/definitions.tex}{%
\@privatedefstrue
\input{./private/definitions.tex}
}{}
\MakeOuterQuote{"}
%%% define commands
\newcommand{\start}{%
\newgeometry{centering,left=2cm,right=2cm,top=2cm,bottom=2cm}
\begin{titlepage}
\IfFileExists{./private/images/uhh-logo.pdf}{%
\includegraphics[scale=0.3]{uhh-logo}}{}
\vspace*{2cm}
\Large
\begin{center}
\if@privatedefs
\if@expose
\textcolor{uhhRed}{\textbf{\so{EXPOSE}}}
\else
\textcolor{uhhRed}{\textbf{\so{MASTERTHESIS}}}
\fi
\else
\if@expose
\textcolor{red}{\textbf{\so{EXPOSE}}}
\else
\textcolor{red}{\textbf{\so{MASTERTHESIS}}}
\fi
\fi
\vspace*{2cm}\\
{\LARGE \textbf{\@title}}
\vspace*{2cm}\\
vorgelegt von
\vspace*{0.4cm}\\
\@author
\end{center}
\vspace*{3.9cm}
\noindent
\faculty \vspace*{0.4cm} \\
\department \vspace*{0.4cm} \\
\if@writeprof
\professor \vspace*{0.4cm} \\
\else\fi
Studiengang: \studiengang \vspace*{0.4cm} \\
Matrikelnummer: \matrikelnummer \vspace*{0.8cm} \\
\if@expose\else
Erstgutachter: \firstReviewer \vspace*{0.4cm} \\
Zweitgutachter: \secondReviewer
\fi
\end{titlepage}
\restoregeometry
\if@uselicence
\input{licence.tex}
\else\fi
\if@acknowledge
\input{acknowledge.tex}
\else\fi
\if@abstract
\input{abstract.tex}
\else\fi
\tableofcontents
}
\newcommand{\finish}{%
%\clearpage
\printbibliography[heading=bibintoc]
%\clearpage
\printglossary
%\clearpage
\printindex
\clearpage
\input{declaration.tex}
\if@library
\clearpage
\input{library.tex}
\else\fi
}