%% %% Copyright (C) 2026 Janis Hutz %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either %% version 1.3 of this license or (at your option) any later %% version. The latest version of this license is in: %% http://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of %% LaTeX version 2008-05-04 or later. \NeedsTeXFormat{LaTeX2e} % Package imports \usepackage[table, dvipsnames]{xcolor} \usepackage{amsmath} \usepackage{graphicx} \usepackage{subcaption} \usepackage[export]{adjustbox} \usepackage[most]{tcolorbox} \usepackage{cancel} \usepackage{dsfont} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage{lipsum} \usepackage{ulem} \usepackage{soul} \usepackage{parskip} \usepackage{fancyhdr} \usepackage{lastpage} \usepackage{tocloft} \usepackage{wasysym} \usepackage{wrapfig} \usepackage{multicol} \usepackage{ifthen} \usepackage[hidelinks]{hyperref} \usepackage{enumitem} \usepackage{gensymb} \usepackage{pifont} \usepackage{xstring} \usepackage{etoolbox} \newcounter{descriptorShadeStrength} \newcounter{shadeStrength} \newcommand{\currentLanguage}{en} \setcounter{secnumdepth}{4} \newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname} \newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname} % ┌ ┐ % │ General config │ % └ ┘ % Configure your author name here \newcommand{\authorTitle}{Janis Hutz\\\url{https://janishutz.com}} \newcommand{\authorHeaders}{Janis Hutz} % Configure your address here \newcommand{\name}{Janis Hutz} \newcommand{\street}{Street} \newcommand{\city}{City} \newcommand{\countrycode}{CH} % Set the default language \renewcommand{\currentLanguage}{en} % ┌ ┐ % │ Rendering │ % └ ┘ % Short descriptors are generated from the naming defined in naming.sty % You may here configure how they are generated. #1 is the full name. \newcommand{\shortDescriptorNameTemplate}[1]{\StrBefore[1]{#1}} % Specify how the inline and short descriptors (e.g. Lemma, etc) are rendered. % - #1 is the name of the descriptor % - #2 is the number (correctly rendered according to settings and preceded with space if not disabled) % - #3 is the name passed (non-empty asserted) \newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#1}} #2} \textit{(#3)}} \newcommand{\inlineDescriptorTemplate}[3]{\bg{#1color}{\namingTranslate{#1} #2}: \textit{(#3)}} % These are used if no name is provided and argument #4 from above is the missing argument \newcommand{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#1}} #2}} \newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}} % background command config (draws a small box around the content) \newcommand{\backgroundPadding}{2pt} \newcommand{\backgroundRounding}{1pt} % ┌ ┐ % │ Colours │ % └ ┘ % The colour-saturation of the short / inline descriptors (default = 40) \setcounter{descriptorShadeStrength}{40} % The colour-saturation of the shade command (default = 20) \setcounter{shadeStrength}{20} % You may also use \definecolor{}{rgb}{r, g, b} to define a fully custom color % see https://www.overleaf.com/learn/latex/Using_colors_in_LaTeX#Creating_your_own_colors for more information \colorlet{definitioncolor}{blue} \colorlet{theoremcolor}{ForestGreen} \colorlet{lemmacolor}{Aquamarine} \colorlet{corollarycolor}{teal} \colorlet{axiomcolor}{JungleGreen} \colorlet{factcolor}{SeaGreen} \colorlet{propositioncolor}{Cyan} \colorlet{examplecolor}{gray} \colorlet{formulacolor}{red} \colorlet{remarkcolor}{green} \colorlet{proofcolor}{magenta} \colorlet{intuitioncolor}{Emerald} \colorlet{termcolor}{orange} \colorlet{notationcolor}{Peach} \colorlet{taskcolor}{gray} \colorlet{usagecolor}{LimeGreen} \colorlet{recallcolor}{yellow} \colorlet{propertiescolor}{purple} % ┌ ┐ % │ Numbering │ % └ ┘ % Set a preset, can be combined, separate or off. % If set to custom, all type specific commands need to be set below. \newcommand{\numberingpreset}{combined} % Specify how elements are to be numbered. Can be (X is the current number of the element): % - none (X) % - section (section.X) % - subsection (section.subsection.X) % - subsubsection (section.subsection.subsubsection.X) % - paragraph (section.subsection.subsubsection.paragraph.X) \newcommand{\subsectionnumbering}{subsection} % Set for a specific type. Can each be combined, separate, default or off: % If set to anything but 'default', it will override the overarching style % set by \numberingpreset \newcommand{\definitionnumbering}{default} \newcommand{\theoremnumbering}{default} \newcommand{\lemmanumbering}{default} \newcommand{\corollarynumbering}{default} \newcommand{\axiomnumbering}{default} \newcommand{\factnumbering}{default} \newcommand{\propositionnumbering}{default} \newcommand{\examplenumbering}{default} \newcommand{\formulanumbering}{default} \newcommand{\remarknumbering}{default} \newcommand{\proofnumbering}{default} \newcommand{\intuitionnumbering}{default} \newcommand{\termnumbering}{default} \newcommand{\notationnumbering}{default} \newcommand{\tasknumbering}{default} \newcommand{\usagenumbering}{default} \newcommand{\recallnumbering}{default} \newcommand{\propertiesnumbering}{default} \newcommand{\tablenumbering}{default} \newcommand{\figurenumbering}{default} % ┌ ┐ % │ Naming │ % └ ┘ % Here you may specify how each descriptor is named \newcommand{\definitionNamingEN}{Definition} \newcommand{\theoremNamingEN}{Theorem} \newcommand{\lemmaNamingEN}{Lemma} \newcommand{\corollaryNamingEN}{Corollary} \newcommand{\axiomNamingEN}{Axiom} \newcommand{\factNamingEN}{Fact} \newcommand{\propositionNamingEN}{Proposition} \newcommand{\exampleNamingEN}{Example} \newcommand{\formulaNamingEN}{Formula} \newcommand{\remarkNamingEN}{Remark} \newcommand{\proofNamingEN}{Proof} \newcommand{\intuitionNamingEN}{Intuition} \newcommand{\termNamingEN}{Term} \newcommand{\notationNamingEN}{Notation} \newcommand{\taskNamingEN}{Task} \newcommand{\usageNamingEN}{Usage} \newcommand{\recallNamingEN}{Recall} \newcommand{\propertiesNamingEN}{Properties} \newcommand{\definitionNamingDE}{Definition} \newcommand{\theoremNamingDE}{Theorem} \newcommand{\lemmaNamingDE}{Lemma} \newcommand{\corollaryNamingDE}{Korollar} \newcommand{\axiomNamingDE}{Axiom} \newcommand{\factNamingDE}{Fakt} \newcommand{\propositionNamingDE}{Satz} \newcommand{\exampleNamingDE}{Beispiel} \newcommand{\formulaNamingDE}{Formel} \newcommand{\remarkNamingDE}{Bemerkung} \newcommand{\proofNamingDE}{Beweis} \newcommand{\intuitionNamingDE}{Intuition} \newcommand{\termNamingDE}{Begriff} \newcommand{\notationNamingDE}{Notation} \newcommand{\taskNamingDE}{Aufgabe} \newcommand{\usageNamingDE}{Nutzung} \newcommand{\recallNamingDE}{Repetition} \newcommand{\propertiesNamingDE}{Eigenschaften} \newcounter{definitionnone} \newcounter{definitionsection}[section] \renewcommand{\thedefinitionsection}{\thesection.\arabic{definitionsection}} \newcounter{definitionsubsection}[subsection] \renewcommand{\thedefinitionsubsection}{\thesubsection.\arabic{definitionsubsection}} \newcounter{definitionsubsubsection}[subsubsection] \renewcommand{\thedefinitionsubsubsection}{\thesubsubsection.\arabic{definitionsubsubsection}} \newcounter{definitionparagraph}[paragraph] \renewcommand{\thedefinitionparagraph}{\theparagraph.\arabic{definitionparagraph}} \newtcolorbox{definition}[2][]{ mainboxstyle, colback=definitioncolor!5!white, colframe=definitioncolor!75!black, colbacktitle=definitioncolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=definitioncolor!75!black, fill=definitioncolor!75!black ] at (frame.north east) { \large \tr{\definitionNamingEN}{\definitionNamingDE}\printLabel{definition} }; }, #1 } \newcommand{\inlinedefinition}[1][NONAME]{\inline[#1]{definition}}\newcommand{\shortdefinition}[1][NONAME]{\short[#1]{definition}}\newcounter{examplenone} \newcounter{examplesection}[section] \renewcommand{\theexamplesection}{\thesection.\arabic{examplesection}} \newcounter{examplesubsection}[subsection] \renewcommand{\theexamplesubsection}{\thesubsection.\arabic{examplesubsection}} \newcounter{examplesubsubsection}[subsubsection] \renewcommand{\theexamplesubsubsection}{\thesubsubsection.\arabic{examplesubsubsection}} \newcounter{exampleparagraph}[paragraph] \renewcommand{\theexampleparagraph}{\theparagraph.\arabic{exampleparagraph}} \newtcolorbox{example}[2][]{ mainboxstyle, colback=examplecolor!5!white, colframe=examplecolor!75!black, colbacktitle=examplecolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=examplecolor!75!black, fill=examplecolor!75!black ] at (frame.north east) { \large \tr{\exampleNamingEN}{\exampleNamingDE}\printLabel{example} }; }, #1 } \newcommand{\inlineexample}[1][NONAME]{\inline[#1]{example}}\newcommand{\shortexample}[1][NONAME]{\short[#1]{example}}\newcounter{theoremnone} \newcounter{theoremsection}[section] \renewcommand{\thetheoremsection}{\thesection.\arabic{theoremsection}} \newcounter{theoremsubsection}[subsection] \renewcommand{\thetheoremsubsection}{\thesubsection.\arabic{theoremsubsection}} \newcounter{theoremsubsubsection}[subsubsection] \renewcommand{\thetheoremsubsubsection}{\thesubsubsection.\arabic{theoremsubsubsection}} \newcounter{theoremparagraph}[paragraph] \renewcommand{\thetheoremparagraph}{\theparagraph.\arabic{theoremparagraph}} \newtcolorbox{theorem}[2][]{ mainboxstyle, colback=theoremcolor!5!white, colframe=theoremcolor!75!black, colbacktitle=theoremcolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=theoremcolor!75!black, fill=theoremcolor!75!black ] at (frame.north east) { \large \tr{\theoremNamingEN}{\theoremNamingDE}\printLabel{theorem} }; }, #1 } \newcommand{\inlinetheorem}[1][NONAME]{\inline[#1]{theorem}}\newcommand{\shorttheorem}[1][NONAME]{\short[#1]{theorem}}\newcounter{lemmanone} \newcounter{lemmasection}[section] \renewcommand{\thelemmasection}{\thesection.\arabic{lemmasection}} \newcounter{lemmasubsection}[subsection] \renewcommand{\thelemmasubsection}{\thesubsection.\arabic{lemmasubsection}} \newcounter{lemmasubsubsection}[subsubsection] \renewcommand{\thelemmasubsubsection}{\thesubsubsection.\arabic{lemmasubsubsection}} \newcounter{lemmaparagraph}[paragraph] \renewcommand{\thelemmaparagraph}{\theparagraph.\arabic{lemmaparagraph}} \newtcolorbox{lemma}[2][]{ mainboxstyle, colback=lemmacolor!5!white, colframe=lemmacolor!75!black, colbacktitle=lemmacolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=lemmacolor!75!black, fill=lemmacolor!75!black ] at (frame.north east) { \large \tr{\lemmaNamingEN}{\lemmaNamingDE}\printLabel{lemma} }; }, #1 } \newcommand{\inlinelemma}[1][NONAME]{\inline[#1]{lemma}}\newcommand{\shortlemma}[1][NONAME]{\short[#1]{lemma}}\newcounter{corollarynone} \newcounter{corollarysection}[section] \renewcommand{\thecorollarysection}{\thesection.\arabic{corollarysection}} \newcounter{corollarysubsection}[subsection] \renewcommand{\thecorollarysubsection}{\thesubsection.\arabic{corollarysubsection}} \newcounter{corollarysubsubsection}[subsubsection] \renewcommand{\thecorollarysubsubsection}{\thesubsubsection.\arabic{corollarysubsubsection}} \newcounter{corollaryparagraph}[paragraph] \renewcommand{\thecorollaryparagraph}{\theparagraph.\arabic{corollaryparagraph}} \newtcolorbox{corollary}[2][]{ mainboxstyle, colback=corollarycolor!5!white, colframe=corollarycolor!75!black, colbacktitle=corollarycolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=corollarycolor!75!black, fill=corollarycolor!75!black ] at (frame.north east) { \large \tr{\corollaryNamingEN}{\corollaryNamingDE}\printLabel{corollary} }; }, #1 } \newcommand{\inlinecorollary}[1][NONAME]{\inline[#1]{corollary}}\newcommand{\shortcorollary}[1][NONAME]{\short[#1]{corollary}}\newcounter{propositionnone} \newcounter{propositionsection}[section] \renewcommand{\thepropositionsection}{\thesection.\arabic{propositionsection}} \newcounter{propositionsubsection}[subsection] \renewcommand{\thepropositionsubsection}{\thesubsection.\arabic{propositionsubsection}} \newcounter{propositionsubsubsection}[subsubsection] \renewcommand{\thepropositionsubsubsection}{\thesubsubsection.\arabic{propositionsubsubsection}} \newcounter{propositionparagraph}[paragraph] \renewcommand{\thepropositionparagraph}{\theparagraph.\arabic{propositionparagraph}} \newtcolorbox{proposition}[2][]{ mainboxstyle, colback=propositioncolor!5!white, colframe=propositioncolor!75!black, colbacktitle=propositioncolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=propositioncolor!75!black, fill=propositioncolor!75!black ] at (frame.north east) { \large \tr{\propositionNamingEN}{\propositionNamingDE}\printLabel{proposition} }; }, #1 } \newcommand{\inlineproposition}[1][NONAME]{\inline[#1]{proposition}}\newcommand{\shortproposition}[1][NONAME]{\short[#1]{proposition}}\newcounter{factnone} \newcounter{factsection}[section] \renewcommand{\thefactsection}{\thesection.\arabic{factsection}} \newcounter{factsubsection}[subsection] \renewcommand{\thefactsubsection}{\thesubsection.\arabic{factsubsection}} \newcounter{factsubsubsection}[subsubsection] \renewcommand{\thefactsubsubsection}{\thesubsubsection.\arabic{factsubsubsection}} \newcounter{factparagraph}[paragraph] \renewcommand{\thefactparagraph}{\theparagraph.\arabic{factparagraph}} \newtcolorbox{fact}[2][]{ mainboxstyle, colback=factcolor!5!white, colframe=factcolor!75!black, colbacktitle=factcolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=factcolor!75!black, fill=factcolor!75!black ] at (frame.north east) { \large \tr{\factNamingEN}{\factNamingDE}\printLabel{fact} }; }, #1 } \newcommand{\inlinefact}[1][NONAME]{\inline[#1]{fact}}\newcommand{\shortfact}[1][NONAME]{\short[#1]{fact}}\newcounter{formulanone} \newcounter{formulasection}[section] \renewcommand{\theformulasection}{\thesection.\arabic{formulasection}} \newcounter{formulasubsection}[subsection] \renewcommand{\theformulasubsection}{\thesubsection.\arabic{formulasubsection}} \newcounter{formulasubsubsection}[subsubsection] \renewcommand{\theformulasubsubsection}{\thesubsubsection.\arabic{formulasubsubsection}} \newcounter{formulaparagraph}[paragraph] \renewcommand{\theformulaparagraph}{\theparagraph.\arabic{formulaparagraph}} \newtcolorbox{formula}[2][]{ mainboxstyle, colback=formulacolor!5!white, colframe=formulacolor!75!black, colbacktitle=formulacolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=formulacolor!75!black, fill=formulacolor!75!black ] at (frame.north east) { \large \tr{\formulaNamingEN}{\formulaNamingDE}\printLabel{formula} }; }, #1 } \newcommand{\inlineformula}[1][NONAME]{\inline[#1]{formula}}\newcommand{\shortformula}[1][NONAME]{\short[#1]{formula}}\newcounter{remarknone} \newcounter{remarksection}[section] \renewcommand{\theremarksection}{\thesection.\arabic{remarksection}} \newcounter{remarksubsection}[subsection] \renewcommand{\theremarksubsection}{\thesubsection.\arabic{remarksubsection}} \newcounter{remarksubsubsection}[subsubsection] \renewcommand{\theremarksubsubsection}{\thesubsubsection.\arabic{remarksubsubsection}} \newcounter{remarkparagraph}[paragraph] \renewcommand{\theremarkparagraph}{\theparagraph.\arabic{remarkparagraph}} \newtcolorbox{remark}[2][]{ mainboxstyle, colback=remarkcolor!5!white, colframe=remarkcolor!75!black, colbacktitle=remarkcolor!75!black, title={\large #2}, overlay={ \node[overlaystyle, draw=remarkcolor!75!black, fill=remarkcolor!75!black ] at (frame.north east) { \large \tr{\remarkNamingEN}{\remarkNamingDE}\printLabel{remark} }; }, #1 } \newcommand{\inlineremark}[1][NONAME]{\inline[#1]{remark}}\newcommand{\shortremark}[1][NONAME]{\short[#1]{remark}}\newcounter{combinenone} \newcounter{combinesection}[section] \renewcommand{\thecombinesection}{\thesection.\arabic{combinesection}} \newcounter{combinesubsection}[subsection] \renewcommand{\thecombinesubsection}{\thesubsection.\arabic{combinesubsection}} \newcounter{combinesubsubsection}[subsubsection] \renewcommand{\thecombinesubsubsection}{\thesubsubsection.\arabic{combinesubsubsection}} \newcounter{combineparagraph}[paragraph] \renewcommand{\thecombineparagraph}{\theparagraph.\arabic{combineparagraph}} \newcommand{\inlinecombine}[1][NONAME]{\inline[#1]{combine}}\newcommand{\shortcombine}[1][NONAME]{\short[#1]{combine}} \newcommand{\resetNumbering}{ \setcounter{definitionnone}{0} \setcounter{definitionsection}{0} \setcounter{definitionsubsection}{0} \setcounter{definitionsubsubsection}{0} \setcounter{definitionparagraph}{0} \setcounter{examplenone}{0} \setcounter{examplesection}{0} \setcounter{examplesubsection}{0} \setcounter{examplesubsubsection}{0} \setcounter{exampleparagraph}{0} \setcounter{theoremnone}{0} \setcounter{theoremsection}{0} \setcounter{theoremsubsection}{0} \setcounter{theoremsubsubsection}{0} \setcounter{theoremparagraph}{0} \setcounter{lemmanone}{0} \setcounter{lemmasection}{0} \setcounter{lemmasubsection}{0} \setcounter{lemmasubsubsection}{0} \setcounter{lemmaparagraph}{0} \setcounter{corollarynone}{0} \setcounter{corollarysection}{0} \setcounter{corollarysubsection}{0} \setcounter{corollarysubsubsection}{0} \setcounter{corollaryparagraph}{0} \setcounter{propositionnone}{0} \setcounter{propositionsection}{0} \setcounter{propositionsubsection}{0} \setcounter{propositionsubsubsection}{0} \setcounter{propositionparagraph}{0} \setcounter{factnone}{0} \setcounter{factsection}{0} \setcounter{factsubsection}{0} \setcounter{factsubsubsection}{0} \setcounter{factparagraph}{0} \setcounter{formulanone}{0} \setcounter{formulasection}{0} \setcounter{formulasubsection}{0} \setcounter{formulasubsubsection}{0} \setcounter{formulaparagraph}{0} \setcounter{remarknone}{0} \setcounter{remarksection}{0} \setcounter{remarksubsection}{0} \setcounter{remarksubsubsection}{0} \setcounter{remarkparagraph}{0} \setcounter{combinenone}{0} \setcounter{combinesection}{0} \setcounter{combinesubsection}{0} \setcounter{combinesubsubsection}{0} \setcounter{combineparagraph}{0} \setcounter{table}{0} \setcounter{figure}{0} } % ┌ ┐ % │ STYLE: Globals │ % └ ┘ % ── Fonts ─────────────────────────────────────────────────────────── \newcommand{\setFont}[1]{\fontfamily{#1}\selectfont} \newcommand{\setFontType}[1]{ \ifthenelse{\equal{#1}{mono}}{ \renewcommand{\familydefault}{\ttdefault} }{ \ifthenelse{\equal{#1}{serif}}{ \renewcommand{\familydefault}{\rmdefault} }{ \renewcommand{\familydefault}{\sfdefault} } } } % ── Small common style elements ───────────────────────────────────── % Spacing (vertical) % TODO: Rework \newcommand{\hrmvspace}{\vspace{-0.25pc}} \newcommand{\rmvspace}{\vspace{-0.5pc}} \newcommand{\mrmvspace}{\vspace{-0.75pc}} \newcommand{\drmvspace}{\vspace{-1pc}} \newcommand{\dhrmvspace}{\vspace{-1.25pc}} \newcommand{\dnrmvspace}{\vspace{-1.5pc}} \newcommand{\dmrmvspace}{\vspace{-1.75pc}} \newcommand{\ddrmvspace}{\vspace{-2pc}} % Spacing (horizontal) \newcommand{\smallhspace}{\hspace{2mm}} \newcommand{\mediumhspace}{\hspace{5mm}} \newcommand{\largehspace}{\hspace{1cm}} % other elements \renewcommand{\footrulewidth}{0.4pt} \newcommand{\TODO}{\color{red} \hl{TODO:} \color{black}} \newcommand{\bi}[1]{\textbf{\textit{#1}}} \renewcommand{\quote}[1]{``\textit{#1}''} % Add a color shade (similar to \fhlc, but nicer boxes) \newcommand{\background}[3]{% \tcbox[on line, boxsep=\backgroundPadding, arc=\backgroundRounding, left=0pt, right=0pt, top=0pt, bottom=0pt, frame empty, colback=#1!#2!white, highlight math style={enhanced} ] {\textbf{#3}}% } % Abstraction of background, where the brightness is set to 20% \newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}} % This command is used for the short and inline descriptors \newcommand{\bg}[2]{\background{#1}{\arabic{descriptorShadeStrength}}{#2}} % Print a table of contents as a tcolorbox \newcommand{\printtoc}[1]{ \renewcommand{\cfttoctitlefont}{} \renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}} \renewcommand{\contentsname}{} \begin{tcolorbox}[ colback=black!5!white, colbacktitle=#1!75!black, coltitle=black, enhanced, attach boxed title to top center={yshift=-2mm}, title={\Large \tr{Contents}{Inhaltsverzeichnis}}, fonttitle=\bfseries, breakable ] \hspace{1cm} \tableofcontents \end{tcolorbox} } % ___ _ _____ _ _ % ( _ \ _( ) (_ _) ( ) ( ) % | (_) )_) |_ | | __ \ \/ / % | _ (| | _ \ | | / __ \ ) ( % | (_) ) | |_) ) | | ( ___// /\ \ % (____/(_)_ __/ (_) \____)_) (_) % Configs if you want to use BibTeX \newcommand{\setupBibtex}[1]{ \usepackage{biblatex} \usepackage[nottoc, numbib]{tocbibind} \addbibresource{#1} } \newcommand{\printbib}{ \addcontentsline{toc}{section}{\translate{Sources}{Quellen}} \printbibliography[title=\translate{Sources}{Quellen}] } % ┌ ┐ % │ Math │ % └ ┘ % BB shortcuts (for number spaces, etc) \newcommand{\A}{\mathbb{A}} \newcommand{\B}{\mathbb{B}} \newcommand{\C}{\mathbb{C}} \newcommand{\D}{\mathbb{D}} \newcommand{\E}{\mathbb{E}} \newcommand{\F}{\mathbb{F}} \newcommand{\G}{\mathbb{G}} \renewcommand{\H}{\mathbb{H}} \newcommand{\I}{\mathbb{I}} \newcommand{\J}{\mathbb{J}} \newcommand{\K}{\mathbb{K}} \renewcommand{\L}{\mathbb{L}} \newcommand{\M}{\mathbb{M}} \newcommand{\N}{\mathbb{N}} \renewcommand{\O}{\mathbb{O}} \renewcommand{\P}{\mathbb{P}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\R}{\mathbb{R}} \renewcommand{\S}{\mathbb{S}} \newcommand{\T}{\mathbb{T}} \newcommand{\U}{\mathbb{U}} \newcommand{\V}{\mathbb{V}} \newcommand{\W}{\mathbb{W}} \newcommand{\X}{\mathbb{X}} \newcommand{\Y}{\mathbb{Y}} \newcommand{\Z}{\mathbb{Z}} % Caligraphic \newcommand{\cA}{\mathcal{A}} \newcommand{\cB}{\mathcal{B}} \newcommand{\cC}{\mathcal{C}} \newcommand{\cD}{\mathcal{D}} \newcommand{\cE}{\mathcal{E}} \newcommand{\cF}{\mathcal{F}} \newcommand{\cG}{\mathcal{G}} \newcommand{\cH}{\mathcal{H}} \newcommand{\cI}{\mathcal{I}} \newcommand{\cJ}{\mathcal{J}} \newcommand{\cK}{\mathcal{K}} \newcommand{\cL}{\mathcal{L}} \newcommand{\cM}{\mathcal{M}} \newcommand{\cN}{\mathcal{N}} \newcommand{\cO}{\mathcal{O}} \newcommand{\cP}{\mathcal{P}} \newcommand{\cQ}{\mathcal{Q}} \newcommand{\cR}{\mathcal{R}} \newcommand{\cS}{\mathcal{S}} \newcommand{\cT}{\mathcal{T}} \newcommand{\cU}{\mathcal{U}} \newcommand{\cV}{\mathcal{V}} \newcommand{\cW}{\mathcal{W}} \newcommand{\cX}{\mathcal{X}} \newcommand{\cY}{\mathcal{Y}} \newcommand{\cZ}{\mathcal{Z}} % other useful shortcuts \newcommand{\elementstack}[2]{\genfrac{}{}{0pt}{}{#1}{#2}} \newcommand{\8}{\infty} \newcommand{\cond}{\text{cond}} \newcommand{\argmin}[1]{\underset{#1}{\text{argmin}}} \newcommand{\dx}{\text{ d}} \newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor} \newcommand{\ceil}[1]{\left\lceil #1 \right\rceil} \newcommand{\hastoeq}{\overset{!}{=}} \newcommand{\Leftrightarrowequiv}{\overset{\cdot}{\Leftrightarrow}} \newcommand{\Longleftrightarrowequiv}{\overset{\cdot}{\Longleftrightarrow}} \newcommand{\Rightarrowequiv}{\overset{\cdot}{\Rightarrow}} \newcommand{\Leftarrowequiv}{\overset{\cdot}{\Leftarrow}} \newcommand{\defAs}{\overset{\text{def}}{=}} \newcommand{\der}[1]{\frac{\mbox{d}}{\mbox{d}#1}} \newcommand{\dern}[2]{\frac{\mbox{d}^{#2}}{\mbox{d}^{#2}#1}} \newcommand{\parder}[1]{\frac{\partial}{\partial #1}} \newcommand{\pardern}[2]{\frac{\partial^{#2}}{\partial^{#2} #1}} \newcommand{\defEquiv}{\overset{\text{def}}{\Leftrightarrow}} \newcommand{\defImplies}{\overset{\text{def}}{\Rightarrow}} \newcommand{\divides}{\hspace{0.25em}|\hspace{0.25em}} \newcommand{\lcm}{\text{lcm}} \newcommand{\limit}[2]{\underset{#1 \rightarrow #2}{\lim}} \newcommand{\seq}[1]{(#1_n)_{n \geq 1}} \newcommand{\ser}[2]{\sum_{k = 1}^{#2} #1_k} \newcommand{\limni}{\limit{n}{\infty}} \newcommand{\limnz}{\limit{n}{0}} \newcommand{\limxz}{\limit{x_0}{0}} \newcommand{\limhz}{\limit{h}{0}} \newcommand{\liminfni}{\liminf_{n \rightarrow \infty}} \newcommand{\limsupni}{\limsup_{n \rightarrow \infty}} \DeclareMathOperator\arctanh{arctanh} \DeclareMathOperator\arccosh{arccosh} \DeclareMathOperator\arcsinh{arcsinh} % ┌ ┐ % │ Minted │ % └ ┘ \usepackage{minted} \usepackage{fancyvrb} % Args: Code. % Alternative: Use \mint{}|code| \newcommand{\inlinecode}[1]{\shade{gray}{\texttt{#1}}} % Args: Language, Code \newenvironment{code}[1]{ \VerbatimEnvironment \begin{minted}[ autogobble, breaklines, breakindentnchars=2, frame=lines, framesep=2mm, mathescape, baselinestretch=1.1, linenos ]{#1}} {\end{minted}} % Args: Language, file relative to root file \newcommand{\inputcode}[2]{ \inputminted[ autogobble, breaklines, breakindentnchars=2, frame=lines, framesep=2mm, mathescape, baselinestretch=1.1, linenos ]{#1}{#2} } % Args: Language, Base directory (with trailing slash), file (no slash at start) \newcommand{\inputcodewithfilename}[3]{ \begin{figure}[h!] \texttt{File: \detokenize{#3}} \rmvspace \inputcode{#1}{#2#3} \end{figure} } % ┌ ┐ % │ Index │ % └ ┘ % For using index package \newcommand{\prepareIndex}{ \usepackage[T1]{fontenc} \usepackage{imakeidx} \makeindex } \newcommand{\addIndexBold}[1]{\textbf{\index{\MakeLowercase{#1}} #1}} \newcommand{\addIndexItalic}[1]{\textit{\index{\MakeLowercase{#1}} #1}} \newcommand{\addIndex}[1]{\index{\MakeLowercase{#1}} #1} % ┌ ┐ % │ Tables │ % └ ┘ \usepackage{booktabs} \usepackage{tabulary} % Create new table. #1 Layout, #2 title row \newenvironment{tables}[2]{ \begin{center} \begin{tabular}{#1} \toprule #2 \\ \midrule }{ \bottomrule \end{tabular} \end{center} } % Create new table in table env. #1 layout, #2 title row, #3 caption \newenvironment{fullTable}[3]{ \edef\tableCaption{#3} \begin{table}[h!] \begin{tables}{#1}{#2} }{ \end{tables} \caption{\tableCaption} \end{table} } % ── Label generator ───────────────────────────────────────────────── \newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname} \newcommand{\printCounter}[1]{\refstepcounter{#1}\csname the#1\endcsname} \newcommand{\printLabel}[1]{% \ifthenelse{\boolean{numberingDisabled}}{}{ \ifcsdef{#1numbering}{% Extra config present \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{% \labelPrintBackendRoutine{#1}% }{% \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{% \printCounter{#1\subsectionnumbering}% }{% \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{% \printCounter{combined\subsectionnumbering}% }{}% }% }% }{% \labelPrintBackendRoutine{#1}% }% }% } \newcommand{\labelPrintBackendRoutine}[1]{% \ifthenelse{\equal{\numberingpreset}{combined}}{% \printCounter{combined\subsectionnumbering}% }{ \ifthenelse{\equal{\numberingpreset}{separate}}{% \printCounter{#1\subsectionnumbering}% }{}% }% } % ── Set the current number of a label ─────────────────────────────── \newcommand{\setLabelNumber}[2]{% \setcounter{#1none}{#2}% \addtocounter{#1none}{-1}% \setcounter{#1section}{#2}% \addtocounter{#1section}{-1}% \setcounter{#1subsection}{#2}% \addtocounter{#1subsection}{-1}% \setcounter{#1subsubsection}{#2}% \addtocounter{#1subsubsection}{-1}% \setcounter{#1paragraph}{#2}% \addtocounter{#1paragraph}{-1}% } \newcommand{\stepLabelNumber}[1]{% \stepcounter{#1none}% \stepcounter{#1section}% \stepcounter{#1subsection}% \stepcounter{#1subsubsection}% \stepcounter{#1paragraph}% } % ┌ ┐ % │ Counter numbering │ % └ ┘ \newcommand{\preEnvHook}[1]{% \ifthenelse{\boolean{numberingDisabled}}{}{ \ifthenelse{\equal{\numberingpreset}{combined} \AND \equal{\printNumberingConfigForDescriptor{#1}}{default}}{% \stepLabelNumber{combined}% }{% \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{% \stepLabelNumber{combined}% }{}% }% }% } % Decides on the numbering to use (combined or not) \newcommand{\tableAndFigureNumberingHelper}[1]{% \ifthenelse{\boolean{numberingDisabled}}{}{ \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}{default}}}{% Using default \ifthenelse{\equal{\numberingpreset}{combined}}{% \tableAndFigureSubsectionPrinting{\value{combined\subsectionnumbering}}% }{% \ifthenelse{\equal{\numberingpreset}{separate}}{% \tableAndFigureSubsectionPrinting{\value{#1}}% }{}% }% }{% if we get here, default has been changed \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}{combined}}}{% \tableAndFigureSubsectionPrinting{\value{combined\subsectionnumbering}}% }{% \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}{separate}}}{% \tableAndFigureSubsectionPrinting{\value{#1}}% }{}% }% }% }% } % Prints the preceding subsection numbers \newcommand{\tableAndFigureSubsectionPrinting}[1]{% \ifthenelse{\equal{\subsectionnumbering}{section}}{% \thesection.#1% }{% \ifthenelse{\equal{\subsectionnumbering}{subsection}}{% \thesubsection.#1% }{% \ifthenelse{\equal{\subsectionnumbering}{subsubsection}}{% \thesubsubsection.#1% }{% \ifthenelse{\equal{\subsectionnumbering}{paragraph}}{% \theparagraph.#1 }{% #1 }% }% }% }% } \renewcommand{\thetable}{\tableAndFigureNumberingHelper{table}} \renewcommand{\thefigure}{\tableAndFigureNumberingHelper{figure}} \AtBeginEnvironment{table}{\preEnvHook{table}} \AtBeginEnvironment{figure}{\preEnvHook{figure}} \newcommand{\newsection}{% \newpage \newsectionNoPB } \newcommand{\newsectionNoPB}{ \ifthenelse{\equal{\numberingpreset}{off}}{}{% \resetNumbering% }% } \newcommand{\resetTableAndFigureNumbering}{% \ifthenelse{\equal{\printNumberingConfigForDescriptor{table}}{combined} \OR \equal{\printNumberingConfigForDescriptor{table}{default}}}{% \setcounter{table}{0} }{}% \ifthenelse{\equal{\printNumberingConfigForDescriptor{figure}}{combined} \OR \equal{\printNumberingConfigForDescriptor{figure}{default}}}{% \setcounter{figure}{0} }{}% } % Numbering toggling \newboolean{numberingDisabled} \setboolean{numberingDisabled}{false} \newcommand{\numberingOff}{\setboolean{numberingDisabled}{true}} \newcommand{\numberingOn}{\setboolean{numberingDisabled}{false}} % Add glossaries functionality \newcommand{\setupGlossary}{ \usepackage[nonumberlist, toc]{glossaries} \usepackage[nottoc, numbib]{tocbibind} \makenoidxglossaries } \newcommand{\printGlossary}{ \glsaddall \printnoidxglossaries } % ┌ ┐ % │ Translation │ % └ ┘ \newcommand{\translate}[2]{% \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}% } \newcommand{\tr}[2]{\translate{#1}{#2}} \newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionEN{#1}}} % Translation aids (commonly used) \newcommand{\trif}{\translate{if }{falls }} \newcommand{\trIf}{\translate{If }{Falls }} \newcommand{\trLet}{\translate{Let }{Sei }} \newcommand{\trLets}{\translate{Let }{Seien }} \newcommand{\trFor}{\translate{For }{Für }} \newcommand{\trfor}{\translate{for }{für }} \newcommand{\trand}{\translate{and }{und }} \newcommand{\tror}{\translate{or }{oder }} \newcommand{\trst}{\translate{s.t. }{s.d. }} \newcommand{\trsuchthat}{\translate{such that }{so dass }} \newcommand{\trwith}{\translate{with }{mit }} % ┌ ┐ % │ Setup │ % └ ┘ % Set up the latex document, configure author, title (as first argument), as well as headers and footers \newcommand{\setup}[1]{ \typeout{[Setup] Setting up...} \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} \title{\Huge \textbf{#1}} \author{\authorTitle} \makeatletter \makeatother \fancyhead{} \fancyhead[L]{#1} \fancyhead[R]{\authorHeaders} \fancyfoot{} \fancyfoot[L]{\today} \fancyfoot[R]{\thepage\ /\ \pageref{LastPage}} \fancypagestyle{plain}{% \fancyhead{} \fancyhead[L]{#1} \fancyhead[R]{\authorHeaders} \fancyfoot{} \fancyfoot[L]{\today} \fancyfoot[R]{\thepage\ /\ \pageref{LastPage}} } } % Set up the latex document, only configuring the author, title and page size \newcommand{\setupBarebones}[1]{ \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} \title{\Huge \textbf{#1}} \author{\authorTitle} } % TODO: Use landscape and columns for new version % Set up the latex document for exam summaries (Extra wide body, small margins, no header) \newcommand{\setupCheatSheet}[1]{ \usepackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} \title{\Huge \textbf{#1}} \author{\authorTitle} } % ┌ ┐ % │ Document start │ % └ ┘ % Start document command (required) \newcommand{\startDocument}{ % TODO: Cheat sheet needs different setup \maketitle \pagestyle{fancy} \thispagestyle{fancy} \tcbset{ mainboxstyle/.style={ arc=3mm, colback=red!5!white, colframe=red!75!black, colbacktitle=red!75!black, fonttitle=\bfseries, enhanced, attach boxed title to top left={yshift=-2mm,xshift=5mm}, breakable, top=0.4cm, } } \tikzset{ overlaystyle/.style={ draw=red!75!black, thick, fill=red!75!black, left, anchor=east, text=white, rounded corners=1mm, font=\bfseries, xshift=-5mm, yshift=1mm, inner xsep=3mm, inner ysep=1.5mm } } } % ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ % ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ % ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ % Extra imports \usepackage{stmaryrd} \usepackage{algorithm} \usepackage{algpseudocodex} \usepackage{setspace} \usepackage{verbatim} \usepackage{turnstile} \usepackage{forloop} \newcommand{\Indent}{\hspace{\algorithmicindent}} \newcommand{\tc}[1]{\tco{#1}} \newcommand{\tct}[1]{\Theta\left(#1\right)} \newcommand{\tco}[1]{\mathcal{O}\left(#1\right)} \newcommand{\tcl}[1]{\Omega\left(#1\right)} \newcommand{\wordbool}{(\Sigma_{\text{bool}})^*} \newcommand{\words}[1]{(\Sigma_{\text{#1}})^*} \newcommand{\word}{\Sigma^*} \newcommand{\wordm}[1]{\Sigma_{\text{#1}}^*} \newcommand{\alphabets}[1]{\Sigma_{\text{#1}}} \newcommand{\alphabetbool}{\Sigma_{\text{bool}}} \newcommand{\tR}{\text{R}} \newcommand{\tC}{\text{C}} \newcommand{\tN}{\text{N}} \newcommand{\bigvdash}[2]{\sststile{#1}{#2}} \newcommand{\class}{\text{\tr{Cl}{Kl}}} % ┌ ┐ % │ STYLE: Math │ % └ ┘ % Add shortcuts to commonly used commands \newcommand{\vect}[1]{\overrightarrow{#1}} \renewcommand{\hat}[1]{\widehat{#1}} \renewcommand{\tilde}[1]{\widetilde{#1}} \newcommand{\proven}{$\hspace{17cm}\square$} % ── Inline environments ───────────────────────────────────────────── \newcommand{\inline}[2][NONAME]{% \ifthenelse{\equal{NONAME}{#1}}{% \anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}% }{% \inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}% } } \newcommand{\short}[2][NONAME]{% \ifthenelse{\equal{NONAME}{#1}}{% \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% }{% \shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}% } } % ┌ ┐ % │ STYLE: Common tcolorboxes │ % └ ┘ % TODO: Update colors \newtcolorbox{recall}[2][]{mainboxstyle,colback=recallcolor!5!white,colframe=recallcolor!75!black,colbacktitle=recallcolor!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=recallcolor!75!black,,fill=recallcolor!75!black] at (frame.north east) {\large \translate{Recall }{Repetition }};},#1} \newtcolorbox{remarks}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Remarks }{Bemerkungen }};},#1} \newtcolorbox{guides}[3][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=red!75!black,,fill=red!75!black] at (frame.north east) {\large #3};},#1} \newtcolorbox{properties}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Properties }{Eigenschaften }};},#1} \newtcolorbox{restrictions}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Restrictions }{Einschränkungen }};},#1} \newtcolorbox{limitations}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Limitations }{Limitierungen }};},#1} \newtcolorbox{intuition}[2][]{mainboxstyle,colback=Emerald!5!white,colframe=Emerald!75!black,colbacktitle=Emerald!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=Emerald!75!black,,fill=Emerald!75!black] at (frame.north east) {\large Intuition};},#1} \newcommand{\inlineintuition}{\bg{Emerald}{Intuition:}} % Terms and notation \newtcolorbox{terms}[2][]{mainboxstyle,colback=orange!5!white,colframe=orange!75!black,colbacktitle=orange!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=orange!75!black,,fill=orange!75!black] at (frame.north east) {\large \translate{Terms }{Begriffe }};},#1} \newtcolorbox{notation}[2][]{mainboxstyle,colback=Peach!5!white,colframe=Peach!75!black,colbacktitle=Peach!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=Peach!75!black,,fill=Peach!75!black] at (frame.north east) {\large Notation};},#1} \newtcolorbox{usage}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Usage }{Nutzung }};},#1} % Task \newtcolorbox{task}[2][]{mainboxstyle,colback=gray!5!white,colframe=gray!75!black,colbacktitle=gray!75!black,title={\large #2},overlay={\node[overlaystyle,draw=gray!75!black,fill=gray!75!black] at (frame.north east) {\large \translate{Task}{Aufgabe}};},#1} % Proof \newtcolorbox{proof}[2][]{mainboxstyle,colback=magenta!5!white,colframe=magenta!75!black,colbacktitle=magenta!75!black,title={\large #2},overlay={\node[overlaystyle,draw=magenta!75!black,fill=magenta!75!black] at (frame.north east) {\large \translate{Proof}{Beweis}};},#1} % General \newtcolorbox{general}[4][]{mainboxstyle,colback=#4!5!white,colframe=#4!75!black,colbacktitle=#4!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=#4!75!black,,fill=#4!75!black] at (frame.north east) {\large #3};},#1} % Simple \newtcolorbox{simplebox}[2][]{colback=#2!5!white,colframe=#2!75!black,#1} % ┌ ┐ % │ STYLE: Computer Science │ % └ ┘ \usepackage{forest} \tikzset{algpxIndentLine/.style={draw=lightgray}} \algrenewcommand{\alglinenumber}[1]{#1} \newenvironment{algo}[1]{ \begin{algorithm} \begin{spacing}{1.2} \caption{\textsc{#1}} \begin{algorithmic}[1] }{ \end{algorithmic} \end{spacing} \end{algorithm} } \endinput