Lab_Report_LaTeX/lab_report.cls

100 lines
2.9 KiB
OpenEdge ABL
Raw Permalink Normal View History

2019-06-14 10:28:06 +02:00
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{lab_report}[Hiro's Lab Course Class]
\LoadClass{scrartcl}
\RequirePackage{siunitx} % Provides the \SI{}{} and \si{} command for typesetting SI units
\RequirePackage{graphicx} % Required for the inclusion of images
2019-11-02 20:54:10 +01:00
\RequirePackage[style=phys,backend=biber]{biblatex}
2019-06-14 10:28:06 +02:00
\RequirePackage{amsmath} % Required for some math elements
\RequirePackage{physics}%
\RequirePackage{float}%
2019-06-14 13:07:58 +02:00
\RequirePackage{kvoptions}
2019-06-14 16:01:45 +02:00
\RequirePackage{booktabs}
2019-06-22 16:12:22 +02:00
\RequirePackage{array}
\RequirePackage{tabularx}
\RequirePackage{calc}
2019-06-22 16:34:31 +02:00
\RequirePackage{hyperref}
2019-10-31 22:57:17 +01:00
\RequirePackage{iflang}
2019-11-20 17:29:38 +01:00
\RequirePackage{fixltx2e}
\RequirePackage{csquotes}
2019-12-01 14:01:43 +01:00
\RequirePackage{fncylab}
2019-12-01 16:03:43 +01:00
\RequirePackage[table]{xcolor}
2019-06-14 10:28:06 +02:00
\RequirePackage[automark,headsepline]{scrpage2}
\KOMAoptions{DIV=14}
2019-10-31 22:57:17 +01:00
\labelformat{section}{\IfLanguageName{ngerman}{Kapitel #1}{section #1}}
\labelformat{figure}{\IfLanguageName{ngerman}{Abbildung #1}{Figure #1}}
\labelformat{table}{\IfLanguageName{ngerman}{Tabelle #1}{table #1}}
\sisetup{separate-uncertainty = true}
2019-11-24 21:33:40 +01:00
\hypersetup{
colorlinks,
linkcolor={blue!50!black},
citecolor={red!50!black},
urlcolor={green!80!black}
}
2019-07-07 10:22:09 +02:00
\newcolumntype{L}{>{\(}l<{\)}} % math-mode version of "l" column type
2019-06-14 10:28:06 +02:00
\newcommand{\headsection}{\leftmark}
2019-06-14 13:07:58 +02:00
\newcommand{\ifset}[2]{\ifx {#1} \empty\else\ {#2}\fi}
\newcommand{\ifsetelse}[3]{\ifx {#1} \empty {#3}\else\ {#2}\fi}
2019-06-14 10:28:06 +02:00
\deftripstyle{pagestyle}
[0.3pt]
[0.3pt]
{\pagemark}
{}
{\headsection}
{\ifsetelse{\lab@slug}{\lab@slug}{\@title}}
2019-06-22 16:07:49 +02:00
{\@author}
{\pagemark}
2019-06-14 10:28:06 +02:00
\pagestyle{pagestyle}
\setlength\parindent{0pt} % Removes all indentation from paragraphs
2019-06-14 13:07:58 +02:00
\SetupKeyvalOptions{family=lab,prefix=lab@}
2019-06-14 12:16:41 +02:00
2019-06-14 13:07:58 +02:00
\DeclareStringOption{slug}
\DeclareStringOption{partner}
\DeclareStringOption{supervisor}
\DeclareStringOption{room}
\DeclareStringOption[\today]{coursedate}
\DeclareStringOption{group}
\ProcessKeyvalOptions*
2019-06-14 10:28:06 +02:00
\renewcommand*{\@date}{\today}
\renewcommand*{\maketitle}{%
\begin{titlepage}
\centering
{\huge\bfseries\@title\unskip\strut\par}
{\noindent\rule{2cm}{0.4pt}\par}
2019-06-14 13:07:58 +02:00
{\scshape\Large\lab@slug\unskip\strut\par}
2019-06-14 10:28:06 +02:00
\vspace{2cm}
{\Large\itshape\@author\unskip\strut\par}
{\large \@date\par}
\begin{center}%
\begin{tabular}{l r}%
2019-10-31 22:57:17 +01:00
\IfLanguageName{ngerman}{Datum der Durchf\"uhrung}{Date Performed}: & \lab@coursedate\\%
2019-10-21 18:31:50 +02:00
\ifx\lab@partner \empty\else
2019-10-31 22:57:17 +01:00
\IfLanguageName{ngerman}{Partner}{Partner(s)}: & \lab@partner\\%
2019-10-21 18:31:50 +02:00
\fi
2019-10-31 22:57:17 +01:00
\IfLanguageName{ngerman}{Ort}{Location}: & \lab@room\\%
2019-06-14 13:07:58 +02:00
\ifx\lab@group \empty\else
2019-10-31 22:57:17 +01:00
\IfLanguageName{ngerman}{Gruppe}{Group}: & \lab@group\\
2019-06-14 13:07:58 +02:00
\fi
2019-10-31 22:57:17 +01:00
\IfLanguageName{ngerman}{Betreuer}{Supervisor(s)}: & \lab@supervisor\\%
2019-06-14 10:28:06 +02:00
\end{tabular}%
\end{center}%
\tableofcontents
\end{titlepage}
}
2019-06-22 16:12:22 +02:00
2019-07-07 10:22:09 +02:00
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
2019-06-22 16:12:22 +02:00
\newlength{\conditionwd}
\newenvironment{conditions}[1][\IfLanguageName{ngerman}{Wobei}{Where}:]
2019-06-22 16:12:22 +02:00
{%
#1\tabularx{\textwidth-\widthof{#1}}[t]{
2019-07-07 10:22:09 +02:00
>{\(}r<{\)} @{${}\quad-\quad{}$} l@{}
2019-06-22 16:12:22 +02:00
}%
}
{\endtabularx\\[\belowdisplayskip]}