Lab_Report_LaTeX/lab_report.cls

88 lines
2.3 KiB
OpenEdge ABL
Raw 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
\RequirePackage{natbib} % Required to change bibliography style to APA
\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:07:49 +02:00
\RequirePackage{fncylab}
2019-06-22 16:34:31 +02:00
\RequirePackage{hyperref}
2019-06-14 10:28:06 +02:00
\RequirePackage[automark,headsepline]{scrpage2}
\KOMAoptions{DIV=14}
2019-06-22 16:07:49 +02:00
\labelformat{section}{section #1}
2019-10-24 17:05:18 +02:00
\labelformat{figure}{Figure #1}
2019-06-22 16:07:49 +02:00
\labelformat{table}{table #1}
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}
2019-06-14 10:28:06 +02:00
\deftripstyle{pagestyle}
[0.3pt]
[0.3pt]
{\pagemark}
{}
{\headsection}
2019-06-14 13:07:58 +02:00
{\@title\ifset{\lab@slug}{(\lab@slug)}}
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-06-14 13:07:58 +02:00
Date Performed: & \lab@coursedate\\%
2019-10-21 18:31:50 +02:00
\ifx\lab@partner \empty\else
2019-06-14 13:07:58 +02:00
Partner(s): & \lab@partner\\%
2019-10-21 18:31:50 +02:00
\fi
Location: & \lab@room\\%
2019-06-14 13:07:58 +02:00
\ifx\lab@group \empty\else
Group: & \lab@group\\
\fi
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][where:]
{%
#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]}