diff options
author | Nao Pross <np@0hm.ch> | 2021-12-19 16:21:25 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2021-12-19 16:21:25 +0100 |
commit | f12f7112a3dde2a8084d6cd290e2267db8143076 (patch) | |
tree | 119dc6bd6e84c13755f7e9b9312485e1d6e4aff3 /tex | |
parent | Copy stuff from word (diff) | |
download | TheCrownBar-f12f7112a3dde2a8084d6cd290e2267db8143076.tar.gz TheCrownBar-f12f7112a3dde2a8084d6cd290e2267db8143076.zip |
Update document style
Diffstat (limited to '')
-rw-r--r-- | tex/docstyle.sty | 154 |
1 files changed, 129 insertions, 25 deletions
diff --git a/tex/docstyle.sty b/tex/docstyle.sty index 7e44ea9..a171e4a 100644 --- a/tex/docstyle.sty +++ b/tex/docstyle.sty @@ -1,39 +1,143 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tex/docstyle}[2021/12/14 v0.1 Styling for a Sans-Serif report] +\ProvidesPackage{tex/docstyle}[2021/10/31 v0.1 Styling for my thesis] -\PassOptionsToPackage{geometry}{a4paper} +% Package options +\newif\ifdraftmode +\DeclareOption{draft}{\draftmodetrue} + +\ProcessOptions\relax + +%% Page Margins (done with KOMA) +\PassOptionsToPackage{geometry}{ + a4paper, +} \RequirePackage{geometry} -\newgeometry{vmargin = 24mm, hmargin = 24mm} +\AfterCalculatingTypearea{% + \geometry{% + inner = 2cm, outer = 2cm, includeheadfoot, + top = 2cm, bottom = 2cm + } +} + +%% Need colors +\RequirePackage{xcolor} + +%% Pager headers and footers (using KOMA) +\PassOptionsToPackage{scrlayer-scrpage}{autooneside=false, draft=false} +\RequirePackage{scrlayer-scrpage} + +\setkomafont{pagenumber}{\sffamily\bfseries\slshape} +\setkomafont{pageheadfoot}{\itshape} + +\lehead{\leftmark} +\rohead{\rightmark} +%% Draft date when in draft mode +\ifdraftmode + \RequirePackage{scrtime} + \newcommand{\draftfooterstring}{\footnotesize\slshape (Draft of \today\ at \thistime)} + \cefoot{\draftfooterstring} + \cofoot{\draftfooterstring} +\fi + +%% Font configuration +% Use libertine for serif fonts +\RequirePackage{libertine} +% use roboto for sans serif and monospaced \RequirePackage{roboto} \RequirePackage{roboto-mono} -\renewcommand*{\familydefault}{\sfdefault} +\usepackage[german=swiss]{csquotes} + +%% Floating captions configuration +% set captions font +\setkomafont{captionlabel}{\sffamily\bfseries} +% set caption style +\setcapindent{0pt} +\renewcommand*{\captionformat}{\quad} + +%% Bibliography style +\PassOptionsToPackage{biblatex}{% + backend = biber, + style = ieee, +} +\RequirePackage{biblatex} -\RequirePackage{fancyhdr} -\fancypagestyle{doc}{ - \fancyhf{} % clear currrent values - \fancyhead[L]{\itshape\leftmark} - \fancyhead[R]{} - \fancyfoot[C]{\thepage} - \renewcommand{\headrulewidth}{0pt} - \setlength{\headheight}{13pt} +%% Set up links +\PassOptionsToPackage{hyperref}{% + bookmarks = true, + %% TODO: set title + % pdftitle = {} + pdfsubject = {Business Plan: The Crown Bar} + pdfauthor = {Bl\"ochlinger Andr\'e, L\"offler Kevin, Pross Naoki, Wisotkzi Niklas Tim} + plainpages = false, + psepdfpagelabels, } -\pagestyle{doc} % apply style +\RequirePackage{hyperref} +\hypersetup{ + % remove ugly boxes + hidelinks, + % set link colors + colorlinks = true, + anchorcolor = black, + citecolor = black, + filecolor = black, + linkcolor = black, + menucolor = black, + runcolor = black, + urlcolor = {black!50!blue}, + urlcolor = black, +} + +%% Set up subfigures to look like in IEEE classes +\RequirePackage{subcaption} +\usepackage[labelformat=simple]{subcaption} +\renewcommand\thesubfigure{(\alph{subfigure})} -\setlength{\headheight}{15pt} +%% Set up listings +\RequirePackage{listings} -\RequirePackage{titlesec} -\titleformat{\chapter}[hang] - {\normalfont\huge\bfseries}{\thechapter}{20pt}{\Huge} -\titlespacing*{\chapter}{0pt}{0pt}{40pt} +%% create a lstlisting style +\lstdefinestyle{minimalist}{ + abovecaptionskip = \baselineskip, + belowcaptionskip = \baselineskip, + breaklines = true, + inputencoding = utf8, + % frame + frame = leftline, + framerule = 3pt, + rulecolor = \color{cyan!20!white}, + % margin + xleftmargin = 5mm, + framexleftmargin = 5mm, + % background + backgroundcolor = \color{white}, + % default language: + language = TeX, + showstringspaces = false, + % font + basicstyle = \ttfamily, + identifierstyle = \color{black}, + keywordstyle = \bfseries \color{blue!70!black}, + commentstyle = \color{gray}, + stringstyle = \color{orange!60!black}, + % tabs + tabsize=4, +} -\RequirePackage{parskip} +% and set style +\lstset{style=minimalist, escapechar=`} -\PassOptionsToPackage{dirtytalk}{% - left = "<,% - right = ">,% - leftsub = `,% - rightsub = '% +%% Change style of headings etc. +\RedeclareSectionCommand[beforeskip=0pt,afterskip=3\baselineskip]{chapter} +\renewcommand*{\chapterformat}{% + \chapappifchapterprefix{\nobreakspace} + {% + \bfseries\slshape\sffamily\color{blue!30!white}% + \fontsize{3em}{0em}\selectfont% + \thechapter\autodot% + } + \normalfont\enskip } -\RequirePackage{dirtytalk} + +% vim: set ts=2 sw=2 noet: |