algprog/tex/main.tex

155 lines
3.7 KiB
TeX
Raw Normal View History

2024-03-20 15:13:19 +01:00
\documentclass[a4paper,11pt,titlepage]{scrartcl}
%%%% Document Setup
\usepackage[top=2cm,lmargin=1in,rmargin=1in,bottom=3cm,hmarginratio=1:1]{geometry}
\usepackage{scrlayer-fancyhdr}
\usepackage{extramarks}
2024-03-22 13:39:29 +01:00
\usepackage[ngerman, english]{babel}
\babeltags{german=ngerman}
2024-03-20 15:13:19 +01:00
\usepackage{anyfontsize}
\usepackage{unicode-math}
2024-03-22 13:39:29 +01:00
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{booktabs}
2024-03-20 15:13:19 +01:00
\usepackage[scale=.85]{noto-mono} % TODO find better unicode mono font
\usepackage[final]{hyperref}
\pagestyle{fancy}
\lhead{\DocTitle}
\chead{\UniCourse}
\rhead{\firstxmark}
\lfoot{\lastxmark}
\cfoot{\thepage}
\renewcommand\headrulewidth{0.4pt}
\renewcommand\footrulewidth{0.4pt}
%%%%
%%%% Metadata
\newcommand{\DocTitle}{Lecture notes}
\newcommand{\UniCourse}{Algebra of Programming}
\newcommand{\UniProf}{Prof.\ Dr.\ Stefan Milius}
\author{Leon Vatthauer}
%%%%
%%%% Title
\title{
\vspace{2in}
\textmd{\textbf{\UniCourse\\\DocTitle}}\\
\vspace{0.1in}\large{\textit{\UniProf\ }}
\vspace{3in}
}
%%%%
2024-03-22 13:39:29 +01:00
%%%% Code listings
\usepackage{minted}
\setminted[haskell]{
linenos=true,
breaklines=true,
encoding=utf8,
fontsize=\small,
autogobble
}
\setmintedinline[haskell]{
style=bw
}
%%%%
2024-03-20 15:13:19 +01:00
%%%% Math packages
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{tikz}
2024-03-22 13:39:29 +01:00
\usetikzlibrary{cd, babel, quotes}
2024-03-20 15:13:19 +01:00
\declaretheorem[name=Definition,style=definition,numberwithin=section]{definition}
\declaretheorem[name=Example,style=definition,sibling=definition]{example}
\declaretheorem[style=definition,numbered=no]{exercise}
\declaretheorem[name=Remark,style=definition,sibling=definition]{remark}
\declaretheorem[name=Assumption,style=definition,sibling=definition]{assumption}
\declaretheorem[name=Observation,style=definition,sibling=definition]{observation}
\declaretheorem[name=Theorem,sibling=definition]{theorem}
\declaretheorem[sibling=definition]{corollary}
\declaretheorem[name=Fact,sibling=definition]{fact}
\declaretheorem[sibling=definition]{lemma}
\declaretheorem[sibling=lemma]{proposition}
%%%%
2024-03-22 13:39:29 +01:00
%%%% href
2024-03-20 15:13:19 +01:00
\makeatletter
\hypersetup{
pdfauthor={\@author},
pdftitle={\@title},
% kill those ugly red rectangles around links
hidelinks,
}
\makeatother
2024-03-22 13:39:29 +01:00
%%%%
%%%% Bibliography
\usepackage[style=ieee, sorting=ynt, language=british]{biblatex} % advanced citations, british to make dates DD-MM-YYYY
\usepackage[english=british]{csquotes} % biblatex recommended to load this
\addbibresource{bib.bib}
%%%%
2024-03-20 15:13:19 +01:00
%%%% Custom definitions: Commands and environments
%%% Case distinction environment
% Defines the `mycase` environment, copied from https://tex.stackexchange.com/questions/251053/how-to-use-case-1-case-2-in-a-proof-ieee-confs
\newcounter{cases}
\newcounter{subcases}[cases]
\newenvironment{mycase}
{
\setcounter{cases}{0}
\setcounter{subcases}{0}
\newcommand{\case}
{
\par\indent\stepcounter{cases}\textbf{Case \thecases.}
}
\newcommand{\subcase}
{
\par\indent\stepcounter{subcases}\textit{Subcase (\thesubcases):}
}
}
{
\par
}
\renewcommand*\thecases{\arabic{cases}}
\renewcommand*\thesubcases{\roman{subcases}}
%%%
%%% Custom label command
\makeatletter
\newcommand{\customlabel}[2]{%
\protected@write \@auxout {}{\string \newlabel {#1}{{#2}{\thepage}{#2}{#1}{}} }% chktex 1
\hypertarget{#1}{#2}%
}
\makeatother
%%%
%%% Notation
%% Category C
\newcommand{\C}{\ensuremath{\mathscr{C}}}
\newcommand{\obj}[1]{\ensuremath{\vert #1 \vert}}
%%%
%%%%
2024-03-20 15:13:19 +01:00
\begin{document}
%% Titlepage
\maketitle
\setcounter{page}{1}
%%
%% TOC
\tableofcontents
\pagebreak
%%
%% Contents
2024-03-20 15:41:33 +01:00
\include{sections/01_introduction}
\include{sections/02_categories}
\include{sections/03_constructions}
2024-03-20 15:13:19 +01:00
%%
2024-03-22 13:39:29 +01:00
\appendix
\emergencystretch=1em
\printbibliography[heading=bibintoc]{}
2024-03-20 15:13:19 +01:00
\end{document}