%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% File:    aghphd.cls         (LaTeX Document class option "aghphd")
%          
% Author:  Marcin Szpyrka     (mszpyrka@agh.edu.pl)
%          AGH University of Krakow, POLAND
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\message{*** [aghphd.cls] ---  MSz  v1.1 <28.11.2025>  ***}       

\NeedsTeXFormat{LaTeX2e} % 
\ProvidesClass{aghphd} 

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} 
\ProcessOptions
\LoadClass[11pt, a4paper, twoside]{book} 

\RequirePackage{newtx}
\RequirePackage[T1]{fontenc}
\RequirePackage{graphicx}
\RequirePackage{fancyhdr}
\RequirePackage{anysize}


\def\fieldofscience#1   {\gdef\@fieldofscience{#1}}
\def\discipline#1   {\gdef\@discipline{#1}}
\def\shorttitle#1   {\gdef\@shorttitle{#1}}
\def\shortauthor#1    {\gdef\@shortauthor{#1}}
\def\supervisor#1   {\gdef\@supervisor{#1}}
\def\secondsupervisor#1   {\gdef\@secondsupervisor{#1}}
\def\faculty#1      {\gdef\@faculty{#1}}
\def\acknowledgements#1   {\gdef\@acknowledgements{#1}}

% class option conditionals
\newif\ifCLASSOPTIONauxsup \CLASSOPTIONauxsupfalse
\newif\ifCLASSOPTIONsecsup \CLASSOPTIONsecsupfalse
\newif\ifCLASSOPTIONpl \CLASSOPTIONplfalse
\newif\ifCLASSOPTIONen \CLASSOPTIONenfalse


\linespread{1.3}

%------------------------------------------------------------------------------

\DeclareOption{auxsup}{\CLASSOPTIONauxsuptrue\CLASSOPTIONsecsupfalse}
\DeclareOption{secsup}{\CLASSOPTIONsecsuptrue\CLASSOPTIONauxsupfalse}
\DeclareOption{pl}{\CLASSOPTIONpltrue\CLASSOPTIONenfalse}
\DeclareOption{en}{\CLASSOPTIONentrue\CLASSOPTIONplfalse}
\ProcessOptions

\newcommand{\thesistitlepage}{%
%\clearpage 
\titlepage
%
\begin{center}
\ifCLASSOPTIONpl
  \includegraphics[height=4cm]{agh_pl}
  \\\vspace*{17mm}
  \sffamily{\large{\bfseries{\textsc DZIEDZINA \MakeUppercase{\@fieldofscience}}}}
  \\\vspace*{3mm}
  \sffamily{\large{\textsc DYSCYPLINA \MakeUppercase{\@discipline}}}
  \\\vspace*{21mm}
  \sffamily{\huge{\bfseries{\textsc ROZPRAWA DOKTORSKA}}}
  \\\vspace*{25mm}
  \sffamily{\LARGE{\@title}}
  %
  \vfill
  %
  \sffamily{\large Autor: \@author}
  \\\vspace*{7mm}
  \begin{tabular}{rl}
  \sffamily{\large Promotor rozprawy:} & \sffamily{\large\@supervisor}\\[-1mm]
  \ifCLASSOPTIONauxsup
    \sffamily{\large Promotor pomocniczy:} & \sffamily{\large\@secondsupervisor}\\
  \fi
  %
  \ifCLASSOPTIONsecsup
    & \sffamily{\large\@secondsupervisor}
  \fi
  \end{tabular}
  \\\vspace*{7mm}
  \sffamily{\large Praca wykonana: \@faculty}
  \\\vspace*{22mm}
\fi
%
\ifCLASSOPTIONen
  \includegraphics[height=4cm]{agh_en}
  \\\vspace*{17mm}
  \sffamily{\large{\bfseries{\textsc FIELD OF SCIENCE \MakeUppercase{\@fieldofscience}}}}
  \\\vspace*{3mm}
  \sffamily{\large{\textsc SCIENTIFIC DISCIPLINE \MakeUppercase{\@discipline}}}
  \\\vspace*{21mm}
  \sffamily{\huge{\bfseries{\textsc DOCTORAL THESIS}}}
  \\\vspace*{25mm}
  \sffamily{\LARGE{\@title}}
  %
  \vfill
  %
  \sffamily{\large Author: \@author}
  \\\vspace*{7mm}
  \begin{tabular}{rl}
  \ifCLASSOPTIONauxsup
    \sffamily{\large First supervisor:} & \sffamily{\large\@supervisor}\\[-1mm]
    \sffamily{\large Assisting supervisor:} & \sffamily{\large\@secondsupervisor}\\
  \else
    \ifCLASSOPTIONsecsup
      \sffamily{\large Supervisor:} & \sffamily{\large\@supervisor}\\[-1mm]
      & \sffamily{\large\@secondsupervisor}\\
    \else
      \sffamily{\large Supervisor:} & \sffamily{\large\@supervisor}
    \fi
  \fi
  %
  \end{tabular}
  \\\vspace*{7mm}
  \sffamily{\large Completed in: \@faculty}
  \\\vspace*{22mm}
\fi
%
\sffamily{\large Krak\'{o}w, \@date}
\end{center}
\cleardoublepage
\newpage
\vspace*{15cm} \vfill
\begin{flushright} 
\begin{minipage}[!h]{10cm}
{\Large\itshape \@acknowledgements}
\end{minipage}
\end{flushright}
\cleardoublepage
}

\def\thesisfoot{
  \fancyfoot[L]{\small \@shortauthor\quad\textit{\@shorttitle}}
}

\ProcessOptions

\marginsize{25mm}{20mm}{15mm}{15mm}
\setlength{\headheight}{14pt} 
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfoot{}
\fancyhead{}


\frenchspacing
\sloppy 
\flushbottom


