% \iffalse meta-comment
%
% Copyright (C) 2022-2023 by Jan Eike Suchard
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c 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.3c or later is part of all distributions of
% LaTeX version 2005/12/01 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{uol-physics-report.dtx}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{uol-physics-report}
%<*class>
[2023/02/01 v1.1 A class providing special environments and commands for writing reports for laboratory courses realized by the Institute of Physics]
%</class>
%
% Used Packages and base class
%<class>\LoadClass[a4paper,12pt,leqno]{article}
%<class>\RequirePackage{babel}
%<class>\RequirePackage[left=1.25cm, right=1.25cm, top=1.75cm, bottom=1.5cm, footskip=15pt, head=28pt, headsep=0.25cm]{geometry}
%<class>\RequirePackage{amsmath,amssymb,amsfonts,amsthm}
%<class>\RequirePackage{mathtools}
%<class>\RequirePackage{fancyhdr}
%<class>\RequirePackage{titling}
%<class>\RequirePackage{subcaption}
%<class>\RequirePackage{graphicx}
%<class>\RequirePackage{float}
%<class>\RequirePackage[bottom]{footmisc}
%<class>\RequirePackage[useregional]{datetime2}
%<class>\RequirePackage{listings}
%<class>\RequirePackage[hypcap=true]{caption}
%<class>\RequirePackage{pdfpages}
%<class>\RequirePackage{siunitx}
%<class>\RequirePackage{esdiff}
%<class>\RequirePackage{tcolorbox}
%<class>\RequirePackage{xcolor}
%<class>\RequirePackage{titleref}
%<class>\RequirePackage{parskip}
%<class>\RequirePackage{setspace}
%<class>\RequirePackage[european,siunitx]{circuitikz}
%<class>\RequirePackage[pdfusetitle,hidelinks]{hyperref}
%<class>\RequirePackage[nameinlink,capitalize]{cleveref}
%<class>\RequirePackage{arrayjobx}
%<class>\RequirePackage{multido}
%<class>\RequirePackage[compact]{titlesec}
% set the page style to fancy to display headers
%<class>\pagestyle{fancy}
% set the head height to 27.5pt to display the content correctly
%<class>\setlength{\headheight}{27.5pt}
% set up the siunitx package to correctly display numbers and uncertainites
%<class>\sisetup{group-digits=none, table-alignment=center, locale=DE, uncertainty-mode=separate, output-open-uncertainty = [, output-close-uncertainty = ]}
% set the content table depth to display subsubsections
%<class>\setcounter{tocdepth}{3}
% set up the page header
%<class>\fancyhead[L]{\small\multido{\iP=1+1}{\value{partnerCounter}}{\arrayx{PartnerLastNames}(\iP)\ifnumcomp{\iP}{<}{\value{partnerCounter}}{, }{}}}
%<class>\fancyhead[C]{\small\@title \\ \@moduleNumber \ -- \@moduleName}
%<class>\fancyhead[R]{\small\@date \\ \@semester}
% setup the all the chapter headings
%<class>\titleformat{\part}{\large\scshape}{\thepart}{1ex}{}
%<class>\titleformat{\section}{\bfseries}{\thesection}{1ex}{}
%<class>\titleformat{\subsection}{\slshape}{\thesubsection}{1ex}{}
%<class>\titleformat{\subsubsection}{\itshape}{\thesubsubsection}{1ex}{}
%<class>\titlespacing*{\part}{0pt}{0pt}{*1}
%<class>\titlespacing*{\section}{0pt}{*1}{*1}
%<class>\titlespacing*{\subsection}{0pt}{*1}{*1}
%<class>\titlespacing*{\subsubsection}{0pt}{*1}{*1}
% set up the lists for the names and matriculation numbers
%<class>\newarray\PartnerFirstNames
%<class>\newarray\PartnerLastNames
%<class>\newarray\PartnerEmails
%<class>\newarray\PartnerMatriculationNumbers
% set up a counter to keep track of the partners
%<class>\newcounter{partnerCounter}
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{shortvrb}
\usepackage{etoolbox}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
    \DocInput{uol-physics-report.dtx}
\end{document}
%</driver>
% \fi
% 
% \CheckSum{0}
%
%
% \changes{v1.0}{2022/12/13}{Initial version}
% \changes{v1.1}{2023/02/01}{Updated page geometry to create more space in accordance to the guidelines, Fixed erorr in commands create the titlepage}
%
% \GetFileInfo{uol-physics-report.dtx}
%
% \title{The uol-physics-report class\thanks{This document 
% corresponds to \textsf{uol-physics-report}~\fileversion,
% dated \filedate.}}
% \author{Jan Eike Suchard \\ \texttt{jan-eike.suchard@magenta.de}}
%
% \maketitle
% 
% \begin{abstract}
%    This document describes the usage of the \texttt{uol-physics-report} document class.
%
%    The document class is based on an initial laboratory report wirtten by me which I have been asked to share with
%    other students at my university. The laboratory report class is mainly optimized for reports written during the
%    Basic Laboratory Course for first semester students of physics at the Carl von Ossietzky University of Oldenburg.
%    Therefore, there are some macros available for generating the titles and headers of every page.
% \end{abstract}
% 
% \section{Introduction}
% Writing a laboratory report is not easy as a first semester who is learning to use \LaTeX{} in a professional setting.
% Furthermore, students need to write their laboratory reports with consistency and predefined formatting. To help with
% this, the class uses some packages like \texttt{siunitx} to help with the correct display of results and formatting of
% tables.
%
% When using this class it is mandatory to set the date and the title with the commands |\date| and |\title|. Otherwise
% the command |\maketitle| exits with an error.
%
% \section{Usage}
% \subsection{General}
% \DescribeMacro{\rom}
% |\rom| \marg{number} prints out an uppercase roman letter number. The input argument is a positive integer excluding zero.
%
% \subsection{Report Setup}
% This section contains the macros used to set up the general report texts like headers and such. You may want to put
% those commands into a \texttt{header.tex} file since those values never change.
%
% \DescribeMacro{\partner}
% |\partner| \marg{First Name} \marg{Last Name} \marg{E-Mail Address} \marg{Matriculation Number} Sets one of many partners
% participating in the protocol
% 
%
% \DescribeMacro{\module}
% |\module| \marg{number} \marg{title} allows setting the module title and number which is printed in the file
% header
%
% \DescribeMacro{\tutor}
% |\tutor| \marg{name} sets the name of the tutor who is present during the experiments
%
% \DescribeMacro{\supervisor}
% |\supervisor| \marg{name} sets the name of the supervisor who is present during the experiments
%
% \DescribeMacro{\group}
% |\group| \marg{number} sets the number of the group the two partners are in
%
% \DescribeMacro{\semester}
% |\semester| \marg{semester} sets the semester in which the module takes place
% 
% \section{Implementation}
% \begin{macro}{\rom}
%    The macro |\rom| \marg{number} takes the supplied number and prints out the uppercase roman number
%    \begin{macrocode}
\newcommand{\rom}[1]{\uppercase\expandafter{\romannumeral #1\relax}}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\partner}
%    |\partner| \marg{First Name} \marg{Last Name} \marg{E-Mail Address} \marg{Matriculation Number} takes the name,
%    matriculation number and email address of a partner and sets it in a way the similat to how the
%    author command works.
%    \begin{macrocode}
\newcommand{\partner}[4]{%%
    \addtocounter{partnerCounter}{1}
    \PartnerFirstNames(\value{partnerCounter})={#1}
    \PartnerLastNames(\value{partnerCounter})={#2}
    \PartnerEmails(\value{partnerCounter})={#3}
    \PartnerMatriculationNumbers(\value{partnerCounter})={#4}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\module}
%    |\module| \marg{number} \marg{title} uses the same structure as the author command
%    \begin{macrocode}
\newcommand{\module}[2]{
    \renewcommand{\@moduleNumber}{#1}
    \renewcommand{\@moduleName}{#2}
}
\newcommand{\@moduleNumber}{}
\newcommand{\@moduleName}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tutor}
%    |\tutor| \marg{name} uses the same structure as the author command
%    \begin{macrocode}
\newcommand{\tutor}[1]{
    \renewcommand{\@tutor}{#1}
}
\newcommand{\@tutor}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\supervisor}
%    |\supervisor| \marg{name} uses the same structure as the author command
%    \begin{macrocode}
\newcommand{\supervisor}[1]{
    \renewcommand{\@supervisor}{#1}
}
\newcommand{\@supervisor}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\group}
%    |\group| \marg{number} uses the same structure as the author command
%    \begin{macrocode}
\newcommand{\group}[1]{
    \renewcommand{\@group}{#1}
}
\newcommand{\@group}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\semester}
%    |\semester| \marg{semester} uses the same structure as the author command
%    \begin{macrocode}
\newcommand{\semester}[1]{
    \renewcommand{\@semester}{#1}
}
\newcommand{\@semester}{}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\maketitle}
%    |\maketitle| creates a title page for the laboratory report
%    \begin{macrocode}
\renewcommand{\maketitle}{%
\begin{titlepage}
    \begin{center}
        \singlespacing
        \topskip0pt
        \vspace*{\fill}
        \pagenumbering{Roman}
        {\Large \@moduleName \ -- \@semester }\\
        \vspace{4em}
        {\huge \textsc{\thetitle}}\\
        \vspace{4em}
        {\Large \thedate}\\
        \vspace{0.5em}
        {\Large Gruppe \@group}\\
        \vspace{3em}
        \begin{tabular}[t]{c@{\extracolsep{8em}}c}
            {\Large\textbf{Betreuer}} & {\Large\textbf{Tutor}} \\
            {\large \@supervisor} & {\large \@tutor} \\
        \end{tabular}\\
        \vspace{3em}
        {\Large\textbf{Gruppenmitglieder}} \\
        \multido{\iP=1+1}{\value{partnerCounter}}{%
        {\large\slshape {\arrayx{PartnerFirstNames}(\iP) \arrayx{PartnerLastNames}(\iP)}} \\
        Matrikelnummer: \arrayx{PartnerMatriculationNumbers}(\iP) \\
        \arrayx{PartnerEmails}(\iP) \\ \vspace{1.5em}
        }
        \vspace*{\fill}
        \thispagestyle{empty}
        \newpage
    \end{center}
    \tableofcontents
\end{titlepage}
\pagenumbering{arabic}
}
%    \end{macrocode}
% \end{macro}