46045-syslab/preamble.tex

143 lines
3.4 KiB
TeX

%! TEX root = main.tex
\documentclass[a4paper, english]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Variables & commands prone to change
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\titl}{Individual Final Report}
\newcommand{\auth}{Daniel Brasholt s214676}
\newcommand{\courseno}{46045}
\newcommand{\course}{Design and Implementation\\ of Coordinated Distributed Energy Systems}
\newcommand{\dato}{June 2024}
\newcommand{\secheader}{Section}
\newcommand{\subsecheader}{Part}
\title{\includegraphics[width=.15\textwidth]{DTU}\\
\vspace{.5em}\Huge\scshape\titl\\
\vspace{-4mm}\rule{4cm}{0.5mm}\\
\Large{\courseno\ \course}}
\author{\auth}
\date{\dato}
% \newcommand{\sourcefile}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Packages & Geometry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[
a4paper,
top=2cm,
bottom=2cm,
left=2cm,
right=2cm,
marginparwidth=2cm,
headheight=10mm,
footskip=10mm
]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[pdfencoding=auto, psdextra]{hyperref}
\usepackage[export]{adjustbox}
\usepackage[bottom]{footmisc}
% \usepackage[dansk]{babel}
\usepackage{
amsmath,
amssymb,
mathtools,
graphicx,
float,
fancyhdr,
subcaption,
lastpage,
listings,
todonotes,
silence,
appendix,
tocloft,
titlesec,
lipsum,
pdfpages,
csquotes,
cleveref,
outlines
}
\usepackage[
format=plain,
labelfont={bf,it,footnotesize},
textfont={it,footnotesize}
]{caption}
\usepackage[
backend=biber,
style=numeric,
sorting=nty
]{biblatex}
% \addbibresource{\sourcefile}
\hypersetup{
colorlinks = true,
urlcolor = blue,
linkcolor = blue,
citecolor = red
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Equations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}
\numberwithin{equation}{section}
\DeclarePairedDelimiter{\paren}{(}{)}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Figures and sections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\alph{subsubsection}}
\Crefname{section}{\secheader}{\secheader}
\graphicspath{{./img}}
% Section
\titleformat{\section}[block]
{\normalfont\Large\scshape\filright}{\fbox{\secheader\ \thesection}}{1em}{}
% Subsection
\titleformat{\subsection}
{\titlerule
\vspace{.8ex}%
\normalfont}
{\subsecheader\ \thesubsection:}{1em}{}
% Subsubsection
\titleformat{\subsubsection}
{}{\thesubsubsection)}{1em}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Page & footer styling
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{fancy}
\lhead{\titl \\ \auth}
\chead{\includegraphics[width=.05\textwidth]{DTU}}
\rhead{\courseno \ \course}
\cfoot{Page \thepage\, of \pageref*{LastPage}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\setlength{\headheight}{36.75034pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% ToC styling
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagenumbering{arabic}
\setcounter{tocdepth}{2}
\tocloftpagestyle{fancy}
\setlength{\cftsubsecnumwidth}{42pt}
\addtolength{\cftsecnumwidth}{47pt}
\addtolength{\cftsubsecnumwidth}{28pt}
\addtocontents{toc}{~\hfill\textbf{Page}\par}