%%
%% This is file `fhjbook.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fhjbook.dtx  (with options: `class')
%% 
%% Copyright 2025-2026 Michael E. Hammer
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is Michael E. Hammer.
%% 
%% This file is part of the "fhj-script bundle" and all files in that
%% bundle must be distributed together.
%% 
\NeedsTeXFormat{LaTeX2e}[2023-11-01]
\ProvidesClass{fhjbook}
    [2026-07-31 v4.3b A class for formatting books/thesis in the FHJ style]
\newcommand{\FHJ@ClassName}{fhjbook}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\ProcessOptions\relax
\LoadClass[a4paper,DIV=14,BCOR=10mm]{scrbook}
\pagestyle{headings}
\RequirePackage{fhjcommon}
\PassOptionsToPackage{hidelinks}{hyperref}
\RequirePackage{hyperref}
\RequirePackage{array}
\RequirePackage{supertabular}
\RequirePackage{xstring}
\RequirePackage{etoolbox}
\renewcommand*{\title}[1]{\renewcommand*{\@title}{{#1}}}
\newcommand{\FHJ@CheckTitle}{%
  \@ifundefined{@author}{
    \ClassWarningNoLine{fhjbook}{Author not defined}\author{first SECOND}
  }{}
  \@ifundefined{@title}{
    \ClassWarningNoLine{fhjbook}{Title not defined}\title{Title}
  }{}
  \@ifundefined{FHJ@Supervisor}{
    \ClassWarningNoLine{fhjbook}{Supervisor not defined}\supervisor{Supervisor}{m}
  }{}
}
\newcommand{\FHJ@CheckAbstract}{%
  \@ifundefined{FHJ@AbstractDE}{
    \ClassWarningNoLine{fhjbook}{German ``Kurzfassung'' not defined!}\FHJAbstractDE{Eine Beispielkurzfassung...}{kw1,kw2}
  }{}
  \@ifundefined{FHJ@AbstractEN}{
    \ClassWarningNoLine{fhjbook}{English abstract not defined!}\FHJAbstractEN{An example abstract...}{kw1,kw2}
  }{}
}
%% Handhabung von Untertiteln:
\newbool{FHJ@SubtitlePresent}
\renewcommand{\subtitle}[1]
{\setbool{FHJ@SubtitlePresent}{true}%
  \newcommand{\FHJ@Subtitle}{#1}}
%% Autoren- und Betreuerinformationen:
\newbool{FHJ@AuthorMale}
\newbool{FHJ@AuthorFemale}
\newcommand{\authorinfo}[3]{
  \ifstrequal{#1}{m}{\setbool{FHJ@AuthorMale}{true}}{}%
  \ifstrequal{#1}{f}{\setbool{FHJ@AuthorFemale}{true}}{}%
  \newcommand{\FHJ@MatNumber}{#2}
  \newcommand{\FHJ@Cohort}{#3}
}
\newbool{FHJ@SupervisorMale}
\newbool{FHJ@SupervisorFemale}
\newcommand{\supervisor}[2]{
  \newcommand{\FHJ@Supervisor}{#1}
  \ifstrequal{#2}{m}{\setbool{FHJ@SupervisorMale}{true}}{}%
  \ifstrequal{#2}{f}{\setbool{FHJ@SupervisorFemale}{true}}{}%
}
\newbool{FHJ@CosupervisorPresent}
\newbool{FHJ@CosupervisorMale}
\newbool{FHJ@CosupervisorFemale}
\newcommand{\cosupervisor}[2]{
  \setbool{FHJ@CosupervisorPresent}{true}%
  \newcommand{\FHJ@Cosupervisor}{#1}%
  \ifstrequal{#2}{m}{\setbool{FHJ@CosupervisorMale}{true}}{}%
  \ifstrequal{#2}{f}{\setbool{FHJ@CosupervisorFemale}{true}}{}%
}
\newcommand{\FHJLocation}[1]{
  \newcommand{\FHJ@Location}{#1}
}
\newcommand{\FHJMakeTitlePage}{%
\FHJ@CheckTitle%
\thispagestyle{empty}%
\begin{center}
\iflanguage{ngerman}{\includegraphics[width=70mm]{fhjInformaticsLogo.de.img.pdf}}{}
\iflanguage{english}{\includegraphics[width=70mm]{fhjInformaticsLogo.en.img.pdf}}{}
\\[10mm]
\iflanguage{ngerman}{\textbf{MASTERARBEIT}}{}
\iflanguage{english}{\textbf{MASTER'S THESIS}}{}
\\[10mm]
\begin{minipage}{\textwidth}\begin{center}
  \fontsize{16}{20}\selectfont
  \textbf{\@title}
\end{center}\end{minipage}\\[5mm]
\ifbool{FHJ@SubtitlePresent}{%
  {\large\FHJ@Subtitle}\\[10mm]%
}{%
  \vspace*{15mm}%
}
\iflanguage{ngerman}{
  {\footnotesize
  Eingereicht bei
  }\\[2mm]
  \FHJ\\
  Masterstudiengang\\
  ``\FHJProgramLong''
}{}
\iflanguage{english}{
  { \footnotesize
  Submitted at
  }\\[2mm]
  \FHJ\\
  Master's Degree Programme\\
  ``\FHJProgramLong''
}{}
\vspace*{10mm}
{ \footnotesize
\iflanguage{ngerman}{\ifbool{FHJ@AuthorMale}{Autor }{\ifbool{FHJ@AuthorFemale}{Autorin }{Autor:in }}}{}
\iflanguage{english}{Author}{}\\[2mm]
}
\@author\\
\FHJ@MatNumber\\
\iflanguage{english}{Cohort}{}\iflanguage{ngerman}{Jahrgang}{} \FHJProgramShort\ \FHJ@Cohort\\[10mm]
{\footnotesize
\iflanguage{ngerman}{\ifbool{FHJ@SupervisorMale}{Betreuer }{\ifbool{FHJ@SupervisorFemale}{Betreuerin }{Betreuer:in }}}{}
\iflanguage{english}{Supervisor}{}\\[2mm]
}
\FHJ@Supervisor\\[10mm]
\ifbool{FHJ@CosupervisorPresent}{%
  {\footnotesize
  \iflanguage{ngerman}{\ifbool{FHJ@CosupervisorMale}{Zweiter Betreuer }{\ifbool{FHJ@CosupervisorFemale}{Zweite Betreuerin }{Zweite:r Betreuer:in }}}{}%
  \iflanguage{english}{Second Supervisor}{}\\[2mm]%
  }%
  \FHJ@Cosupervisor
}{}
\end{center}
\vfill
\FHJ@Location, \@date \hfill
\iflanguage{ngerman}{Unterschrift}{}
\iflanguage{english}{Signature}{}
\par\vspace*{1cm}
}
\newcommand{\FHJAbstractDE}[2]{%
  \newcommand{\FHJ@AbstractDE}{#1}
  \newcommand*{\FHJ@KeywordsDE}{#2}
}
%%
\newcommand{\FHJAbstractEN}[2]{%
  \newcommand{\FHJ@AbstractEN}{#1}
  \newcommand*{\FHJ@KeywordsEN}{#2}
}
%%
\newcommand*{\FHJ@LastKeyword}{}%
\newcommand*{\FHJ@KwSeparator}{\space$\vert$\space}%
\newcommand{\FHJ@PrintKeyword}[1]{%
  \expandafter\ifblank\expandafter{\FHJ@LastKeyword}{}%
    {\FHJ@KwSeparator}%
  {#1}%
  \renewcommand*{\FHJ@LastKeyword}{#1}%
}
%%
\newcommand{\FHJ@PrintKeywords}[2]{%
  \renewcommand*{\FHJ@LastKeyword}{}%
  \IfStrEq{#2}{de}{\textit{Schlüsselwörter: }}{}%
  \IfStrEq{#2}{en}{\textit{Keywords: }}{}%
  \expandafter\forcsvlist\expandafter\FHJ@PrintKeyword\expandafter{#1}%
}
%%
\newcommand{\FHJMakeAbstract}{%
\FHJ@CheckAbstract
\cleardoublepage
\begingroup % to make sure we change parindent only in this group
  \setlength{\parindent}{0pt}
  \textbf{\Large Kurzfassung:}\\[5mm]
  \FHJ@AbstractDE
  \vfill
  \FHJ@PrintKeywords{\FHJ@KeywordsDE}{de}
  \clearpage
  \textbf{\Large Abstract:}\\[5mm]
  \FHJ@AbstractEN
  \vfill
  \FHJ@PrintKeywords{\FHJ@KeywordsEN}{en}
\endgroup
\cleardoublepage
}
\newcommand{\FHJThesisFrontMatter}{%
\FHJMakeTitlePage%
\FHJMakeDeclaration%
\FHJMakeAbstract%
}
%%
%% Maybe some future additional macros ...
%%
\endinput
%%
%% End of file `fhjbook.cls'.
