Skip to content
Snippets Groups Projects
HsH-classes.dtx 64.3 KiB
Newer Older
  • Learn to ignore specific revisions
  • %     For the \pkg{bibtex} we ensure the \emph{biber} backend is selcted, which matches
    %     the settings in |.latexmkrc|.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    %<*article|report>
    \PassOptionsToPackage{backend=biber}{biblatex}
    \AtBeginDocument{
      \makeatletter
      \@ifpackageloaded{biblatex}{
        \renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}}
      }{}%
      \makeatother
    }
    %</article|report>
    
    %     For \pkg{bibtex} we load the free-stadnding units, mostly for backwards compatibility.
    %     We also ensure german language specific settings are applyed.
    
    \PassOptionsToPackage{free-standing-units}{siunitx}
    
    \AtBeginDocument{
      \makeatletter
      \@ifpackageloaded{siunitx}{
        \iflanguage{ngerman}{
          \sisetup{output-decimal-marker={,}}
        }{}
      }{}
      \makeatother
    }
    %    \end{macrocode}
    %
    
    %     For better compatibility with the \pkg{listings} package we load the
    %     \pkg{scrhack} package. We also pass some configurations to if if it gets loaded.
    
    %    \begin{macrocode}
    \RequirePackage{scrhack}
    \AtBeginDocument{
      \makeatletter
    
        \RequirePackage{lstautogobble}\lstset{autogobble=true}
        \iflanguage{ngerman}{
          \lstset{literate={Ö}{{\"O}}1{Ä}{{\"A}}1{Ü}{{\"U}}1{ß}{{\ss}}1{ü}{{\"u}}1{ä}{{\"a}}1{ö}{{\"o}}1}
        }{}
      }{}
      \makeatother
    }
    %    \end{macrocode}
    %
    
    %     The \pkg{circuitikz} needs bo be configure so it matches typical european styles.
    
    Jan Wille's avatar
    Jan Wille committed
    \PassOptionsToPackage{european,EFvoltages,straightvoltages,betterproportions}{circuitikz}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    %
    
    %     For other packages we provide the settings more as a recomendation of what is
    %     usefull. As the user might want to change these, we outsource this to a seperat file
    %     and input it |\AtBeginDocument|. That way the user can just replace the file with his
    %     custom version.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \AtBeginDocument{
      \makeatletter
      \InputIfFileExists{HsH-classes.cfg}{
        \ClassInfo{\HsHClassName}{Local config file HsH-classes.cfg used.}
      }{
        \ClassInfo{\HsHClassName}{No HsH-classes.cfg!! I hope you configered it yourself.}
      }
      \makeatother
    }
    %    \end{macrocode}
    %
    
    % \subsection{Custom commands}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %   \subsubsection{Document seperation commands}
    %     The following commands are only defnied for \cls{book} type classes by default.
    %     But they are also usefull for the \cls{report} class, so we define them in that case.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    %<*report>
    %    \end{macrocode}
    %
    
    %     \begin{macro}{\if@mainmatter}
    %       We define a switch which stores if the document is currently at a mainmatter
    %       section. Ir defaults to |true| as the user needs to explicitly set the state to
    %       something differnt.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newif\if@mainmatter\@mainmattertrue
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     As a pagenumber change requires a fresh page, this is ensured first. We also
    %     need to make sure that on twosided document, the first page is alwasy on the
    %     left.
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\frontmatter}
    %       The pagenumbering is set to capital roman numerals.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand{\frontmatter}{
      \if@twoside\cleardoubleoddpage\else\clearpage\fi
      \@mainmatterfalse\pagenumbering{Roman}
    }
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\mainmatter}
    %       The pagenumbering is set to arabic numerals.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand{\mainmatter}{
      \if@twoside\cleardoubleoddpage\else\clearpage\fi
      \@mainmattertrue\pagenumbering{arabic}
    }
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\backmatter}
    %       The pagenumbering is set to arabic numerals.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand{\backmatter}{
      \if@openright\cleardoubleoddpage\else\clearpage\fi
      \@mainmatterfalse\pagenumbering{roman}
    }
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    %    \begin{macrocode}
    %</report>
    %    \end{macrocode}
    %
    %
    
    %   \subsubsection{The Logo for Hochschule Hannover}
    %     The following macros are responsible for creating the logo. They load a specific
    %     page of a PDF file and siplay it.
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\HsHlogoPath}
    %       This macro contains the path to load the PDF from. It defaults to
    %       |HSH-Logo.pdf|, which is provieded by this project inside the |scr/| folder.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand{\HsHlogoPath}{HSH-Logo.pdf}
    %    \end{macrocode}
    
    %     \end{macro}
    
    %     \begin{macro}{\HsHlogoPage}
    %       This macro stores the page to use from the PDF. It will be set via the
    %       documentoption \opt{faculty}.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand{\HsHlogoPage}{\HsH@opt@faculty}
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\includeHsHlogohere}
    %       Calling this macro produces the logo in-place. You can specify the width as an
    %       optional argument. The default is $5\,\mathrm{cm}$. \par
    %       If the file provided via \cmd{\HsHlogoPath} doesn't exist, the command will
    %       produce an error.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand{\includeHsHlogohere}[1][5cm]{
      \IfFileExists{\HsHlogoPath}{
        \includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}
      }{
        \ClassError{\HsHClassName}{\HsHlogoPath\space not found!}{
          The HsH Logo is necasary for the titlepage! Try putting it next to your source file or use \HsHlogoPath to define the file location
        }
      }
    }
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %   \subsubsection{Title matters}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    %
    
    %     The following commands relave to the creation of the titlepage. They Implement
    %     how the user can define the differnt datafields.
    %     \smallskip
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\title}
    %       We redefine the |\title| command to take a optional argument. This is stored in
    %       the additional |\@shorttitle| macro.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    \renewcommand{\title}[2][]{
      \gdef\@title{#2}
      \gdef\@shorttitle{#1}
    }
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\@shorttitle}
    %       This new macro stores a short version of the title. This will be used in places
    %       where the fill title might overflow the availabel space.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \def\@shorttitle{\@empty}
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\gdef@with@and@as@comma}
    %       First we define a helpermacro that will fill a given macro while treating the
    %       |\and| command as a comma. This is needed for |\author| and |\matrikelnr| where
    %       we later treat them as comma-seperated lists when the titlepage gets constructed.
    %    \begin{macrocode}
    \def\gdef@with@and@as@comma#1#2{{\def\and{,}\xdef#1{#2}}}
    %    \end{macrocode}
    %     \end{macro}
    %
    %     \begin{macro}{\author}
    %       We redefine the |\author| command so that it sets |\@author|, but allowing for both
    %       comma and |\and| to be used as a seperator.
    %    \begin{macrocode}
    \renewcommand{\author}[1]{\gdef@with@and@as@comma\@author{#1}}
    %    \end{macrocode}
    %     The |\@author| macro is also set to |\@empty|, this makes it easier to handle it
    %     later.
    %    \begin{macrocode}
    \let\@author\@empty
    %    \end{macrocode}
    %     \end{macro}
    %
    
    %     \begin{macro}{\matrikelnr,\@matrikelnr}
    %       These macros set and store the matrikel-number (or set of numbers), which will
    %       be printed on the titlepage.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    \newcommand{\matrikelnr}[1]{\gdef@with@and@as@comma\@matrikelnr{#1}}
    
    Jan Wille's avatar
    Jan Wille committed
    \def\@matrikelnr{\@empty}
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\professor,\firstexaminer,\secondexaminer,\@professor,\@firstexaminer,\@secondexaminer}
    %       These three macros-groups give options to the user to print peoples names on
    %       the titlepage, who are relevant to the document, but not the author.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    \newcommand{\professor}[1]{\gdef\@professor{#1}}
    
    Jan Wille's avatar
    Jan Wille committed
    \def\@professor{\@empty}
    
    \newcommand{\firstexaminer}[1]{\gdef\@firstexaminer{#1}}
    
    Jan Wille's avatar
    Jan Wille committed
    \def\@firstexaminer{\@empty}
    
    \newcommand{\secondexaminer}[1]{\gdef\@secondexaminer{#1}}
    
    Jan Wille's avatar
    Jan Wille committed
    \def\@secondexaminer{\@empty}
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\keywords,\@keywords}
    %       The macro-group defines and holds keywords which describe the document. They
    %       are used when printing the abstract as well as in the PDF's meta-data.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    \newcommand{\keywords}[1]{\gdef\@keywords{#1}}
    
    Jan Wille's avatar
    Jan Wille committed
    \def\@keywords{\@empty}
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    %    \begin{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    %
    
    %   \subsubsection{Commands for document writing}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\declarationofauthorship}
    %       The declatation of authorship is not relevant for the \cls{standalone} varaiant.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    %<*!stadnalone>
    %    \end{macrocode}
    
    %       The \pkg{pgffor} package is requried to handle the loope over the list of authors.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \RequirePackage{pgffor}
    %    \end{macrocode}
    
    %       Now the command is defined. It takes a optional argument which defaults to \opt{b}.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand{\declarationofauthorship}[1][b]{
    %    \end{macrocode}
    
    %       First the argument is passed and an error raised for invalid arguments. Passing
    %       in \opt{b} will push the declatarion to the bottom of the page and add a
    %       horizontal line. PAssing \opt{t} simply adds some space.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
      \if#1b
        \vspace*{\fill}
        \hrule
      \else\if#1t
        \vspace*{2em}
      \else
        \ClassError{\HsHClassName}{Wrong Parameter for `\declarationofauthorship'}{
          `\string\declarationofauthorship' only accepts `t' and `b' as parameters.
        }
      \fi\fi
    %    \end{macrocode}
    
    %       Now the actuall declatarion can be constructed. It uses the text from |\decofauthname|
    %       and |\decofauthtext|.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
      \vskip 3em
      {\centering\bfseries\usekomafont{section}{\decofauthname}\par}
      \vskip 3em
      \decofauthtext\par
    %    \end{macrocode}
    
    %       The last step is to loop over all authors by reading |\@author| and creating a
    %       signature box for each one. |\thanks| also needs to be cleared, as a footnote
    %       wouldn't make sense here.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
      \begingroup
        \renewcommand{\thanks}{\sbox0}
        \raggedleft
        \foreach \tmp@ in \@author {
          \if\tmp@\empty\else
            \hskip 1em \parbox{4cm}{
              \vskip 4em
              \hrule\vskip 4pt
              \raggedleft\footnotesize\tmp@
            }%
          \fi
        }\par
      \endgroup
    }
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\if@singleauthor}
    
    %       To ensure |\decofauthtext| is preperly spelled for one or multiple authors, we
    %       define a conditional that holds this information. Additionally we check the
    %       number of authors |\AtBeginDocument| and store it.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    \AtBeginDocument{
      \begingroup
        \newcount\count@
        \count@=\z@
        \@for\tmp@:=\@author\do{\advance\count@\@ne}
    
        \ifnum\count@>\@ne\global\@singleauthorfalse\else\global\@singleauthortrue\fi
    
    Jan Wille's avatar
    Jan Wille committed
      \endgroup
    }
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\ifsingleauthor}
    %       A macro to simply act on this condition is also provided. It will be used in
    %       text-definitions later on.
    %    \begin{macrocode}
    \newcommand{\ifsingleauthor}[2]{\if@singleauthor#1\else#2\fi}
    %    \end{macrocode}
    %     \end{macro}
    %
    
    %     \begin{macro}{\declarationAuthorship}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \def\declarationAuthorship{%
      \ClassWarning{\HsHClassName}{%
        Command \string\declarationAuthorship\space is deprecate.\MessageBreak
        Replace it with \string\declarationofauthorship.
      }%
      \declarationofauthorship%
    }
    %</!stadnalone>
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %   \subsubsection{Micalanious commands}
    %     \vspace{-1\baselineskip}
    %     \paragraph{Utillity commands}
    %     For writing absolout values, we provide the \cmd{\abs\marg{equ}} command, which
    %     puts groable, vertical bars on both sides of the equation inside.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}}
    %    \end{macrocode}
    %
    
    %     \paragraph{Configuring mathmode-indices}
    %     The only hard requirements for documents writing on Hochschule Hannover is, that
    %     the indices in mathematic formulas must be typset in an upright ("steil") font,
    %     not the default kursive font. We configure this by first defining a macro to
    %     replace the default \cmd{\sb} macro. We can than assign this to |_|. For that to
    %     work we need to change its catcode to make it modifyable.
    %     \begin{note}
    %       You can allways use \cmd{\sb} to use the original behaviour for special cases.
    %     \end{note}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \def\@subinrm#1{\sb{\mathrm{#1}}}
    {\catcode`\_=13 \global\let_=\@subinrm}
    %    \end{macrocode}
    %
    
    %     \begin{macro}{\upsubscripts}
    %       Now we can define a command to activate this new behavior by changing the catcode
    %       of |_| to 13, which makes it a normal macro.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand\upsubscripts{\catcode`\_=12}
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     \begin{macro}{\normalsubscripts}
    %       To switch back we simply need to reset the catcode of |_| back to the original,
    %       which makes it a buildin operator with the default behavior.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \newcommand\normalsubscripts{\catcode`\_=8}
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    % \subsection{Document setup}
    %   The following sets up the look and feel of the documents using this classe. All
    %   configuration and stylin is done here.
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %   \subsubsection{Fonts and text styling}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \RequirePackage{lmodern}
    %    \end{macrocode}
    %
    
    %   \subsubsection{Page layout}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    %<*!standalone>
    \areaset[current]{0.75\paperwidth}{0.8\paperheight}
    \if@todos
      \addtolength\paperwidth{5cm}
      \addtolength\marginparwidth{5cm}
    \fi
    %</!standalone>
    %    \end{macrocode}
    %
    
    %   \subsubsection{Styling \LaTeX{} default constucts}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    Jan Wille's avatar
    Jan Wille committed
    %     \vspace{-1\baselineskip}
    %     \paragraph{Floats}\vspace{-1\baselineskip}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    %<*!standalone>
    %    \end{macrocode}
    
    %     Floats should alwasy prefere the \emph{here} placement, than the \emph{top} of
    %     the following page.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \renewcommand{\fps@figure}{h!t}
    \renewcommand{\fps@table}{h!t}
    %    \end{macrocode}
    %
    
    %     Floats should be centered by default and the width of the caption box is limited.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \g@addto@macro\@floatboxreset\centering
    \setcapwidth{0.8\textwidth}
    %    \end{macrocode}
    %
    
    %     The names of floating enviroments are redefined to show abreviations only.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \defcaptionname{english}\figurename{Fig.}
    \defcaptionname{german,ngerman}\figurename{Abb.}
    \defcaptionname{english}\tablename{Tab.}
    \defcaptionname{german,ngerman}\tablename{Tab.}
    %    \end{macrocode}
    %
    
    %     For subfigures we need to define a name used in autoreferences.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \AtBeginDocument{
      \makeatletter
      \@ifpackageloaded{subfigure}{
        \let\subfigureautorefname\figureautorefname
      }{}%
      \makeatother
    }
    %    \end{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    %</!standalone>
    %    \end{macrocode}
    %
    
    %     \paragraph{Lists}
    %     For unordert liste the markers are redefined to look a littel nicer.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \renewcommand{\labelitemi}{\raisebox{.3ex}{\scalebox{0.7}{$\bullet$}}}
    \renewcommand{\labelitemii}{\raisebox{.3ex}{\scalebox{0.7}{$\circ$}}}
    \renewcommand{\labelitemiii}{\raisebox{.1ex}{-}}
    \renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}}
    %    \end{macrocode}
    %
    
    Jan Wille's avatar
    Jan Wille committed
    %     \paragraph{Abstract}
    %     We define some custom behavior for the abstract.
    %    \begin{macrocode}
    
    %<*!standalone>
    
    Jan Wille's avatar
    Jan Wille committed
    \renewenvironment{abstract}{
      \quotation
      \setparsizes{\z@}{\z@}{.25\linewidth \@plus 1fil}\selectfont
    
      \HsH@abstract@heading{\abstractname}
    
    Jan Wille's avatar
    Jan Wille committed
    }{%
      \ifx\@keywords\@empty\else\if@HsH@option@abstract@show@keywords
        \par\bigskip
        \noindent\textbf{\keywordsname}\hskip 2em\@keywords
      \fi\fi\par
      \endquotation
    }
    
    %</!standalone>
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    %
    
    %     \paragraph{Misc}
    %     We activae one of the commands defined above to make math-indices upright by
    %     default.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    \upsubscripts
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    %
    
    %     We want a ragged botton instead of spreading the paragraphs over the page.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \raggedbottom
    %    \end{macrocode}
    
    %     The ruler shown in the top and left margin with the \opt{draft} option is
    %     removed.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \let\layercontentsmeasure\relax
    %    \end{macrocode}
    %
    
    %   \subsubsection{Header and footer}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    %    \begin{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    %<*article|report>
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    %
    
    %     The header and footer are styled using the low-level commands provided by the
    %     \KOMAScript{} package \pkg{scrlayer-scrpage}.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \RequirePackage{scrlayer-scrpage}
    \FamilyOptions{KOMA}{headsepline,singlespacing=true}
    %    \end{macrocode}
    %
    
    %     First we define the new pagestyle |HsHheadings|.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    \newpagestyle{HsHheadings}{
      {
    
        \parbox[b]{\sls@headwidth}{
          \LaTeXraggedright
          \ifx\@shorttitle\@empty\@title\else\@shorttitle\fi
        }%
      }
    
      {
        \parbox[b]{\sls@headwidth}{
          \LaTeXraggedleft
          \leftmark
        }%
      }
    
      {
        \parbox[b]{.45\sls@headwidth}{
          \LaTeXraggedright
          \ifx\@shorttitle\@empty\@title\else\@shorttitle\fi
        }%
    
        \parbox[b]{.45\sls@headwidth}{
          \LaTeXraggedleft
          \headmark
        }%
    
      }
      (\textwidth,.1pt)
    }{
      {\pagemark}
      {\hfill\pagemark}
      {\hfill\pagemark}
    }
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    
    %     Than all generic settings are applyed:
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    \clearpairofpagestyles
    \ofoot*{\pagemark}
    
    \pagestyle{HsHheadings}
    
    Jan Wille's avatar
    Jan Wille committed
    %<article>\automark{section}
    
    %<report>\automark{chapter}
    
    %<report>\renewcommand*{\chapterpagestyle}{HsHheadings}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    %</article|report>
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    
    %   \subsubsection{Titlepage}
    
    %     \begin{macro}{\maketitle}
    
    %       |\maketitle| is a wrapper for |\@maketitle| that just checks the
    %       parameter and issues an error message if it is incorrect.
    %       It also handles the diffrent default for article or report.
    
    Jan Wille's avatar
    Jan Wille committed
    %    \begin{macrocode}
    
    %<*article|report>
    
    %<article>\renewcommand\maketitle[1][c]{
    %<report>\renewcommand\maketitle[1][l]{
      \if#1l\@maketitle{#1}\else%
      \if#1c\@maketitle{#1}\else%
      \if#1r\@maketitle{#1}\else%
        \ClassWarning{\HsHClassName}{unkown option for \maketitle}
        \thispagestyle{empty}\null\clearpage
      \fi\fi\fi
    }
    %    \end{macrocode}
    %     \end{macro}
    %
    %     \begin{macro}{\@maketitle}
    %       The definiton of |\@maketitle| is mostly taken from the source-code of the
    %       \KOMAScript{} parrentclass, but was modified to create the desired style.
    %    \begin{macrocode}
    
    Jan Wille's avatar
    Jan Wille committed
    \newtoks\@tabtoks
    \newcommand\addtabtoks[1]{\global\@tabtoks\expandafter{\the\@tabtoks#1}}
    \newcommand\eaddtabtoks[1]{\edef\mytmp{#1}\expandafter\addtabtoks\expandafter{\mytmp}}
    
    %%%\newcommand*\resettabtoks{\global\@tabtoks{}}
    
    Jan Wille's avatar
    Jan Wille committed
    \newcommand*\printtabtoks{\the\@tabtoks}
    \addtokomafont{publishers}{\normalsize}
    
    Jan Wille's avatar
    Jan Wille committed
    \g@addto@macro\titlepage{\singlespacing}
    
    \renewcommand*\@maketitle[1]{
    
    Jan Wille's avatar
    Jan Wille committed
      \expandafter\ifnum \csname scr@v@3.12\endcsname>\scr@compatibility\relax
      \else
        \def\and{%
          \end{tabular}
          \hskip 1em \@plus.17fil
          \begin{tabular}[t]{c}%
        }
      \fi
    %<*article>
      \par
      \ifx\@uppertitleback\@empty\else
        \ClassWarning{\KOMAClassName}{%
          non empty \string\uppertitleback\space ignored
          by \string\maketitle\MessageBreak
          in `titlepage=false' mode%
        }
      \fi
      \ifx\@lowertitleback\@empty\else
        \ClassWarning{\KOMAClassName}{%
          non empty \string\lowertitleback\space ignored
          by \string\maketitle\MessageBreak
          in `titlepage=false' mode%
        }
      \fi
    %</article>
    %<report>  \begin{titlepage}
    %<article>  \begingroup
    %<*report>
        \if@titlepageiscoverpage
          \edef\titlepage@restore{
            \noexpand\endgroup
            \noexpand\global\noexpand\@colht\the\@colht
            \noexpand\global\noexpand\@colroom\the\@colroom
            \noexpand\global\vsize\the\vsize
            \noexpand\global\noexpand\@titlepageiscoverpagefalse
            \noexpand\let\noexpand\titlepage@restore\noexpand\relax
          }
          \begingroup
          \topmargin=\dimexpr \coverpagetopmargin-1in\relax
          \oddsidemargin=\dimexpr \coverpageleftmargin-1in\relax
          \evensidemargin=\dimexpr \coverpageleftmargin-1in\relax
          \textwidth=\dimexpr
          \paperwidth-\coverpageleftmargin-\coverpagerightmargin\relax
          \textheight=\dimexpr
          \paperheight-\coverpagetopmargin-\coverpagebottommargin\relax
          \headheight=0pt
          \headsep=0pt
          \footskip=\baselineskip
          \@colht=\textheight
          \@colroom=\textheight
          \vsize=\textheight
          \columnwidth=\textwidth
          \hsize=\columnwidth
          \linewidth=\hsize
        \else
          \let\titlepage@restore\relax
        \fi
        \let\footnotesize\small
        \let\footnoterule\relax
        \let\footnote\thanks
    %</report>
    %<article>    \let\titlepage@restore\relax
        \renewcommand*\thefootnote{\@fnsymbol\c@footnote}%
        \let\@oldmakefnmark\@makefnmark
        \renewcommand*{\@makefnmark}{\rlap\@oldmakefnmark}%
    %<article>    \next@tdpage
        \ifx\@extratitle\@empty
    %<article>      \ifx\@frontispiece\@empty\else \mbox{}\fi
    %<*report>
          \ifx\@frontispiece\@empty\else
            \if@twoside\mbox{}\next@tpage\fi
            \noindent\@frontispiece\next@tdpage
          \fi
    %</report>
        \else
    %<article>      \@makeextratitle
    %<*report>
          \noindent\@extratitle
          \ifx\@frontispiece\@empty
          \else
            \next@tpage
            \noindent\@frontispiece
          \fi
          \next@tdpage
    %</report>
        \fi
    %<*article>
        \ifx\@frontispiece\@empty
          \ifx\@extratitle\@empty\else\next@tdpage\fi
        \else
          \next@tpage
          \@makefrontispiece
          \next@tdpage
        \fi
        \global\@topnum=\z@
    %</article>
        \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
        \vspace*{1cm}
        \begin{minipage}[t]{\textwidth}%
          \ifx\@titlehead\@empty \else
            \usekomafont{titlehead}{\@titlehead}%
          \fi
          \hfill
    % image with referrencepoint in lower left corner:
          \raisebox{0pt}[\ht\strutbox][\dp\strutbox]{\includeHsHlogohere}
        \end{minipage}
        \raisebox{10pt}{\rule{\textwidth}{0.5pt}}
        \null
    %<article>    \vskip 2em
    %<report>    \vfill
        \begingroup
    
          \if#1c\centering\fi
          \if#1r\raggedleft\fi
    
    Jan Wille's avatar
    Jan Wille committed
          \ifx\@subject\@empty\else
            {\usekomafont{subject}{\@subject\par}}
    %<article>        \vskip 1.5em
    %<report>        \vskip 3em
          \fi
          {\usekomafont{title}{\huge\@title\par}}
    %<article>      \vskip .5em
    %<report>      \vskip 1em
          {\ifx\@subtitle\@empty\else\usekomafont{subtitle}\@subtitle\par\fi}
    %<article|report>      \vskip 4em
          {\ifx\@matrikelnr\@empty
            \if\@author\@empty\else\usekomafont{author}{
              \parbox{\dimexpr\linewidth}{
    
                \if#1c\centering\fi
                \if#1r\raggedleft\fi
    
    Jan Wille's avatar
    Jan Wille committed
                \@author
              }
            }\fi
          \else
            \if\@author\@empty\else
              % sneeky comma needed after \@matrikelnr to deal with single item lists
              \foreach \x [count=\i,evaluate=\i as \y using {{\@matrikelnr,}[\i-1]}] in \@author {\eaddtabtoks{\x & \y\protect\\}}
    
              \usekomafont{author}{
                \def\arraystretch{1.2}
    
                \if#1l\begin{tabular}{@{}l l}\fi
                \if#1c\begin{tabular}{l l}\fi
                \if#1r\begin{tabular}{r r@{}}\fi
    
    Jan Wille's avatar
    Jan Wille committed
                  \printtabtoks
                \end{tabular}
    
    Jan Wille's avatar
    Jan Wille committed
            \fi
          \fi}
    %<article>      \vskip 1em
    %<report>      \vskip 1.5em
          {\usekomafont{date}{\@date\par}}
    %<article>      \vskip 1em
    %<report>      \vskip \z@ \@plus3fill
    
          \usekomafont{publishers}{
            \def\arraystretch{1.2}
    
            \if#1l\begin{tabular}{@{}l l}\fi
            \if#1c\begin{tabular}{l l}\fi
            \if#1r\begin{tabular}{r r@{}}\fi
    
              \if\@professor\@empty\else\textbf{\professorname:}&\@professor\\\fi
              \if\@firstexaminer\@empty\else\textbf{\firstexaminername:}&\@firstexaminer\\\fi
              \if\@secondexaminer\@empty\else\textbf{\secondexaminername:}&\@secondexaminer\\\fi
    
    Jan Wille's avatar
    Jan Wille committed
    %<*article>
          \ifx\@dedication\@empty\else
            \vskip 2em
            {\usekomafont{dedication}{\@dedication \par}}%
          \fi
    %</article>
          \par
        \endgroup
    %<article>    \vskip 2em
    %<report>    \vskip 3em
    %<article>    \ifx\titlepagestyle\@empty\else\thispagestyle{\titlepagestyle}\fi
        \@thanks\global\let\@thanks\@empty
    %<*report>
        \vfill\null
        \if@twoside
          \@tempswatrue
          \expandafter\ifnum \@nameuse{scr@v@3.12}>\scr@compatibility\relax
          \else
            \ifx\@uppertitleback\@empty\ifx\@lowertitleback\@empty
              \@tempswafalse
            \fi\fi
          \fi
          \if@tempswa
            \next@tpage
            \begin{minipage}[t]{\textwidth}
              \@uppertitleback
            \end{minipage}\par
            \vfill
            \begin{minipage}[b]{\textwidth}
              \@lowertitleback
            \end{minipage}\par
            \@thanks\global\let\@thanks\@empty
          \fi
        \else
          \ifx\@uppertitleback\@empty\else
            \ClassWarning{\KOMAClassName}{%
              non empty \string\uppertitleback\space ignored
              by \string\maketitle\MessageBreak
              in `twoside=false' mode%
            }
          \fi
          \ifx\@lowertitleback\@empty\else
            \ClassWarning{\KOMAClassName}{%
              non empty \string\lowertitleback\space ignored
              by \string\maketitle\MessageBreak
              in `twoside=false' mode%
            }
          \fi
        \fi
        \ifx\@dedication\@empty
        \else
          \next@tdpage\null\vfill
          {\centering\usekomafont{dedication}{\@dedication \par}}%
          \vskip \z@ \@plus3fill
          \@thanks\global\let\@thanks\@empty
          \cleardoubleemptypage
        \fi
        \ifx\titlepage@restore\relax\else\clearpage\titlepage@restore\fi
    %</report>
    %<article>  \endgroup
    %<report>  \end{titlepage}
      \setcounter{footnote}{0}
      \expandafter\ifnum \csname scr@v@3.12\endcsname>\scr@compatibility\relax
        \let\thanks\relax
        \let\maketitle\relax
        \let\@maketitle\relax
        \global\let\@thanks\@empty
        \global\let\@author\@empty
        \global\let\@date\@empty
        \global\let\@title\@empty
        \global\let\@subtitle\@empty
        \global\let\@extratitle\@empty
        \global\let\@frontispiece\@empty
        \global\let\@titlehead\@empty
        \global\let\@subject\@empty
        \global\let\@publishers\@empty
        \global\let\@uppertitleback\@empty
        \global\let\@lowertitleback\@empty
        \global\let\@dedication\@empty
        \global\let\@matrikelnr\@empty
    
    Jan Wille's avatar
    Jan Wille committed
        \global\let\@professor\@empty
    
    Jan Wille's avatar
    Jan Wille committed
        \global\let\author\relax
        \global\let\title\relax
        \global\let\extratitle\relax
        \global\let\titlehead\relax
        \global\let\subject\relax
        \global\let\publishers\relax
        \global\let\uppertitleback\relax
        \global\let\lowertitleback\relax
        \global\let\dedication\relax
        \global\let\date\relax
        \global\let\matrikelnr\relax
        \global\let\professor\relax
      \fi
      \global\let\and\relax
    }
    %</article|report>
    
    Jan Wille's avatar
    Jan Wille committed
    %    \end{macrocode}
    
    %     \end{macro}
    
    Jan Wille's avatar
    Jan Wille committed
    %\iffalse docstrip-guard
    %</article|report|standalone>
    %\fi
    
    %  \subsection{Localisation}
    %    The following section contains language specific definitons of text used by the classes.
    %\iffalse docstrip-guard
    %<*localisation>
    %\fi
    %
    %     \begin{macro}{\professorname,\firstexaminername,\secondexaminername}
    %       Define the commands content for the different supported languages.
    %    \begin{macrocode}
    \newcaptionname{english}\professorname{Professor}
    \newcaptionname{german,ngerman}\professorname{Professor(in)/Lehrbeauftragte(r)}
    \newcaptionname{english}\firstexaminername{First examiner}
    \newcaptionname{german,ngerman}\firstexaminername{Erstpr{\"u}fer(in)}
    \newcaptionname{english}\secondexaminername{Second examiner}
    \newcaptionname{german,ngerman}\secondexaminername{Zweitpr{\"u}fer(in)}
    %    \end{macrocode}
    %     \end{macro}
    %
    %     \begin{macro}{\decofauthname}
    %       Define the german translations for the command.
    %    \begin{macrocode}
    \newcaptionname{english}\decofauthname{Declaration of Authorship}
    \newcaptionname{german,ngerman}\decofauthname{Selbstst{\"a}ndigkeitserkl{\"a}rung}
    %    \end{macrocode}
    %     \end{macro}
    %
    %     \begin{macro}{\decofauthtext}
    %       Define the german translations for the command.
    %    \begin{macrocode}
    \newcaptionname{english}\decofauthtext{%
    
      \ifsingleauthor{I}{We} hereby certify that the work \ifsingleauthor{I}{we}
      \ifsingleauthor{am}{are} submitting is entirely of \ifsingleauthor{my}{our}
      own making except where otherwise indicated. \ifsingleauthor{I}{We}
      \ifsingleauthor{am}{are} aware of regulations concerning plagiarism,
      including disciplinary actions that may result from it. Any use of the
      works of any other author, in any form, is properly acknowledged at
      their point of use.
    
    }
    \newcaptionname{german,ngerman}\decofauthtext{%
    
      Hiermit best{\"a}tige\ifsingleauthor{}{n} \ifsingleauthor{ich}{wir},
      dass die folgende Arbeit eigenst{\"a}ndig von \ifsingleauthor{mir}{uns}
      allein erstellt und unter Ber{\"u}cksichtigung der zur Verf{\"u}gung
      gestellten Aufgabenstellung sowie dem Arbeitsmaterial unter Angabe aller
      verwendeten Quellen erarbeitet wurde. Die Regelungen und Konsequenzen
      eines Plagiats, inklusive disziplinarischer Ma{\ss}nahmen, sind
      \ifsingleauthor{mir}{uns} bewusst. Insbesondere wurden alle Zitate und
      gedanklichen {\"U}bernahmen als solche kenntlich gemacht.
    
    }
    %    \end{macrocode}
    %     \end{macro}
    %
    %     \begin{macro}{\keywordsname}
    %       Define the german translations for the command.
    %    \begin{macrocode}
    \newcaptionname{english}\keywordsname{Keywords}
    \newcaptionname{german,ngerman}\keywordsname{Schl{\"u}sselw{\"o}rter}
    %    \end{macrocode}
    %     \end{macro}
    %
    %
    %\iffalse docstrip-guard
    %</localisation>
    %\fi
    %
    
    Jan Wille's avatar
    Jan Wille committed
    \endinput