aboutsummaryrefslogtreecommitdiff
path: root/projdoc.cls
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-09-02 15:24:22 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-09-02 15:24:22 +0200
commitf5da5d0d5489481ddb18dcb6088059884efeb024 (patch)
treec243fc9a478a255d253ccb9d89f52a6e6c7d00ed /projdoc.cls
initial commit (WIP repo scaffolding)
Diffstat (limited to 'projdoc.cls')
-rw-r--r--projdoc.cls102
1 files changed, 102 insertions, 0 deletions
diff --git a/projdoc.cls b/projdoc.cls
new file mode 100644
index 0000000..c1865ec
--- /dev/null
+++ b/projdoc.cls
@@ -0,0 +1,102 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{school-assignment}[2024-01-20 class school-assignment]
+
+% based on article
+\LoadClass{article}
+
+% default word page setup
+\PassOptionsToPackage{margin=1in}{geometry}
+\PassOptionsToPackage{a4paper}{geometry}
+% confusing to acrobat/firefox users
+\PassOptionsToPackage{hidelinks}{hyperref}
+\PassOptionsToPackage{english}{babel}
+
+% frequently used packages
+\RequirePackage{geometry}
+\RequirePackage{float}
+\RequirePackage{babel}
+\RequirePackage{siunitx}
+\RequirePackage{csquotes}
+\RequirePackage{parskip}
+\RequirePackage{fontspec}
+\RequirePackage{tabularx}
+\RequirePackage{booktabs}
+\RequirePackage{needspace}
+\RequirePackage{hyperref}
+\RequirePackage{microtype}
+\RequirePackage{smartref}
+
+% font style
+\setmainfont{TeX Gyre Schola}
+\setmonofont[Scale=0.85]{JetBrainsMono Nerd Font}
+
+% fix fonts w/ siunitx
+\sisetup{detect-all = true}
+
+% no indented paragraphs, just skip
+\parindent=0mm
+\bigskipamount=7mm
+\medskipamount=4mm
+
+% \maketitle format
+\makeatletter
+\let\@project\relax
+\def\project#1{\def\@project{#1}}
+\let\@organization\relax
+\def\organization#1{\def\@organization{#1}}
+\let\@version\relax
+\def\version#1{\def\@version{#1}}
+\def\@maketitle{
+ \centering
+ \vspace*{2in}
+ {
+ {
+ \bfseries\Huge
+ \strut\@title\strut
+ }\\% no parskip
+ {
+ \Large
+ \strut\@project\strut
+ }
+ }
+
+ \vspace{1in}
+
+ {
+ {
+ \def\and{\par}
+ \parskip=0.5ex
+ \strut\@author\strut
+ }
+
+ \vspace{2em}
+
+ {\strut\@organization\strut}
+ }
+
+ \vfill
+ \flushright
+
+ {
+ {
+ \strut{}Version \@version\strut
+ }
+
+ {
+ \strut\@date\strut
+ }
+ }
+
+ \vspace*{2in}
+}
+\makeatother
+
+% always start with title page
+\AtBeginDocument{
+ \clearpage
+ \begin{titlepage}
+ \maketitle
+ \thispagestyle{empty}
+ \end{titlepage}
+}
+