From b8473c5f681bd2ef77d75abb55a888f4f1588fc3 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 3 Nov 2025 16:07:03 +0100 Subject: [PATCH] [Build] Improve helper import --- build.sh | 76 +-- dist/full.tex | 1060 ++++++++++++++++++++++++++++++++++++++++++ dist/letter.tex | 32 ++ dist/minimal.tex | 376 +++++++++++++++ dist/most.tex | 1004 +++++++++++++++++++++++++++++++++++++++ dist/recommended.tex | 1042 +++++++++++++++++++++++++++++++++++++++++ main/core.tex | 2 +- main/lang/de.tex | 1 - scopes/header.tex | 5 - 9 files changed, 3558 insertions(+), 40 deletions(-) create mode 100644 dist/full.tex create mode 100644 dist/letter.tex create mode 100644 dist/minimal.tex create mode 100644 dist/most.tex create mode 100644 dist/recommended.tex delete mode 100644 main/lang/de.tex delete mode 100644 scopes/header.tex diff --git a/build.sh b/build.sh index 8b562f3..71056ee 100755 --- a/build.sh +++ b/build.sh @@ -8,51 +8,61 @@ echo " █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █ █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █ █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█ - - ==> Building <== - " + mkdir dist/ -cat ./scopes/header.tex >>./dist/minimal.sty +echo " +% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ +% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █ +% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█ +% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄ +% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █ +% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █ +% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█ +" > ./dist/minimal.tex # Build minimal scope -cat ./main/core.tex >>./dist/minimal.sty -echo "\n" >>./dist/minimal.sty -cat ./main/style/style.tex >>./dist/minimal.sty -echo "\n" >>./dist/minimal.sty -cat ./main/style/common.tex >>./dist/minimal.sty +cat ./main/core.tex >>./dist/minimal.tex +echo "" >>./dist/minimal.tex +cat ./config/config.tex >>./dist/minimal.tex +echo "" >>./dist/minimal.tex +cat ./main/style/style.tex >>./dist/minimal.tex +echo "" >>./dist/minimal.tex +cat ./main/style/common.tex >>./dist/minimal.tex # Build most -cat ./dist/minimal.sty >./dist/most.sty -echo "\n" >>./dist/most.sty -cat ./main/math.tex >>./dist/most.sty -echo "\n" >>./dist/most.sty -cat ./main/cs.tex >>./dist/most.sty -echo "\n" >>./dist/most.sty -cat ./main/index.tex >>./dist/most.sty -echo "\n" >>./dist/most.sty -cat ./main/style/counters.tex >>./dist/most.sty -echo "\n" >>./dist/most.sty -cat ./main/style/cs.tex >>./dist/most.sty -echo "\n" >>./dist/most.sty -cat ./main/style/math.tex >>./dist/most.sty -echo "\n" >>./dist/most.sty -cat ./main/style/language.tex >>./dist/most.sty +cat ./dist/minimal.tex >./dist/most.tex +echo "" >>./dist/most.tex +cat ./main/math.tex >>./dist/most.tex +echo "" >>./dist/most.tex +cat ./main/cs.tex >>./dist/most.tex +echo "" >>./dist/most.tex +cat ./main/index.tex >>./dist/most.tex +echo "" >>./dist/most.tex +cat ./main/style/counters.tex >>./dist/most.tex +echo "" >>./dist/most.tex +cat ./main/style/cs.tex >>./dist/most.tex +echo "" >>./dist/most.tex +cat ./main/style/math.tex >>./dist/most.tex +echo "" >>./dist/most.tex +cat ./main/style/language.tex >>./dist/most.tex +echo "" >>./dist/most.tex +cat ./main/tables.tex >>./dist/most.tex # Build recommended -cat ./dist/most.sty >./dist/recommended.sty -echo "\n" >>./dist/recommended.sty -cat ./extra/bib.tex >>./dist/recommended.sty -echo "\n" >>./dist/recommended.sty -cat ./extra/glossary.tex >>./dist/recommended.sty +cat ./dist/most.tex >./dist/recommended.tex +echo "" >>./dist/recommended.tex +cat ./extra/bib.tex >>./dist/recommended.tex +echo "" >>./dist/recommended.tex +cat ./extra/glossary.tex >>./dist/recommended.tex # Build full -cat ./dist/recommended.sty >./dist/full.sty -echo "\n" >>./dist/full.sty -cat ./extra/minted.tex >>./dist/full.sty +cat ./dist/recommended.tex >./dist/full.tex +echo "" >>./dist/full.tex +cat ./extra/minted.tex >>./dist/full.tex # Copy letter -cp ./scopes/letter.tex ./dist/letter.sty +cp ./scopes/letter.tex ./dist/letter.tex echo "==> Done" diff --git a/dist/full.tex b/dist/full.tex new file mode 100644 index 0000000..ab63148 --- /dev/null +++ b/dist/full.tex @@ -0,0 +1,1060 @@ + +% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ +% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █ +% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█ +% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄ +% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █ +% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █ +% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█ + + +% ▄▄█▀▀▀█▄█ +% ▄██▀ ▀█ +% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██ +% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██ +% ██▄ ██ ██ ██ ██▀▀▀▀▀▀ +% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄ +% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀ + +% This file contains all necessary dependencies for the document to compile (at all) and some core macros + +% Imports % +\typeout{[Core] Importing!} +\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} + + +% Language Switching. Currently only English and German are supported +% See docs for how to use +\newcounter{lang} + +\newcommand{\setLang}[1]{ + \edef\lang{#1} + \edef\en{en} + \edef\de{de} + \ifx\lang\en + \typeout{[Lang Switcher] Loading English} + \setcounter{lang}{1} + \else + \ifx\lang\de + \typeout{[Lang Switcher] Loading German} + \setcounter{lang}{2} + \usepackage[ngerman]{babel} + \else + \typeout{[Lang Switcher] No such language!} + \fi + \fi +} + +\newcommand{\loadLang}{ + \ifnum\value{lang}<2{ + \typeout{[Lang Loader] Loaded English} + }\else { + \typeout{[Lang Loader] Loaded German} + \setcounter{lang}{2} + } + \fi +} + + +% Create config counters / variables. See the config file for changing them +\newcounter{numberingConfig} +\newcounter{numberSubsections} +\newcounter{descriptorShadeStrength} +\newcounter{shadeStrength} + +% Set up the latex document, configure author, title (as first argument), as well as headers and footers +\newcommand{\setup}[1]{ + \typeout{[Setup] Setting up...} + \loadLang + \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}} + } +} + +% Start document command (required) +\newcommand{\startDocument}{ + \maketitle + \pagestyle{fancy} + \thispagestyle{fancy} +} + +% Set up the latex document, only configuring the author, title and page size +\newcommand{\setupBarebones}[1]{ + \loadLang + \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + +% Set up the latex document for exam summaries (Extra wide body, small margins, no header) +\newcommand{\setupCheatSheet}[1]{ + \loadLang + \usepackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Translatation │ +% ╰────────────────────────────────────────────────╯ +\newcommand{\translate}[2]{\ifnum\value{lang}<2{#1}\else{#2}\fi} +\newcommand{\tr}[2]{\translate{#1}{#2}} + +% ┌ ┐ +% │ 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 }} + +% ___ ___ +% ( _ \ / ___)_ +% | ( (_) _ ___ | (__ (_) __ +% | | _ / _ \/ _ \ __)| |/ _ \ +% | (_( ) (_) ) ( ) | | | | (_) | +% (____/ \___/(_) (_)_) (_)\__ | +% ( )_) | +% \___/ + +% To be loaded *after* main/core.tex + +% 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} + + +% Configure definition, lemma, theorem, etc numbering behaviour. 1 = Individual, 2 = Combined (apart from Definition), 3 = Combined +\setcounter{numberingConfig}{1} + +% Configure if for definitions, lemmas, etc, numbering should be (0) =
. or (1) =
.. or (2) =
... +\setcounter{numberSubsections}{0} + +% Set the default language. +\setLang{en} + +% Set the default command for theorem translation +\newcommand{\theoremde}{Satz} + + +% ----- % +% STYLE % +% ----- % + +% 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} + +%░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +%░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░ +%▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ +%▒▒ ▒▒▒▒▒▒▒ ▒ ▒ ▒▒▒ ▒ ▒▒▒▒ ▒▒▒▒ +%▓▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓▓ ▓ ▓▓ ▓▓ ▓▓▓ ▓ +%▓▓▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓ ▓ ▓ +%▓ ▓▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓▓▓▓ +%███ ██████ █████ ████ ███ ███ +%██████████████████████ ███████████████████ + +% Global style configs for tcolorbox (to reduce bloat) +\newcommand{\usetcolorboxes}{ + \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 + } + } +} + +% -------------------- % +% Small style elements % +% -------------------- % +\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} + } + } +} +\newcommand{\rmvspace}{\vspace{-0.5pc}} +\newcommand{\drmvspace}{\vspace{-1pc}} +\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=2pt, + left=0pt, + right=0pt, + top=0pt, + bottom=0pt, + colframe=white, + 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}} + +% Add a gray backdrop +\newcommand{\backdrop}[1]{\shade{black}{#1}} + + +% Fancy highlighting (Bold, underlined, colorbox behind it. Shorthand for \fhlc{white}{#1} +\newcommand{\fhl}[1]{\fhlc{white}{#1}} + +% Add a colorbox around your text with the color specified. Text is bold and underlined +\newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}} + +% Spacing (horizontal) +\newcommand{\smallhspace}{\hspace{2mm}} +\newcommand{\mediumhspace}{\hspace{5mm}} +\newcommand{\largehspace}{\hspace{1cm}} + +% ----------------- % +% Table of contents % +% ----------------- % + +% 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 \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable] + \hspace{1cm} + \tableofcontents + \end{tcolorbox} +} + +%▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ +%██░▄▄▀█▀▄▄▀█░▄▀▄░█░▄▀▄░█▀▄▄▀█░▄▄▀ +%██░████░██░█░█▄█░█░█▄█░█░██░█░██░ +%██░▀▀▄██▄▄██▄███▄█▄███▄██▄▄██▄██▄ +%▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ + +\newtcolorbox{recall}[2][]{mainboxstyle,colback=yellow!5!white,colframe=yellow!75!black,colbacktitle=yellow!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=yellow!75!black,,fill=yellow!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} + +% ▄▄ +% ▀████▄ ▄███▀ ██ ███ +% ████ ████ ██ ██ +% █ ██ ▄█ ██ ▄█▀██▄ ██████ ███████▄ +% █ ██ █▀ ██ ██ ██ ██ ██ ██ +% █ ██▄█▀ ██ ▄█████ ██ ██ ██ +% █ ▀██▀ ██ ██ ██ ██ ██ ██ +% ▄███▄ ▀▀ ▄████▄████▀██▄ ▀███████ ████▄ + + +% BB shortcuts (for number spaces, etc) +\newcommand{\C}{\mathbb{C}} +\newcommand{\D}{\mathbb{D}} +\newcommand{\E}{\mathbb{E}} +\newcommand{\I}{\mathbb{I}} +\newcommand{\J}{\mathbb{J}} +\newcommand{\N}{\mathbb{N}} +\newcommand{\Q}{\mathbb{Q}} +\newcommand{\R}{\mathbb{R}} +\newcommand{\V}{\mathbb{V}} +\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{\8}{\infty} +\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{\mbeq}{\overset{!}{=}} +\newcommand{\lcm}{\text{lcm}} +\newcommand{\limit}[2]{\lim_{#1 \rightarrow #2}} +\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}} +\newcommand{\elementstack}[2]{\genfrac{}{}{0pt}{}{#1}{#2}} +\DeclareMathOperator\arctanh{arctanh} +\DeclareMathOperator\arccosh{arccosh} +\DeclareMathOperator\arcsinh{arcsinh} + + +% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ +% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ +% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ + +% Extra imports +\usepackage{stmaryrd} +\usepackage{algorithm} +\usepackage{algpseudocodex} +\usepackage{setspace} +\usepackage{verbatim} +\usepackage{turnstile} +\usepackage{forloop} + +\newcommand{\Indent}{\hspace{\algorithmicindent}} + +\newcommand{\timecomplexity}{\fhlc{orange}{\ifnum\value{lang}<2{Time complexity}\else {Laufzeit}\fi} \hspace{0.5em}} +\newcommand{\tc}[1]{\timecomplexity $\Theta\left(#1\right)$} +\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}}} + +% ▄▄ +% ▀████▀ ▀███ +% ██ ██ +% ██ ▀████████▄ ▄█▀▀███ ▄▄█▀██▀██▀ ▀██▀ +% ██ ██ ██ ▄██ ██ ▄█▀ ██ ▀██ ▄█▀ +% ██ ██ ██ ███ ██ ██▀▀▀▀▀▀ ███ +% ██ ██ ██ ▀██ ██ ██▄ ▄ ▄█▀ ██▄ +% ▄████▄████ ████▄ ▀████▀███▄ ▀█████▀██▄ ▄██▄ + + +% 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} + + + +% ▄▄· ▄• ▄▌ ▐ ▄ ▄▄▄▄▄▄▄▄ .▄▄▄ +% ▐█ ▌▪ ▄█▀▄ █▪██▌•█▌▐█•██ ▀▄.▀·▀▄ █· +% ██ ▄▄▐█▌.▐▌█▌▐█▌▐█▐▐▌ ▐█.▪▐▀▀▪▄▐▀▀▄ +% ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌ +% ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀ + +\usepackage{xstring} +\usepackage{etoolbox} +% tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters +\newcounter{lemma}[section] +\newcounter{definition}[section] +\newcounter{corollary}[section] +\newcounter{theorem}[section] +\newcounter{axiom}[section] +\newcounter{example}[section] +\newcounter{fact}[section] +\newcounter{proposition}[section] +\newcounter{formula}[section] +\newcounter{remark}[section] +\newcounter{all}[section] + +\newcounter{lemmass}[subsection] +\newcounter{definitionss}[subsection] +\newcounter{corollaryss}[subsection] +\newcounter{theoremss}[subsection] +\newcounter{axiomss}[subsection] +\newcounter{exampless}[subsection] +\newcounter{factss}[subsection] +\newcounter{propositionss}[subsection] +\newcounter{formulass}[subsection] +\newcounter{remarkss}[subsection] +\newcounter{allss}[subsection] + +\newcounter{lemmasss}[subsubsection] +\newcounter{definitionsss}[subsubsection] +\newcounter{corollarysss}[subsubsection] +\newcounter{theoremsss}[subsubsection] +\newcounter{axiomsss}[subsubsection] +\newcounter{examplesss}[subsubsection] +\newcounter{factsss}[subsubsection] +\newcounter{propositionsss}[subsubsection] +\newcounter{formulasss}[subsubsection] +\newcounter{remarksss}[subsubsection] +\newcounter{allsss}[subsubsection] + +% Set the current number of a label +\newcommand{\setLabelNumber}[2]{% + \setcounter{#1}{#2}% + \addtocounter{#1}{-1}% + \setcounter{#1ss}{#2}% + \addtocounter{#1ss}{-1}% + \setcounter{#1sss}{#2}% + \addtocounter{#1sss}{-1}% +} + +\newcommand{\stepLabelNumber}[1]{% + \stepcounter{#1}% + \stepcounter{#1ss}% + \stepcounter{#1sss}% +} + +\newcommand{\printcounter}[1]{% + \csname the#1\endcsname +} + +\newcommand{\suffix}{ss} +\newcommand{\sectionNumbering}{\thesection} + +% ┌ ┐ +% │ Counter numbering │ +% └ ┘ +\newcommand{\preTableAndFigHook}[1]{% + \ifnum\value{numberingConfig}>1 + \ifnum\value{numberSubsections}=1 + \stepcounter{allss} + \else + \ifnum\value{numberSubsections}=2 + \stepcounter{allsss} + \else + \stepcounter{all} + \fi + \fi + \fi +} +\AtBeginEnvironment{table}{\preTableAndFigHook{table}} +\AtBeginEnvironment{figure}{\preTableAndFigHook{figure}} + +\newcommand{\applyTableAndFigureNumbering}{ + % Tables & Figures + \ifnum\value{numberingConfig}=0 + \renewcommand{\thetable}{} + \renewcommand{\thefigure}{} + \else + \ifnum\value{numberingConfig}=1 + \renewcommand{\thetable}{\sectionNumbering.\arabic{table}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{figure}} + \else + \ifnum\value{numberSubsections}=1 + \renewcommand{\thetable}{\sectionNumbering.\arabic{allss}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{allss}} + \else + \ifnum\value{numberSubsections}=2 + \renewcommand{\thetable}{\refstepcounter{allsss}\sectionNumbering.\arabic{allsss}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{allsss}} + \else + \renewcommand{\thetable}{\sectionNumbering.\arabic{all}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{all}} + \fi + \fi + \fi + \fi +} + +\newcommand{\setSubsectionNumbering}[1]{ + \setcounter{numberSubsections}{#1} + \applySubsectionNumbering +} + +\newcommand{\applySubsectionNumbering}{ + \ifnum\value{numberSubsections}=1 + \renewcommand{\sectionNumbering}{\thesubsection} + \renewcommand{\suffix}{ss} + \typeout{Numbering as section.subsection.number} + \else + \ifnum\value{numberSubsections}=2 + \renewcommand{\sectionNumbering}{\thesubsubsection} + \renewcommand{\suffix}{sss} + \typeout{Numbering as section.subsection.subsubsection.number} + \else + \renewcommand{\sectionNumbering}{\thesection} + \renewcommand{\suffix}{} + \typeout{Numbering as section.number} + \fi + \fi + \applyTableAndFigureNumbering + + \renewcommand{\thelemma}{\sectionNumbering.\arabic{lemma}} + \renewcommand{\thedefinition}{\sectionNumbering.\arabic{definition}} + \renewcommand{\thecorollary}{\sectionNumbering.\arabic{corollary}} + \renewcommand{\thetheorem}{\sectionNumbering.\arabic{theorem}} + \renewcommand{\theaxiom}{\sectionNumbering.\arabic{axiom}} + \renewcommand{\theexample}{\sectionNumbering.\arabic{example}} + \renewcommand{\thefact}{\sectionNumbering.\arabic{fact}} + \renewcommand{\theproposition}{\sectionNumbering.\arabic{proposition}} + \renewcommand{\theformula}{\sectionNumbering.\arabic{formula}} + \renewcommand{\theremark}{\sectionNumbering.\arabic{remark}} + \renewcommand{\theall}{\sectionNumbering.\arabic{all}} + + \renewcommand{\thelemmass}{\sectionNumbering.\arabic{lemmass}} + \renewcommand{\thedefinitionss}{\sectionNumbering.\arabic{definitionss}} + \renewcommand{\thecorollaryss}{\sectionNumbering.\arabic{corollaryss}} + \renewcommand{\thetheoremss}{\sectionNumbering.\arabic{theoremss}} + \renewcommand{\theaxiomss}{\sectionNumbering.\arabic{axiomss}} + \renewcommand{\theexampless}{\sectionNumbering.\arabic{exampless}} + \renewcommand{\thefactss}{\sectionNumbering.\arabic{factss}} + \renewcommand{\thepropositionss}{\sectionNumbering.\arabic{propositionss}} + \renewcommand{\theformulass}{\sectionNumbering.\arabic{formulass}} + \renewcommand{\theremarkss}{\sectionNumbering.\arabic{remarkss}} + \renewcommand{\theallss}{\sectionNumbering.\arabic{allss}} + + \renewcommand{\thelemmasss}{\sectionNumbering.\arabic{lemmasss}} + \renewcommand{\thedefinitionsss}{\sectionNumbering.\arabic{definitionsss}} + \renewcommand{\thecorollarysss}{\sectionNumbering.\arabic{corollarysss}} + \renewcommand{\thetheoremsss}{\sectionNumbering.\arabic{theoremsss}} + \renewcommand{\theaxiomsss}{\sectionNumbering.\arabic{axiomsss}} + \renewcommand{\theexamplesss}{\sectionNumbering.\arabic{examplesss}} + \renewcommand{\thefactsss}{\sectionNumbering.\arabic{factsss}} + \renewcommand{\thepropositionsss}{\sectionNumbering.\arabic{propositionsss}} + \renewcommand{\theformulasss}{\sectionNumbering.\arabic{formulasss}} + \renewcommand{\theremarksss}{\sectionNumbering.\arabic{remarksss}} + \renewcommand{\theallsss}{\sectionNumbering.\arabic{allsss}} +} +\applySubsectionNumbering + +% ── Label generation ──────────────────────────────────────────────── +\newcommand{\labelSectionGeneration}{% + \ifnum\value{numberSubsections}=1 + \arabic{section}-\arabic{subsection}% + \else + \ifnum\value{numberSubsections}=2 + \arabic{section}-\arabic{subsection}-\arabic{subsubsection}% + \else + \arabic{section}% + \fi + \fi} + +\newcommand{\labelIt}[1]{\refstepcounter{#1\suffix}\edef\tempLabel{\genLabel{#1}{\arabic{#1\suffix}}}\label{\tempLabel}} +\newcommand{\genLabel}[2]{#1:\labelSectionGeneration-#2} + +% ┌ ┐ +% │ Number the counters appropriately │ +% └ ┘ +\newcommand{\usenumberArabic}[1]{% + \ifnum\value{numberingConfig}=1 + \labelIt{#1} + \printcounter{#1\suffix}% + \else + \ifnum\value{numberingConfig}=2 + \ifthenelse{\equal{#1}{definitions}}{% + \labelIt{definition} + \printcounter{definition\suffix}% + }{% + \labelIt{all} + \printcounter{all\suffix}% + }% + \else + \ifnum\value{numberingConfig}=3 + \labelIt{all} + \printcounter{all\suffix}% + \else + \relax% + \fi + \fi + \fi} + + +% ──────────────────────────────────────────────────────────────────── +% ┌ ┐ +% │ Enable or disable numbering │ +% └ ┘ +% Initialize with config file +\newcounter{numberingConfigStore} +\setcounter{numberingConfigStore}{\value{numberingConfig}} + +% For later change +\newcommand{\setNumberingStyle}[1]{ + \typeout{Setting NumberingStyle to #1} + \setcounter{numberingConfig}{#1} + \ifthenelse{\equal{#1}{0}}{}{ + \setcounter{numberingConfigStore}{#1} + } + \applyTableAndFigureNumbering +} + +% Enable / disable numbering +\newcommand{\numberingOff}{ + \setcounter{numberingConfig}{0} + \applyTableAndFigureNumbering +} +\newcommand{\numberingOn}{ + \setcounter{numberingConfig}{\value{numberingConfigStore}} + \applyTableAndFigureNumbering +} + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Reset definition, lemma, etc counters, add a │ +% │ new page │ +% ╰────────────────────────────────────────────────╯ +\newcommand{\newsection}{ + \newpage + \newsectionNoPB +} + +% ── Reset definitions, lemma, etc counters, do not add new page ───── +\newcommand{\newsectionNoPB}{ + \setcounter{lemma}{0} + \setcounter{definition}{0} + \setcounter{corollary}{0} + \setcounter{theorem}{0} + \setcounter{axiom}{0} + \setcounter{example}{0} + \setcounter{fact}{0} + \setcounter{proposition}{0} + \setcounter{formula}{0} + \setcounter{remark}{0} + \setcounter{all}{0} + + \setcounter{lemmass}{0} + \setcounter{definitionss}{0} + \setcounter{corollaryss}{0} + \setcounter{theoremss}{0} + \setcounter{axiomss}{0} + \setcounter{exampless}{0} + \setcounter{factss}{0} + \setcounter{propositionss}{0} + \setcounter{formulass}{0} + \setcounter{remarkss}{0} + \setcounter{allss}{0} + + \setcounter{lemmasss}{0} + \setcounter{definitionsss}{0} + \setcounter{corollarysss}{0} + \setcounter{theoremsss}{0} + \setcounter{axiomsss}{0} + \setcounter{examplesss}{0} + \setcounter{factsss}{0} + \setcounter{propositionsss}{0} + \setcounter{formulasss}{0} + \setcounter{remarksss}{0} + \setcounter{allsss}{0} + + % Tables & Figures + \setcounter{table}{0} + \setcounter{figure}{0} +} +\newsectionNoPB % Initializes + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Tcolorboxes │ +% ╰────────────────────────────────────────────────╯ +% ──────────────────────────────────────────────────────────────────── + +% Definitions +\newtcolorbox{definition}[2][]{mainboxstyle,colback=blue!5!white,colframe=blue!75!black,colbacktitle=blue!75!black,title={\large #2},overlay={\node[overlaystyle,draw=blue!75!black,fill=blue!75!black] at (frame.north east) {\large Definition\usenumberArabic{definition}};},#1} + +% Theorems +\newtcolorbox{theorem}[2][]{mainboxstyle,colback=ForestGreen!5!white,colframe=ForestGreen!75!black,colbacktitle=ForestGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=ForestGreen!75!black,fill=ForestGreen!75!black] at (frame.north east) {\large \translate{Theorem}{\theoremde}\usenumberArabic{theorem}};},#1} + +% Lemmas +\newtcolorbox{lemma}[2][]{mainboxstyle,colback=Aquamarine!5!white,colframe=Aquamarine!75!black,colbacktitle=Aquamarine!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Aquamarine!75!black,fill=Aquamarine!75!black] at (frame.north east) {\large Lemma\usenumberArabic{lemma}};},#1} + +% Corollaries +\newtcolorbox{corollary}[2][]{mainboxstyle,colback=teal!5!white,colframe=teal!75!black,colbacktitle=teal!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=teal!75!black,fill=teal!75!black] at (frame.north east) {\large \translate{Corollary}{Korollar}\usenumberArabic{corollary}};},#1} + +% Axioms +\newtcolorbox{axiom}[2][]{mainboxstyle,colback=JungleGreen!5!white,colframe=JungleGreen!75!black,colbacktitle=JungleGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=JungleGreen!75!black,fill=JungleGreen!75!black] at (frame.north east) {\large Axiom\usenumberArabic{axiom}};},#1} + +% Facts +\newtcolorbox{fact}[2][]{mainboxstyle,colback=SeaGreen!5!white,colframe=SeaGreen!75!black,colbacktitle=SeaGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=SeaGreen!75!black,fill=SeaGreen!75!black] at (frame.north east) {\large \translate{Fact}{Fakt}\usenumberArabic{fact}};},#1} + +% Propositions +\newtcolorbox{proposition}[2][]{mainboxstyle,colback=Cyan!5!white,colframe=Cyan!75!black,colbacktitle=Cyan!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Cyan!75!black,fill=Cyan!75!black] at (frame.north east) {\large Proposition\usenumberArabic{proposition}};},#1} + +% Examples +\newtcolorbox{example}[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{Example}{Beispiel}\usenumberArabic{example}};},#1} + +% Formula +\newtcolorbox{formula}[2][]{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 \translate{Formula}{Formel}\usenumberArabic{formula}};},#1} + +% Remark +\newtcolorbox{remark}[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{Remark}{Bemerkung} \usenumberArabic{remark}};},#1} + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Inline environments │ +% ╰────────────────────────────────────────────────╯ +% ──────────────────────────────────────────────────────────────────── + + +% Inline environments (inline) +\newcommand{\inlineex}{\bg{gray}{\translate{Example}{Beispiel}\usenumberArabic{example}:}} +\newcommand{\inlinedef}{\bg{blue}{Definition\usenumberArabic{definition}:}} +\newcommand{\inlineformula}{\bg{red}{\translate{Formula}{Formel}\usenumberArabic{formula}:}} +\newcommand{\inlinelemma}{\bg{Aquamarine}{Lemma\usenumberArabic{lemma}:}} +\newcommand{\inlinetheorem}{\bg{ForestGreen}{\translate{Theorem}{\theoremde}\usenumberArabic{theorem}:}} +\newcommand{\inlineaxiom}{\bg{JungleGreen}{Axiom\usenumberArabic{axiom}:}} +\newcommand{\inlinecorollary}{\bg{teal}{\translate{Corollary}{Korollar}\usenumberArabic{corollary}:}} +\newcommand{\inlinefact}{\bg{SeaGreen}{\translate{Fact}{Fakt}\usenumberArabic{fact}:}} +\newcommand{\inlineproposition}{\bg{Cyan}{Proposition\usenumberArabic{proposition}:}} +\newcommand{\inlineremark}{\bg{green}{\translate{Remark}{Bemerkung}\usenumberArabic{remark}:}} +\newcommand{\inlineproof}{\bg{magenta}{\translate{Proof}{Beweis}:}} + +% Enhanced inline environments +\newcommand{\fancyex}[1]{\bg{gray}{\translate{Example}{Beispiel}\usenumberArabic{example}:} \textit{(#1)}} +\newcommand{\fancydef}[1]{\bg{blue}{Definition\usenumberArabic{definition}:} \textit{(#1)}} +\newcommand{\fancyformula}[1]{\bg{red}{\translate{Formula}{Formel}\usenumberArabic{formula}:} \textit{(#1)}} +\newcommand{\fancylemma}[1]{\bg{Aquamarine}{Lemma\usenumberArabic{lemma}:} \textit{(#1)}} +\newcommand{\fancytheorem}[1]{\bg{ForestGreen}{\translate{Theorem}{\theoremde}\usenumberArabic{theorem}:} \textit{(#1)}} +\newcommand{\fancyaxiom}[1]{\bg{JungleGreen}{Axiom\usenumberArabic{axiom}:} \textit{(#1)}} +\newcommand{\fancycorollary}[1]{\bg{teal}{\translate{Corollary}{Korollar}\usenumberArabic{corollary}:} \textit{(#1)}} +\newcommand{\fancyfact}[1]{\bg{SeaGreen}{\translate{Fact}{Fakt}\usenumberArabic{fact}:} \textit{(#1)}} +\newcommand{\fancyproposition}[1]{\bg{Cyan}{Proposition\usenumberArabic{proposition}:} \textit{(#1)}} +\newcommand{\fancyremark}[1]{\bg{green}{\translate{Remark}{Bemerkung}\usenumberArabic{remark}:} \textit{(#1)}} +\newcommand{\fancyproof}[1]{\bg{magenta}{\translate{Proof}{Beweis}: \textit{(#1)}}} + +% short environments (abbreviated) +\newcommand{\shortex}{\bg{gray}{\translate{Ex}{Bsp}\usenumberArabic{example}:}} +\newcommand{\shortdef}{\bg{blue}{D\usenumberArabic{definition}:}} +\newcommand{\short}{\bg{red}{F\usenumberArabic{formula}:}} +\newcommand{\shortlemma}{\bg{Aquamarine}{L\usenumberArabic{lemma}:}} +\newcommand{\shorttheorem}{\bg{ForestGreen}{\translate{T}{\StrMid{\theoremde}{1}{1}}\usenumberArabic{theorem}:}} +\newcommand{\shortaxiom}{\bg{JungleGreen}{A\usenumberArabic{axiom}:}} +\newcommand{\shortcorollary}{\bg{teal}{\translate{C}{K}\usenumberArabic{corollary}:}} +\newcommand{\shortfact}{\bg{SeaGreen}{F\usenumberArabic{fact}:}} +\newcommand{\shortproposition}{\bg{Cyan}{P\usenumberArabic{proposition}:}} +\newcommand{\shortremark}{\bg{green}{\tr{R}{B}\usenumberArabic{remark}:}} +\newcommand{\shortproof}{\bg{magenta}{\translate{Proof}{Beweis}:}} + +% Enhanced short environments (abbreviated) +\newcommand{\compactex}[1]{\bg{gray}{\translate{Ex}{Bsp}\usenumberArabic{example}:} \textit{(#1)}} +\newcommand{\compactdef}[1]{\bg{blue}{D\usenumberArabic{definition}:} \textit{(#1)}} +\newcommand{\compactformula}[1]{\bg{red}{F\usenumberArabic{formula}:} \textit{(#1)}} +\newcommand{\compactlemma}[1]{\bg{Aquamarine}{L\usenumberArabic{lemma}:} \textit{(#1)}} +\newcommand{\compacttheorem}[1]{\bg{ForestGreen}{\translate{T}{\StrMid{\theoremde}{1}{1}} \usenumberArabic{theorem}:} \textit{(#1)}} +\newcommand{\compactaxiom}[1]{\bg{JungleGreen}{A\usenumberArabic{axiom}:} \textit{(#1)}} +\newcommand{\compactcorollary}[1]{\bg{teal}{\translate{C}{K}\usenumberArabic{corollary}:} \textit{(#1)}} +\newcommand{\compactfact}[1]{\bg{SeaGreen}{F\usenumberArabic{fact}:} \textit{(#1)}} +\newcommand{\compactproposition}[1]{\bg{Cyan}{P\usenumberArabic{proposition}:} \textit{(#1)}} +\newcommand{\compactremark}[1]{\bg{green}{\tr{R}{B}\usenumberArabic{remark}:} \textit{(#1)}} +\newcommand{\compactproof}[1]{\bg{magenta}{\translate{Proof}{Beweis}: \textit{(#1)}}} + +% ▄▄ +% ▄▄█▀▀▀█▄█ ██ ▄█▀▀▀█▄█ ██ +% ▄██▀ ▀█ ██ ▄██ ▀█ +% ██▀ ▀ ▄██▀██▄▀████████▄█████▄ ▀████████▄▀███ ▀███ ██████ ▄▄█▀██▀███▄███ ▀███▄ ▄██▀██▀███ ▄▄█▀██▀████████▄ ▄██▀██ ▄▄█▀██ +% ██ ██▀ ▀██ ██ ██ ██ ██ ▀██ ██ ██ ██ ▄█▀ ██ ██▀ ▀▀ ▀█████▄█▀ ██ ██ ▄█▀ ██ ██ ██ ██▀ ██ ▄█▀ ██ +% ██▄ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀▀▀▀▀ ██ ▄ ▀███ ██ ██▀▀▀▀▀▀ ██ ██ ██ ██▀▀▀▀▀▀ +% ▀██▄ ▄▀██▄ ▄██ ██ ██ ██ ██ ▄██ ██ ██ ██ ██▄ ▄ ██ ██ ███▄ ▄ ██ ██▄ ▄ ██ ██ ██▄ ▄██▄ ▄ +% ▀▀█████▀ ▀█████▀▄████ ████ ████▄ ██████▀ ▀████▀███▄ ▀████ ▀█████▀████▄ █▀█████▀ █████▀▄████▄ ▀█████▀████ ████▄█████▀ ▀█████▀ +% ██ +% ▄████▄ + +\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} +} + +% • ▌ ▄ ·. ▄▄▄· ▄▄▄▄▄ ▄ .▄ .▄▄ · ▄▄▄▄▄ ▄· ▄▌▄▄▌ ▄▄▄ . +% ·██ ▐███▪▐█ ▀█ •██ ██▪▐█ ▐█ ▀. •██ ▐█▪██▌██• ▀▄.▀· +% ▐█ ▌▐▌▐█·▄█▀▀█ ▐█.▪██▀▀█ ▄▀▀▀█▄ ▐█.▪▐█▌▐█▪██ ▪ ▐▀▀▪▄ +% ██ ██▌▐█▌▐█▪ ▐▌ ▐█▌·██▌▐▀ ▐█▄▪▐█ ▐█▌· ▐█▀·.▐█▌ ▄▐█▄▄▌ +% ▀▀ █▪▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀ · ▀▀▀▀ ▀▀▀ ▀ • .▀▀▀ ▀▀▀ + +% Replace some commonly used commands with better ones +\renewcommand{\vec}[1]{\overrightarrow{#1}} +\renewcommand{\hat}[1]{\widehat{#1}} +\renewcommand{\tilde}[1]{\widetilde{#1}} +\newcommand{\proven}{$\hspace{17cm}\square$} + + +% ░█▒░▒▄▀▄░█▄░█░▄▀▒░█▒█▒▄▀▄░▄▀▒▒██▀░░░▄▀▀░▀█▀░▀▄▀░█▒░▒██▀ +% ▒█▄▄░█▀█░█▒▀█░▀▄█░▀▄█░█▀█░▀▄█░█▄▄▒░▒▄██░▒█▒░▒█▒▒█▄▄░█▄▄ + +% Specific styles for language summaries and docs +\newtcolorbox{conjugation}[2][]{mainboxstyle,colback=blue!5!white,colframe=blue!75!black,colbacktitle=blue!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=blue!75!black,fill=blue!75!black] at (frame.north east) {\large \translate{Conjugation}{Konjugation}};},#1} + +\newtcolorbox{forms}[2][]{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 \translate{Forms}{Formen}};},#1} + +% _____ _ _ +% (_ _) ( ) (_ ) +% | | _ _| |_ | | __ ___ +% | | / _ ) _ \ | | / __ \ __) +% | | ( (_| | |_) )| |( ___/__ \ +% (_) \__ _)_ __/(___)\____)____/ + + +\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} +} + +% ___ _ _____ _ _ +% ( _ \ _( ) (_ _) ( ) ( ) +% | (_) )_) |_ | | __ \ \/ / +% | _ (| | _ \ | | / __ \ ) ( +% | (_) ) | |_) ) | | ( ___// /\ \ +% (____/(_)_ __/ (_) \____)_) (_) + +% Configs if you want to use BibTeX. Not included in any default configs. + +\newcommand{\setupBibtex}[1]{ + \usepackage{biblatex} + \usepackage[nottoc, numbib]{tocbibind} + \addbibresource{#1} +} + +\newcommand{\printbib}{ + \addcontentsline{toc}{section}{\translate{Sources}{Quellen}} + \printbibliography[title=\translate{Sources}{Quellen}] +} + + +%░▒█▀▀█░█░░▄▀▀▄░█▀▀░█▀▀░█▀▀▄░█▀▀▄░█░░█ +%░▒█░▄▄░█░░█░░█░▀▀▄░▀▀▄░█▄▄█░█▄▄▀░█▄▄█ +%░▒█▄▄▀░▀▀░░▀▀░░▀▀▀░▀▀▀░▀░░▀░▀░▀▀░▄▄▄▀ + +% Add glossaries functionality + +\newcommand{\setupGlossary}{ + \usepackage[nonumberlist, toc]{glossaries} + \usepackage[nottoc, numbib]{tocbibind} + \makenoidxglossaries +} + +\newcommand{\printGlossary}{ + \glsaddall + \printnoidxglossaries +} + +\usepackage{minted} +\usepackage{fancyvrb} + +\newcommand{\inlinecode}[1]{\shade{gray}{\texttt{#1}}} + +\newenvironment{code}[1]{ + \VerbatimEnvironment + \begin{minted}[ + autogobble, + breaklines, + breakindentnchars=2, + frame=lines, + framesep=2mm, + mathescape, + baselinestretch=1.1, + linenos]{#1}} +{\end{minted}} diff --git a/dist/letter.tex b/dist/letter.tex new file mode 100644 index 0000000..681290b --- /dev/null +++ b/dist/letter.tex @@ -0,0 +1,32 @@ +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} + +\setkomavar{date}{\city, \today} + +\newkomavar{fromplace} % a few koma vars +\setkomavar{fromname}{\name} +\setkomavar{fromaddress}{\street} +\setkomavar{fromplace}{\countrycode -\city} + +\KOMAoptions{foldmarks=off,fromrule=false} +\setkomavar{backaddress}{} + +\makeatletter % indention of the address fields +\setplength{toaddrhpos}{27mm} +\setplength{toaddrwidth}{92mm} +\setplength{sigindent}{0mm} +\makeatother + +\renewcommand*{\raggedsignature}{\raggedright} + +% Define new letter header +\setkomavar{firsthead}{ + \null\hfill + \parbox[t][\headheight][t]{4cm}{% + \vspace*{2cm} + + \usekomavar{fromname} \newline + \usekomavar{fromaddress} \newline + \usekomavar{fromplace} + } +}% diff --git a/dist/minimal.tex b/dist/minimal.tex new file mode 100644 index 0000000..ac6142d --- /dev/null +++ b/dist/minimal.tex @@ -0,0 +1,376 @@ + +% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ +% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █ +% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█ +% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄ +% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █ +% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █ +% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█ + + +% ▄▄█▀▀▀█▄█ +% ▄██▀ ▀█ +% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██ +% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██ +% ██▄ ██ ██ ██ ██▀▀▀▀▀▀ +% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄ +% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀ + +% This file contains all necessary dependencies for the document to compile (at all) and some core macros + +% Imports % +\typeout{[Core] Importing!} +\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} + + +% Language Switching. Currently only English and German are supported +% See docs for how to use +\newcounter{lang} + +\newcommand{\setLang}[1]{ + \edef\lang{#1} + \edef\en{en} + \edef\de{de} + \ifx\lang\en + \typeout{[Lang Switcher] Loading English} + \setcounter{lang}{1} + \else + \ifx\lang\de + \typeout{[Lang Switcher] Loading German} + \setcounter{lang}{2} + \usepackage[ngerman]{babel} + \else + \typeout{[Lang Switcher] No such language!} + \fi + \fi +} + +\newcommand{\loadLang}{ + \ifnum\value{lang}<2{ + \typeout{[Lang Loader] Loaded English} + }\else { + \typeout{[Lang Loader] Loaded German} + \setcounter{lang}{2} + } + \fi +} + + +% Create config counters / variables. See the config file for changing them +\newcounter{numberingConfig} +\newcounter{numberSubsections} +\newcounter{descriptorShadeStrength} +\newcounter{shadeStrength} + +% Set up the latex document, configure author, title (as first argument), as well as headers and footers +\newcommand{\setup}[1]{ + \typeout{[Setup] Setting up...} + \loadLang + \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}} + } +} + +% Start document command (required) +\newcommand{\startDocument}{ + \maketitle + \pagestyle{fancy} + \thispagestyle{fancy} +} + +% Set up the latex document, only configuring the author, title and page size +\newcommand{\setupBarebones}[1]{ + \loadLang + \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + +% Set up the latex document for exam summaries (Extra wide body, small margins, no header) +\newcommand{\setupCheatSheet}[1]{ + \loadLang + \usepackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Translatation │ +% ╰────────────────────────────────────────────────╯ +\newcommand{\translate}[2]{\ifnum\value{lang}<2{#1}\else{#2}\fi} +\newcommand{\tr}[2]{\translate{#1}{#2}} + +% ┌ ┐ +% │ 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 }} + +% ___ ___ +% ( _ \ / ___)_ +% | ( (_) _ ___ | (__ (_) __ +% | | _ / _ \/ _ \ __)| |/ _ \ +% | (_( ) (_) ) ( ) | | | | (_) | +% (____/ \___/(_) (_)_) (_)\__ | +% ( )_) | +% \___/ + +% To be loaded *after* main/core.tex + +% 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} + + +% Configure definition, lemma, theorem, etc numbering behaviour. 1 = Individual, 2 = Combined (apart from Definition), 3 = Combined +\setcounter{numberingConfig}{1} + +% Configure if for definitions, lemmas, etc, numbering should be (0) =
. or (1) =
.. or (2) =
... +\setcounter{numberSubsections}{0} + +% Set the default language. +\setLang{en} + +% Set the default command for theorem translation +\newcommand{\theoremde}{Satz} + + +% ----- % +% STYLE % +% ----- % + +% 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} + +%░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +%░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░ +%▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ +%▒▒ ▒▒▒▒▒▒▒ ▒ ▒ ▒▒▒ ▒ ▒▒▒▒ ▒▒▒▒ +%▓▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓▓ ▓ ▓▓ ▓▓ ▓▓▓ ▓ +%▓▓▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓ ▓ ▓ +%▓ ▓▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓▓▓▓ +%███ ██████ █████ ████ ███ ███ +%██████████████████████ ███████████████████ + +% Global style configs for tcolorbox (to reduce bloat) +\newcommand{\usetcolorboxes}{ + \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 + } + } +} + +% -------------------- % +% Small style elements % +% -------------------- % +\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} + } + } +} +\newcommand{\rmvspace}{\vspace{-0.5pc}} +\newcommand{\drmvspace}{\vspace{-1pc}} +\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=2pt, + left=0pt, + right=0pt, + top=0pt, + bottom=0pt, + colframe=white, + 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}} + +% Add a gray backdrop +\newcommand{\backdrop}[1]{\shade{black}{#1}} + + +% Fancy highlighting (Bold, underlined, colorbox behind it. Shorthand for \fhlc{white}{#1} +\newcommand{\fhl}[1]{\fhlc{white}{#1}} + +% Add a colorbox around your text with the color specified. Text is bold and underlined +\newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}} + +% Spacing (horizontal) +\newcommand{\smallhspace}{\hspace{2mm}} +\newcommand{\mediumhspace}{\hspace{5mm}} +\newcommand{\largehspace}{\hspace{1cm}} + +% ----------------- % +% Table of contents % +% ----------------- % + +% 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 \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable] + \hspace{1cm} + \tableofcontents + \end{tcolorbox} +} + +%▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ +%██░▄▄▀█▀▄▄▀█░▄▀▄░█░▄▀▄░█▀▄▄▀█░▄▄▀ +%██░████░██░█░█▄█░█░█▄█░█░██░█░██░ +%██░▀▀▄██▄▄██▄███▄█▄███▄██▄▄██▄██▄ +%▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ + +\newtcolorbox{recall}[2][]{mainboxstyle,colback=yellow!5!white,colframe=yellow!75!black,colbacktitle=yellow!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=yellow!75!black,,fill=yellow!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} diff --git a/dist/most.tex b/dist/most.tex new file mode 100644 index 0000000..5ff045f --- /dev/null +++ b/dist/most.tex @@ -0,0 +1,1004 @@ + +% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ +% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █ +% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█ +% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄ +% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █ +% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █ +% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█ + + +% ▄▄█▀▀▀█▄█ +% ▄██▀ ▀█ +% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██ +% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██ +% ██▄ ██ ██ ██ ██▀▀▀▀▀▀ +% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄ +% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀ + +% This file contains all necessary dependencies for the document to compile (at all) and some core macros + +% Imports % +\typeout{[Core] Importing!} +\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} + + +% Language Switching. Currently only English and German are supported +% See docs for how to use +\newcounter{lang} + +\newcommand{\setLang}[1]{ + \edef\lang{#1} + \edef\en{en} + \edef\de{de} + \ifx\lang\en + \typeout{[Lang Switcher] Loading English} + \setcounter{lang}{1} + \else + \ifx\lang\de + \typeout{[Lang Switcher] Loading German} + \setcounter{lang}{2} + \usepackage[ngerman]{babel} + \else + \typeout{[Lang Switcher] No such language!} + \fi + \fi +} + +\newcommand{\loadLang}{ + \ifnum\value{lang}<2{ + \typeout{[Lang Loader] Loaded English} + }\else { + \typeout{[Lang Loader] Loaded German} + \setcounter{lang}{2} + } + \fi +} + + +% Create config counters / variables. See the config file for changing them +\newcounter{numberingConfig} +\newcounter{numberSubsections} +\newcounter{descriptorShadeStrength} +\newcounter{shadeStrength} + +% Set up the latex document, configure author, title (as first argument), as well as headers and footers +\newcommand{\setup}[1]{ + \typeout{[Setup] Setting up...} + \loadLang + \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}} + } +} + +% Start document command (required) +\newcommand{\startDocument}{ + \maketitle + \pagestyle{fancy} + \thispagestyle{fancy} +} + +% Set up the latex document, only configuring the author, title and page size +\newcommand{\setupBarebones}[1]{ + \loadLang + \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + +% Set up the latex document for exam summaries (Extra wide body, small margins, no header) +\newcommand{\setupCheatSheet}[1]{ + \loadLang + \usepackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Translatation │ +% ╰────────────────────────────────────────────────╯ +\newcommand{\translate}[2]{\ifnum\value{lang}<2{#1}\else{#2}\fi} +\newcommand{\tr}[2]{\translate{#1}{#2}} + +% ┌ ┐ +% │ 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 }} + +% ___ ___ +% ( _ \ / ___)_ +% | ( (_) _ ___ | (__ (_) __ +% | | _ / _ \/ _ \ __)| |/ _ \ +% | (_( ) (_) ) ( ) | | | | (_) | +% (____/ \___/(_) (_)_) (_)\__ | +% ( )_) | +% \___/ + +% To be loaded *after* main/core.tex + +% 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} + + +% Configure definition, lemma, theorem, etc numbering behaviour. 1 = Individual, 2 = Combined (apart from Definition), 3 = Combined +\setcounter{numberingConfig}{1} + +% Configure if for definitions, lemmas, etc, numbering should be (0) =
. or (1) =
.. or (2) =
... +\setcounter{numberSubsections}{0} + +% Set the default language. +\setLang{en} + +% Set the default command for theorem translation +\newcommand{\theoremde}{Satz} + + +% ----- % +% STYLE % +% ----- % + +% 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} + +%░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +%░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░ +%▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ +%▒▒ ▒▒▒▒▒▒▒ ▒ ▒ ▒▒▒ ▒ ▒▒▒▒ ▒▒▒▒ +%▓▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓▓ ▓ ▓▓ ▓▓ ▓▓▓ ▓ +%▓▓▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓ ▓ ▓ +%▓ ▓▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓▓▓▓ +%███ ██████ █████ ████ ███ ███ +%██████████████████████ ███████████████████ + +% Global style configs for tcolorbox (to reduce bloat) +\newcommand{\usetcolorboxes}{ + \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 + } + } +} + +% -------------------- % +% Small style elements % +% -------------------- % +\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} + } + } +} +\newcommand{\rmvspace}{\vspace{-0.5pc}} +\newcommand{\drmvspace}{\vspace{-1pc}} +\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=2pt, + left=0pt, + right=0pt, + top=0pt, + bottom=0pt, + colframe=white, + 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}} + +% Add a gray backdrop +\newcommand{\backdrop}[1]{\shade{black}{#1}} + + +% Fancy highlighting (Bold, underlined, colorbox behind it. Shorthand for \fhlc{white}{#1} +\newcommand{\fhl}[1]{\fhlc{white}{#1}} + +% Add a colorbox around your text with the color specified. Text is bold and underlined +\newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}} + +% Spacing (horizontal) +\newcommand{\smallhspace}{\hspace{2mm}} +\newcommand{\mediumhspace}{\hspace{5mm}} +\newcommand{\largehspace}{\hspace{1cm}} + +% ----------------- % +% Table of contents % +% ----------------- % + +% 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 \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable] + \hspace{1cm} + \tableofcontents + \end{tcolorbox} +} + +%▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ +%██░▄▄▀█▀▄▄▀█░▄▀▄░█░▄▀▄░█▀▄▄▀█░▄▄▀ +%██░████░██░█░█▄█░█░█▄█░█░██░█░██░ +%██░▀▀▄██▄▄██▄███▄█▄███▄██▄▄██▄██▄ +%▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ + +\newtcolorbox{recall}[2][]{mainboxstyle,colback=yellow!5!white,colframe=yellow!75!black,colbacktitle=yellow!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=yellow!75!black,,fill=yellow!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} + +% ▄▄ +% ▀████▄ ▄███▀ ██ ███ +% ████ ████ ██ ██ +% █ ██ ▄█ ██ ▄█▀██▄ ██████ ███████▄ +% █ ██ █▀ ██ ██ ██ ██ ██ ██ +% █ ██▄█▀ ██ ▄█████ ██ ██ ██ +% █ ▀██▀ ██ ██ ██ ██ ██ ██ +% ▄███▄ ▀▀ ▄████▄████▀██▄ ▀███████ ████▄ + + +% BB shortcuts (for number spaces, etc) +\newcommand{\C}{\mathbb{C}} +\newcommand{\D}{\mathbb{D}} +\newcommand{\E}{\mathbb{E}} +\newcommand{\I}{\mathbb{I}} +\newcommand{\J}{\mathbb{J}} +\newcommand{\N}{\mathbb{N}} +\newcommand{\Q}{\mathbb{Q}} +\newcommand{\R}{\mathbb{R}} +\newcommand{\V}{\mathbb{V}} +\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{\8}{\infty} +\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{\mbeq}{\overset{!}{=}} +\newcommand{\lcm}{\text{lcm}} +\newcommand{\limit}[2]{\lim_{#1 \rightarrow #2}} +\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}} +\newcommand{\elementstack}[2]{\genfrac{}{}{0pt}{}{#1}{#2}} +\DeclareMathOperator\arctanh{arctanh} +\DeclareMathOperator\arccosh{arccosh} +\DeclareMathOperator\arcsinh{arcsinh} + + +% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ +% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ +% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ + +% Extra imports +\usepackage{stmaryrd} +\usepackage{algorithm} +\usepackage{algpseudocodex} +\usepackage{setspace} +\usepackage{verbatim} +\usepackage{turnstile} +\usepackage{forloop} + +\newcommand{\Indent}{\hspace{\algorithmicindent}} + +\newcommand{\timecomplexity}{\fhlc{orange}{\ifnum\value{lang}<2{Time complexity}\else {Laufzeit}\fi} \hspace{0.5em}} +\newcommand{\tc}[1]{\timecomplexity $\Theta\left(#1\right)$} +\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}}} + +% ▄▄ +% ▀████▀ ▀███ +% ██ ██ +% ██ ▀████████▄ ▄█▀▀███ ▄▄█▀██▀██▀ ▀██▀ +% ██ ██ ██ ▄██ ██ ▄█▀ ██ ▀██ ▄█▀ +% ██ ██ ██ ███ ██ ██▀▀▀▀▀▀ ███ +% ██ ██ ██ ▀██ ██ ██▄ ▄ ▄█▀ ██▄ +% ▄████▄████ ████▄ ▀████▀███▄ ▀█████▀██▄ ▄██▄ + + +% 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} + + + +% ▄▄· ▄• ▄▌ ▐ ▄ ▄▄▄▄▄▄▄▄ .▄▄▄ +% ▐█ ▌▪ ▄█▀▄ █▪██▌•█▌▐█•██ ▀▄.▀·▀▄ █· +% ██ ▄▄▐█▌.▐▌█▌▐█▌▐█▐▐▌ ▐█.▪▐▀▀▪▄▐▀▀▄ +% ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌ +% ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀ + +\usepackage{xstring} +\usepackage{etoolbox} +% tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters +\newcounter{lemma}[section] +\newcounter{definition}[section] +\newcounter{corollary}[section] +\newcounter{theorem}[section] +\newcounter{axiom}[section] +\newcounter{example}[section] +\newcounter{fact}[section] +\newcounter{proposition}[section] +\newcounter{formula}[section] +\newcounter{remark}[section] +\newcounter{all}[section] + +\newcounter{lemmass}[subsection] +\newcounter{definitionss}[subsection] +\newcounter{corollaryss}[subsection] +\newcounter{theoremss}[subsection] +\newcounter{axiomss}[subsection] +\newcounter{exampless}[subsection] +\newcounter{factss}[subsection] +\newcounter{propositionss}[subsection] +\newcounter{formulass}[subsection] +\newcounter{remarkss}[subsection] +\newcounter{allss}[subsection] + +\newcounter{lemmasss}[subsubsection] +\newcounter{definitionsss}[subsubsection] +\newcounter{corollarysss}[subsubsection] +\newcounter{theoremsss}[subsubsection] +\newcounter{axiomsss}[subsubsection] +\newcounter{examplesss}[subsubsection] +\newcounter{factsss}[subsubsection] +\newcounter{propositionsss}[subsubsection] +\newcounter{formulasss}[subsubsection] +\newcounter{remarksss}[subsubsection] +\newcounter{allsss}[subsubsection] + +% Set the current number of a label +\newcommand{\setLabelNumber}[2]{% + \setcounter{#1}{#2}% + \addtocounter{#1}{-1}% + \setcounter{#1ss}{#2}% + \addtocounter{#1ss}{-1}% + \setcounter{#1sss}{#2}% + \addtocounter{#1sss}{-1}% +} + +\newcommand{\stepLabelNumber}[1]{% + \stepcounter{#1}% + \stepcounter{#1ss}% + \stepcounter{#1sss}% +} + +\newcommand{\printcounter}[1]{% + \csname the#1\endcsname +} + +\newcommand{\suffix}{ss} +\newcommand{\sectionNumbering}{\thesection} + +% ┌ ┐ +% │ Counter numbering │ +% └ ┘ +\newcommand{\preTableAndFigHook}[1]{% + \ifnum\value{numberingConfig}>1 + \ifnum\value{numberSubsections}=1 + \stepcounter{allss} + \else + \ifnum\value{numberSubsections}=2 + \stepcounter{allsss} + \else + \stepcounter{all} + \fi + \fi + \fi +} +\AtBeginEnvironment{table}{\preTableAndFigHook{table}} +\AtBeginEnvironment{figure}{\preTableAndFigHook{figure}} + +\newcommand{\applyTableAndFigureNumbering}{ + % Tables & Figures + \ifnum\value{numberingConfig}=0 + \renewcommand{\thetable}{} + \renewcommand{\thefigure}{} + \else + \ifnum\value{numberingConfig}=1 + \renewcommand{\thetable}{\sectionNumbering.\arabic{table}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{figure}} + \else + \ifnum\value{numberSubsections}=1 + \renewcommand{\thetable}{\sectionNumbering.\arabic{allss}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{allss}} + \else + \ifnum\value{numberSubsections}=2 + \renewcommand{\thetable}{\refstepcounter{allsss}\sectionNumbering.\arabic{allsss}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{allsss}} + \else + \renewcommand{\thetable}{\sectionNumbering.\arabic{all}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{all}} + \fi + \fi + \fi + \fi +} + +\newcommand{\setSubsectionNumbering}[1]{ + \setcounter{numberSubsections}{#1} + \applySubsectionNumbering +} + +\newcommand{\applySubsectionNumbering}{ + \ifnum\value{numberSubsections}=1 + \renewcommand{\sectionNumbering}{\thesubsection} + \renewcommand{\suffix}{ss} + \typeout{Numbering as section.subsection.number} + \else + \ifnum\value{numberSubsections}=2 + \renewcommand{\sectionNumbering}{\thesubsubsection} + \renewcommand{\suffix}{sss} + \typeout{Numbering as section.subsection.subsubsection.number} + \else + \renewcommand{\sectionNumbering}{\thesection} + \renewcommand{\suffix}{} + \typeout{Numbering as section.number} + \fi + \fi + \applyTableAndFigureNumbering + + \renewcommand{\thelemma}{\sectionNumbering.\arabic{lemma}} + \renewcommand{\thedefinition}{\sectionNumbering.\arabic{definition}} + \renewcommand{\thecorollary}{\sectionNumbering.\arabic{corollary}} + \renewcommand{\thetheorem}{\sectionNumbering.\arabic{theorem}} + \renewcommand{\theaxiom}{\sectionNumbering.\arabic{axiom}} + \renewcommand{\theexample}{\sectionNumbering.\arabic{example}} + \renewcommand{\thefact}{\sectionNumbering.\arabic{fact}} + \renewcommand{\theproposition}{\sectionNumbering.\arabic{proposition}} + \renewcommand{\theformula}{\sectionNumbering.\arabic{formula}} + \renewcommand{\theremark}{\sectionNumbering.\arabic{remark}} + \renewcommand{\theall}{\sectionNumbering.\arabic{all}} + + \renewcommand{\thelemmass}{\sectionNumbering.\arabic{lemmass}} + \renewcommand{\thedefinitionss}{\sectionNumbering.\arabic{definitionss}} + \renewcommand{\thecorollaryss}{\sectionNumbering.\arabic{corollaryss}} + \renewcommand{\thetheoremss}{\sectionNumbering.\arabic{theoremss}} + \renewcommand{\theaxiomss}{\sectionNumbering.\arabic{axiomss}} + \renewcommand{\theexampless}{\sectionNumbering.\arabic{exampless}} + \renewcommand{\thefactss}{\sectionNumbering.\arabic{factss}} + \renewcommand{\thepropositionss}{\sectionNumbering.\arabic{propositionss}} + \renewcommand{\theformulass}{\sectionNumbering.\arabic{formulass}} + \renewcommand{\theremarkss}{\sectionNumbering.\arabic{remarkss}} + \renewcommand{\theallss}{\sectionNumbering.\arabic{allss}} + + \renewcommand{\thelemmasss}{\sectionNumbering.\arabic{lemmasss}} + \renewcommand{\thedefinitionsss}{\sectionNumbering.\arabic{definitionsss}} + \renewcommand{\thecorollarysss}{\sectionNumbering.\arabic{corollarysss}} + \renewcommand{\thetheoremsss}{\sectionNumbering.\arabic{theoremsss}} + \renewcommand{\theaxiomsss}{\sectionNumbering.\arabic{axiomsss}} + \renewcommand{\theexamplesss}{\sectionNumbering.\arabic{examplesss}} + \renewcommand{\thefactsss}{\sectionNumbering.\arabic{factsss}} + \renewcommand{\thepropositionsss}{\sectionNumbering.\arabic{propositionsss}} + \renewcommand{\theformulasss}{\sectionNumbering.\arabic{formulasss}} + \renewcommand{\theremarksss}{\sectionNumbering.\arabic{remarksss}} + \renewcommand{\theallsss}{\sectionNumbering.\arabic{allsss}} +} +\applySubsectionNumbering + +% ── Label generation ──────────────────────────────────────────────── +\newcommand{\labelSectionGeneration}{% + \ifnum\value{numberSubsections}=1 + \arabic{section}-\arabic{subsection}% + \else + \ifnum\value{numberSubsections}=2 + \arabic{section}-\arabic{subsection}-\arabic{subsubsection}% + \else + \arabic{section}% + \fi + \fi} + +\newcommand{\labelIt}[1]{\refstepcounter{#1\suffix}\edef\tempLabel{\genLabel{#1}{\arabic{#1\suffix}}}\label{\tempLabel}} +\newcommand{\genLabel}[2]{#1:\labelSectionGeneration-#2} + +% ┌ ┐ +% │ Number the counters appropriately │ +% └ ┘ +\newcommand{\usenumberArabic}[1]{% + \ifnum\value{numberingConfig}=1 + \labelIt{#1} + \printcounter{#1\suffix}% + \else + \ifnum\value{numberingConfig}=2 + \ifthenelse{\equal{#1}{definitions}}{% + \labelIt{definition} + \printcounter{definition\suffix}% + }{% + \labelIt{all} + \printcounter{all\suffix}% + }% + \else + \ifnum\value{numberingConfig}=3 + \labelIt{all} + \printcounter{all\suffix}% + \else + \relax% + \fi + \fi + \fi} + + +% ──────────────────────────────────────────────────────────────────── +% ┌ ┐ +% │ Enable or disable numbering │ +% └ ┘ +% Initialize with config file +\newcounter{numberingConfigStore} +\setcounter{numberingConfigStore}{\value{numberingConfig}} + +% For later change +\newcommand{\setNumberingStyle}[1]{ + \typeout{Setting NumberingStyle to #1} + \setcounter{numberingConfig}{#1} + \ifthenelse{\equal{#1}{0}}{}{ + \setcounter{numberingConfigStore}{#1} + } + \applyTableAndFigureNumbering +} + +% Enable / disable numbering +\newcommand{\numberingOff}{ + \setcounter{numberingConfig}{0} + \applyTableAndFigureNumbering +} +\newcommand{\numberingOn}{ + \setcounter{numberingConfig}{\value{numberingConfigStore}} + \applyTableAndFigureNumbering +} + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Reset definition, lemma, etc counters, add a │ +% │ new page │ +% ╰────────────────────────────────────────────────╯ +\newcommand{\newsection}{ + \newpage + \newsectionNoPB +} + +% ── Reset definitions, lemma, etc counters, do not add new page ───── +\newcommand{\newsectionNoPB}{ + \setcounter{lemma}{0} + \setcounter{definition}{0} + \setcounter{corollary}{0} + \setcounter{theorem}{0} + \setcounter{axiom}{0} + \setcounter{example}{0} + \setcounter{fact}{0} + \setcounter{proposition}{0} + \setcounter{formula}{0} + \setcounter{remark}{0} + \setcounter{all}{0} + + \setcounter{lemmass}{0} + \setcounter{definitionss}{0} + \setcounter{corollaryss}{0} + \setcounter{theoremss}{0} + \setcounter{axiomss}{0} + \setcounter{exampless}{0} + \setcounter{factss}{0} + \setcounter{propositionss}{0} + \setcounter{formulass}{0} + \setcounter{remarkss}{0} + \setcounter{allss}{0} + + \setcounter{lemmasss}{0} + \setcounter{definitionsss}{0} + \setcounter{corollarysss}{0} + \setcounter{theoremsss}{0} + \setcounter{axiomsss}{0} + \setcounter{examplesss}{0} + \setcounter{factsss}{0} + \setcounter{propositionsss}{0} + \setcounter{formulasss}{0} + \setcounter{remarksss}{0} + \setcounter{allsss}{0} + + % Tables & Figures + \setcounter{table}{0} + \setcounter{figure}{0} +} +\newsectionNoPB % Initializes + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Tcolorboxes │ +% ╰────────────────────────────────────────────────╯ +% ──────────────────────────────────────────────────────────────────── + +% Definitions +\newtcolorbox{definition}[2][]{mainboxstyle,colback=blue!5!white,colframe=blue!75!black,colbacktitle=blue!75!black,title={\large #2},overlay={\node[overlaystyle,draw=blue!75!black,fill=blue!75!black] at (frame.north east) {\large Definition\usenumberArabic{definition}};},#1} + +% Theorems +\newtcolorbox{theorem}[2][]{mainboxstyle,colback=ForestGreen!5!white,colframe=ForestGreen!75!black,colbacktitle=ForestGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=ForestGreen!75!black,fill=ForestGreen!75!black] at (frame.north east) {\large \translate{Theorem}{\theoremde}\usenumberArabic{theorem}};},#1} + +% Lemmas +\newtcolorbox{lemma}[2][]{mainboxstyle,colback=Aquamarine!5!white,colframe=Aquamarine!75!black,colbacktitle=Aquamarine!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Aquamarine!75!black,fill=Aquamarine!75!black] at (frame.north east) {\large Lemma\usenumberArabic{lemma}};},#1} + +% Corollaries +\newtcolorbox{corollary}[2][]{mainboxstyle,colback=teal!5!white,colframe=teal!75!black,colbacktitle=teal!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=teal!75!black,fill=teal!75!black] at (frame.north east) {\large \translate{Corollary}{Korollar}\usenumberArabic{corollary}};},#1} + +% Axioms +\newtcolorbox{axiom}[2][]{mainboxstyle,colback=JungleGreen!5!white,colframe=JungleGreen!75!black,colbacktitle=JungleGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=JungleGreen!75!black,fill=JungleGreen!75!black] at (frame.north east) {\large Axiom\usenumberArabic{axiom}};},#1} + +% Facts +\newtcolorbox{fact}[2][]{mainboxstyle,colback=SeaGreen!5!white,colframe=SeaGreen!75!black,colbacktitle=SeaGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=SeaGreen!75!black,fill=SeaGreen!75!black] at (frame.north east) {\large \translate{Fact}{Fakt}\usenumberArabic{fact}};},#1} + +% Propositions +\newtcolorbox{proposition}[2][]{mainboxstyle,colback=Cyan!5!white,colframe=Cyan!75!black,colbacktitle=Cyan!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Cyan!75!black,fill=Cyan!75!black] at (frame.north east) {\large Proposition\usenumberArabic{proposition}};},#1} + +% Examples +\newtcolorbox{example}[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{Example}{Beispiel}\usenumberArabic{example}};},#1} + +% Formula +\newtcolorbox{formula}[2][]{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 \translate{Formula}{Formel}\usenumberArabic{formula}};},#1} + +% Remark +\newtcolorbox{remark}[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{Remark}{Bemerkung} \usenumberArabic{remark}};},#1} + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Inline environments │ +% ╰────────────────────────────────────────────────╯ +% ──────────────────────────────────────────────────────────────────── + + +% Inline environments (inline) +\newcommand{\inlineex}{\bg{gray}{\translate{Example}{Beispiel}\usenumberArabic{example}:}} +\newcommand{\inlinedef}{\bg{blue}{Definition\usenumberArabic{definition}:}} +\newcommand{\inlineformula}{\bg{red}{\translate{Formula}{Formel}\usenumberArabic{formula}:}} +\newcommand{\inlinelemma}{\bg{Aquamarine}{Lemma\usenumberArabic{lemma}:}} +\newcommand{\inlinetheorem}{\bg{ForestGreen}{\translate{Theorem}{\theoremde}\usenumberArabic{theorem}:}} +\newcommand{\inlineaxiom}{\bg{JungleGreen}{Axiom\usenumberArabic{axiom}:}} +\newcommand{\inlinecorollary}{\bg{teal}{\translate{Corollary}{Korollar}\usenumberArabic{corollary}:}} +\newcommand{\inlinefact}{\bg{SeaGreen}{\translate{Fact}{Fakt}\usenumberArabic{fact}:}} +\newcommand{\inlineproposition}{\bg{Cyan}{Proposition\usenumberArabic{proposition}:}} +\newcommand{\inlineremark}{\bg{green}{\translate{Remark}{Bemerkung}\usenumberArabic{remark}:}} +\newcommand{\inlineproof}{\bg{magenta}{\translate{Proof}{Beweis}:}} + +% Enhanced inline environments +\newcommand{\fancyex}[1]{\bg{gray}{\translate{Example}{Beispiel}\usenumberArabic{example}:} \textit{(#1)}} +\newcommand{\fancydef}[1]{\bg{blue}{Definition\usenumberArabic{definition}:} \textit{(#1)}} +\newcommand{\fancyformula}[1]{\bg{red}{\translate{Formula}{Formel}\usenumberArabic{formula}:} \textit{(#1)}} +\newcommand{\fancylemma}[1]{\bg{Aquamarine}{Lemma\usenumberArabic{lemma}:} \textit{(#1)}} +\newcommand{\fancytheorem}[1]{\bg{ForestGreen}{\translate{Theorem}{\theoremde}\usenumberArabic{theorem}:} \textit{(#1)}} +\newcommand{\fancyaxiom}[1]{\bg{JungleGreen}{Axiom\usenumberArabic{axiom}:} \textit{(#1)}} +\newcommand{\fancycorollary}[1]{\bg{teal}{\translate{Corollary}{Korollar}\usenumberArabic{corollary}:} \textit{(#1)}} +\newcommand{\fancyfact}[1]{\bg{SeaGreen}{\translate{Fact}{Fakt}\usenumberArabic{fact}:} \textit{(#1)}} +\newcommand{\fancyproposition}[1]{\bg{Cyan}{Proposition\usenumberArabic{proposition}:} \textit{(#1)}} +\newcommand{\fancyremark}[1]{\bg{green}{\translate{Remark}{Bemerkung}\usenumberArabic{remark}:} \textit{(#1)}} +\newcommand{\fancyproof}[1]{\bg{magenta}{\translate{Proof}{Beweis}: \textit{(#1)}}} + +% short environments (abbreviated) +\newcommand{\shortex}{\bg{gray}{\translate{Ex}{Bsp}\usenumberArabic{example}:}} +\newcommand{\shortdef}{\bg{blue}{D\usenumberArabic{definition}:}} +\newcommand{\short}{\bg{red}{F\usenumberArabic{formula}:}} +\newcommand{\shortlemma}{\bg{Aquamarine}{L\usenumberArabic{lemma}:}} +\newcommand{\shorttheorem}{\bg{ForestGreen}{\translate{T}{\StrMid{\theoremde}{1}{1}}\usenumberArabic{theorem}:}} +\newcommand{\shortaxiom}{\bg{JungleGreen}{A\usenumberArabic{axiom}:}} +\newcommand{\shortcorollary}{\bg{teal}{\translate{C}{K}\usenumberArabic{corollary}:}} +\newcommand{\shortfact}{\bg{SeaGreen}{F\usenumberArabic{fact}:}} +\newcommand{\shortproposition}{\bg{Cyan}{P\usenumberArabic{proposition}:}} +\newcommand{\shortremark}{\bg{green}{\tr{R}{B}\usenumberArabic{remark}:}} +\newcommand{\shortproof}{\bg{magenta}{\translate{Proof}{Beweis}:}} + +% Enhanced short environments (abbreviated) +\newcommand{\compactex}[1]{\bg{gray}{\translate{Ex}{Bsp}\usenumberArabic{example}:} \textit{(#1)}} +\newcommand{\compactdef}[1]{\bg{blue}{D\usenumberArabic{definition}:} \textit{(#1)}} +\newcommand{\compactformula}[1]{\bg{red}{F\usenumberArabic{formula}:} \textit{(#1)}} +\newcommand{\compactlemma}[1]{\bg{Aquamarine}{L\usenumberArabic{lemma}:} \textit{(#1)}} +\newcommand{\compacttheorem}[1]{\bg{ForestGreen}{\translate{T}{\StrMid{\theoremde}{1}{1}} \usenumberArabic{theorem}:} \textit{(#1)}} +\newcommand{\compactaxiom}[1]{\bg{JungleGreen}{A\usenumberArabic{axiom}:} \textit{(#1)}} +\newcommand{\compactcorollary}[1]{\bg{teal}{\translate{C}{K}\usenumberArabic{corollary}:} \textit{(#1)}} +\newcommand{\compactfact}[1]{\bg{SeaGreen}{F\usenumberArabic{fact}:} \textit{(#1)}} +\newcommand{\compactproposition}[1]{\bg{Cyan}{P\usenumberArabic{proposition}:} \textit{(#1)}} +\newcommand{\compactremark}[1]{\bg{green}{\tr{R}{B}\usenumberArabic{remark}:} \textit{(#1)}} +\newcommand{\compactproof}[1]{\bg{magenta}{\translate{Proof}{Beweis}: \textit{(#1)}}} + +% ▄▄ +% ▄▄█▀▀▀█▄█ ██ ▄█▀▀▀█▄█ ██ +% ▄██▀ ▀█ ██ ▄██ ▀█ +% ██▀ ▀ ▄██▀██▄▀████████▄█████▄ ▀████████▄▀███ ▀███ ██████ ▄▄█▀██▀███▄███ ▀███▄ ▄██▀██▀███ ▄▄█▀██▀████████▄ ▄██▀██ ▄▄█▀██ +% ██ ██▀ ▀██ ██ ██ ██ ██ ▀██ ██ ██ ██ ▄█▀ ██ ██▀ ▀▀ ▀█████▄█▀ ██ ██ ▄█▀ ██ ██ ██ ██▀ ██ ▄█▀ ██ +% ██▄ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀▀▀▀▀ ██ ▄ ▀███ ██ ██▀▀▀▀▀▀ ██ ██ ██ ██▀▀▀▀▀▀ +% ▀██▄ ▄▀██▄ ▄██ ██ ██ ██ ██ ▄██ ██ ██ ██ ██▄ ▄ ██ ██ ███▄ ▄ ██ ██▄ ▄ ██ ██ ██▄ ▄██▄ ▄ +% ▀▀█████▀ ▀█████▀▄████ ████ ████▄ ██████▀ ▀████▀███▄ ▀████ ▀█████▀████▄ █▀█████▀ █████▀▄████▄ ▀█████▀████ ████▄█████▀ ▀█████▀ +% ██ +% ▄████▄ + +\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} +} + +% • ▌ ▄ ·. ▄▄▄· ▄▄▄▄▄ ▄ .▄ .▄▄ · ▄▄▄▄▄ ▄· ▄▌▄▄▌ ▄▄▄ . +% ·██ ▐███▪▐█ ▀█ •██ ██▪▐█ ▐█ ▀. •██ ▐█▪██▌██• ▀▄.▀· +% ▐█ ▌▐▌▐█·▄█▀▀█ ▐█.▪██▀▀█ ▄▀▀▀█▄ ▐█.▪▐█▌▐█▪██ ▪ ▐▀▀▪▄ +% ██ ██▌▐█▌▐█▪ ▐▌ ▐█▌·██▌▐▀ ▐█▄▪▐█ ▐█▌· ▐█▀·.▐█▌ ▄▐█▄▄▌ +% ▀▀ █▪▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀ · ▀▀▀▀ ▀▀▀ ▀ • .▀▀▀ ▀▀▀ + +% Replace some commonly used commands with better ones +\renewcommand{\vec}[1]{\overrightarrow{#1}} +\renewcommand{\hat}[1]{\widehat{#1}} +\renewcommand{\tilde}[1]{\widetilde{#1}} +\newcommand{\proven}{$\hspace{17cm}\square$} + + +% ░█▒░▒▄▀▄░█▄░█░▄▀▒░█▒█▒▄▀▄░▄▀▒▒██▀░░░▄▀▀░▀█▀░▀▄▀░█▒░▒██▀ +% ▒█▄▄░█▀█░█▒▀█░▀▄█░▀▄█░█▀█░▀▄█░█▄▄▒░▒▄██░▒█▒░▒█▒▒█▄▄░█▄▄ + +% Specific styles for language summaries and docs +\newtcolorbox{conjugation}[2][]{mainboxstyle,colback=blue!5!white,colframe=blue!75!black,colbacktitle=blue!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=blue!75!black,fill=blue!75!black] at (frame.north east) {\large \translate{Conjugation}{Konjugation}};},#1} + +\newtcolorbox{forms}[2][]{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 \translate{Forms}{Formen}};},#1} + +% _____ _ _ +% (_ _) ( ) (_ ) +% | | _ _| |_ | | __ ___ +% | | / _ ) _ \ | | / __ \ __) +% | | ( (_| | |_) )| |( ___/__ \ +% (_) \__ _)_ __/(___)\____)____/ + + +\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} +} diff --git a/dist/recommended.tex b/dist/recommended.tex new file mode 100644 index 0000000..87a55cb --- /dev/null +++ b/dist/recommended.tex @@ -0,0 +1,1042 @@ + +% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ +% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █ +% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█ +% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄ +% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █ +% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █ +% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█ + + +% ▄▄█▀▀▀█▄█ +% ▄██▀ ▀█ +% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██ +% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██ +% ██▄ ██ ██ ██ ██▀▀▀▀▀▀ +% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄ +% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀ + +% This file contains all necessary dependencies for the document to compile (at all) and some core macros + +% Imports % +\typeout{[Core] Importing!} +\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} + + +% Language Switching. Currently only English and German are supported +% See docs for how to use +\newcounter{lang} + +\newcommand{\setLang}[1]{ + \edef\lang{#1} + \edef\en{en} + \edef\de{de} + \ifx\lang\en + \typeout{[Lang Switcher] Loading English} + \setcounter{lang}{1} + \else + \ifx\lang\de + \typeout{[Lang Switcher] Loading German} + \setcounter{lang}{2} + \usepackage[ngerman]{babel} + \else + \typeout{[Lang Switcher] No such language!} + \fi + \fi +} + +\newcommand{\loadLang}{ + \ifnum\value{lang}<2{ + \typeout{[Lang Loader] Loaded English} + }\else { + \typeout{[Lang Loader] Loaded German} + \setcounter{lang}{2} + } + \fi +} + + +% Create config counters / variables. See the config file for changing them +\newcounter{numberingConfig} +\newcounter{numberSubsections} +\newcounter{descriptorShadeStrength} +\newcounter{shadeStrength} + +% Set up the latex document, configure author, title (as first argument), as well as headers and footers +\newcommand{\setup}[1]{ + \typeout{[Setup] Setting up...} + \loadLang + \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}} + } +} + +% Start document command (required) +\newcommand{\startDocument}{ + \maketitle + \pagestyle{fancy} + \thispagestyle{fancy} +} + +% Set up the latex document, only configuring the author, title and page size +\newcommand{\setupBarebones}[1]{ + \loadLang + \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + +% Set up the latex document for exam summaries (Extra wide body, small margins, no header) +\newcommand{\setupCheatSheet}[1]{ + \loadLang + \usepackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Translatation │ +% ╰────────────────────────────────────────────────╯ +\newcommand{\translate}[2]{\ifnum\value{lang}<2{#1}\else{#2}\fi} +\newcommand{\tr}[2]{\translate{#1}{#2}} + +% ┌ ┐ +% │ 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 }} + +% ___ ___ +% ( _ \ / ___)_ +% | ( (_) _ ___ | (__ (_) __ +% | | _ / _ \/ _ \ __)| |/ _ \ +% | (_( ) (_) ) ( ) | | | | (_) | +% (____/ \___/(_) (_)_) (_)\__ | +% ( )_) | +% \___/ + +% To be loaded *after* main/core.tex + +% 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} + + +% Configure definition, lemma, theorem, etc numbering behaviour. 1 = Individual, 2 = Combined (apart from Definition), 3 = Combined +\setcounter{numberingConfig}{1} + +% Configure if for definitions, lemmas, etc, numbering should be (0) =
. or (1) =
.. or (2) =
... +\setcounter{numberSubsections}{0} + +% Set the default language. +\setLang{en} + +% Set the default command for theorem translation +\newcommand{\theoremde}{Satz} + + +% ----- % +% STYLE % +% ----- % + +% 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} + +%░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +%░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░ +%▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ +%▒▒ ▒▒▒▒▒▒▒ ▒ ▒ ▒▒▒ ▒ ▒▒▒▒ ▒▒▒▒ +%▓▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓▓ ▓ ▓▓ ▓▓ ▓▓▓ ▓ +%▓▓▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓ ▓ ▓ +%▓ ▓▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓▓▓▓ +%███ ██████ █████ ████ ███ ███ +%██████████████████████ ███████████████████ + +% Global style configs for tcolorbox (to reduce bloat) +\newcommand{\usetcolorboxes}{ + \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 + } + } +} + +% -------------------- % +% Small style elements % +% -------------------- % +\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} + } + } +} +\newcommand{\rmvspace}{\vspace{-0.5pc}} +\newcommand{\drmvspace}{\vspace{-1pc}} +\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=2pt, + left=0pt, + right=0pt, + top=0pt, + bottom=0pt, + colframe=white, + 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}} + +% Add a gray backdrop +\newcommand{\backdrop}[1]{\shade{black}{#1}} + + +% Fancy highlighting (Bold, underlined, colorbox behind it. Shorthand for \fhlc{white}{#1} +\newcommand{\fhl}[1]{\fhlc{white}{#1}} + +% Add a colorbox around your text with the color specified. Text is bold and underlined +\newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}} + +% Spacing (horizontal) +\newcommand{\smallhspace}{\hspace{2mm}} +\newcommand{\mediumhspace}{\hspace{5mm}} +\newcommand{\largehspace}{\hspace{1cm}} + +% ----------------- % +% Table of contents % +% ----------------- % + +% 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 \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable] + \hspace{1cm} + \tableofcontents + \end{tcolorbox} +} + +%▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ +%██░▄▄▀█▀▄▄▀█░▄▀▄░█░▄▀▄░█▀▄▄▀█░▄▄▀ +%██░████░██░█░█▄█░█░█▄█░█░██░█░██░ +%██░▀▀▄██▄▄██▄███▄█▄███▄██▄▄██▄██▄ +%▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ + +\newtcolorbox{recall}[2][]{mainboxstyle,colback=yellow!5!white,colframe=yellow!75!black,colbacktitle=yellow!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=yellow!75!black,,fill=yellow!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} + +% ▄▄ +% ▀████▄ ▄███▀ ██ ███ +% ████ ████ ██ ██ +% █ ██ ▄█ ██ ▄█▀██▄ ██████ ███████▄ +% █ ██ █▀ ██ ██ ██ ██ ██ ██ +% █ ██▄█▀ ██ ▄█████ ██ ██ ██ +% █ ▀██▀ ██ ██ ██ ██ ██ ██ +% ▄███▄ ▀▀ ▄████▄████▀██▄ ▀███████ ████▄ + + +% BB shortcuts (for number spaces, etc) +\newcommand{\C}{\mathbb{C}} +\newcommand{\D}{\mathbb{D}} +\newcommand{\E}{\mathbb{E}} +\newcommand{\I}{\mathbb{I}} +\newcommand{\J}{\mathbb{J}} +\newcommand{\N}{\mathbb{N}} +\newcommand{\Q}{\mathbb{Q}} +\newcommand{\R}{\mathbb{R}} +\newcommand{\V}{\mathbb{V}} +\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{\8}{\infty} +\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{\mbeq}{\overset{!}{=}} +\newcommand{\lcm}{\text{lcm}} +\newcommand{\limit}[2]{\lim_{#1 \rightarrow #2}} +\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}} +\newcommand{\elementstack}[2]{\genfrac{}{}{0pt}{}{#1}{#2}} +\DeclareMathOperator\arctanh{arctanh} +\DeclareMathOperator\arccosh{arccosh} +\DeclareMathOperator\arcsinh{arcsinh} + + +% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ +% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ +% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ + +% Extra imports +\usepackage{stmaryrd} +\usepackage{algorithm} +\usepackage{algpseudocodex} +\usepackage{setspace} +\usepackage{verbatim} +\usepackage{turnstile} +\usepackage{forloop} + +\newcommand{\Indent}{\hspace{\algorithmicindent}} + +\newcommand{\timecomplexity}{\fhlc{orange}{\ifnum\value{lang}<2{Time complexity}\else {Laufzeit}\fi} \hspace{0.5em}} +\newcommand{\tc}[1]{\timecomplexity $\Theta\left(#1\right)$} +\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}}} + +% ▄▄ +% ▀████▀ ▀███ +% ██ ██ +% ██ ▀████████▄ ▄█▀▀███ ▄▄█▀██▀██▀ ▀██▀ +% ██ ██ ██ ▄██ ██ ▄█▀ ██ ▀██ ▄█▀ +% ██ ██ ██ ███ ██ ██▀▀▀▀▀▀ ███ +% ██ ██ ██ ▀██ ██ ██▄ ▄ ▄█▀ ██▄ +% ▄████▄████ ████▄ ▀████▀███▄ ▀█████▀██▄ ▄██▄ + + +% 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} + + + +% ▄▄· ▄• ▄▌ ▐ ▄ ▄▄▄▄▄▄▄▄ .▄▄▄ +% ▐█ ▌▪ ▄█▀▄ █▪██▌•█▌▐█•██ ▀▄.▀·▀▄ █· +% ██ ▄▄▐█▌.▐▌█▌▐█▌▐█▐▐▌ ▐█.▪▐▀▀▪▄▐▀▀▄ +% ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌ +% ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀ + +\usepackage{xstring} +\usepackage{etoolbox} +% tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters +\newcounter{lemma}[section] +\newcounter{definition}[section] +\newcounter{corollary}[section] +\newcounter{theorem}[section] +\newcounter{axiom}[section] +\newcounter{example}[section] +\newcounter{fact}[section] +\newcounter{proposition}[section] +\newcounter{formula}[section] +\newcounter{remark}[section] +\newcounter{all}[section] + +\newcounter{lemmass}[subsection] +\newcounter{definitionss}[subsection] +\newcounter{corollaryss}[subsection] +\newcounter{theoremss}[subsection] +\newcounter{axiomss}[subsection] +\newcounter{exampless}[subsection] +\newcounter{factss}[subsection] +\newcounter{propositionss}[subsection] +\newcounter{formulass}[subsection] +\newcounter{remarkss}[subsection] +\newcounter{allss}[subsection] + +\newcounter{lemmasss}[subsubsection] +\newcounter{definitionsss}[subsubsection] +\newcounter{corollarysss}[subsubsection] +\newcounter{theoremsss}[subsubsection] +\newcounter{axiomsss}[subsubsection] +\newcounter{examplesss}[subsubsection] +\newcounter{factsss}[subsubsection] +\newcounter{propositionsss}[subsubsection] +\newcounter{formulasss}[subsubsection] +\newcounter{remarksss}[subsubsection] +\newcounter{allsss}[subsubsection] + +% Set the current number of a label +\newcommand{\setLabelNumber}[2]{% + \setcounter{#1}{#2}% + \addtocounter{#1}{-1}% + \setcounter{#1ss}{#2}% + \addtocounter{#1ss}{-1}% + \setcounter{#1sss}{#2}% + \addtocounter{#1sss}{-1}% +} + +\newcommand{\stepLabelNumber}[1]{% + \stepcounter{#1}% + \stepcounter{#1ss}% + \stepcounter{#1sss}% +} + +\newcommand{\printcounter}[1]{% + \csname the#1\endcsname +} + +\newcommand{\suffix}{ss} +\newcommand{\sectionNumbering}{\thesection} + +% ┌ ┐ +% │ Counter numbering │ +% └ ┘ +\newcommand{\preTableAndFigHook}[1]{% + \ifnum\value{numberingConfig}>1 + \ifnum\value{numberSubsections}=1 + \stepcounter{allss} + \else + \ifnum\value{numberSubsections}=2 + \stepcounter{allsss} + \else + \stepcounter{all} + \fi + \fi + \fi +} +\AtBeginEnvironment{table}{\preTableAndFigHook{table}} +\AtBeginEnvironment{figure}{\preTableAndFigHook{figure}} + +\newcommand{\applyTableAndFigureNumbering}{ + % Tables & Figures + \ifnum\value{numberingConfig}=0 + \renewcommand{\thetable}{} + \renewcommand{\thefigure}{} + \else + \ifnum\value{numberingConfig}=1 + \renewcommand{\thetable}{\sectionNumbering.\arabic{table}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{figure}} + \else + \ifnum\value{numberSubsections}=1 + \renewcommand{\thetable}{\sectionNumbering.\arabic{allss}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{allss}} + \else + \ifnum\value{numberSubsections}=2 + \renewcommand{\thetable}{\refstepcounter{allsss}\sectionNumbering.\arabic{allsss}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{allsss}} + \else + \renewcommand{\thetable}{\sectionNumbering.\arabic{all}} + \renewcommand{\thefigure}{\sectionNumbering.\arabic{all}} + \fi + \fi + \fi + \fi +} + +\newcommand{\setSubsectionNumbering}[1]{ + \setcounter{numberSubsections}{#1} + \applySubsectionNumbering +} + +\newcommand{\applySubsectionNumbering}{ + \ifnum\value{numberSubsections}=1 + \renewcommand{\sectionNumbering}{\thesubsection} + \renewcommand{\suffix}{ss} + \typeout{Numbering as section.subsection.number} + \else + \ifnum\value{numberSubsections}=2 + \renewcommand{\sectionNumbering}{\thesubsubsection} + \renewcommand{\suffix}{sss} + \typeout{Numbering as section.subsection.subsubsection.number} + \else + \renewcommand{\sectionNumbering}{\thesection} + \renewcommand{\suffix}{} + \typeout{Numbering as section.number} + \fi + \fi + \applyTableAndFigureNumbering + + \renewcommand{\thelemma}{\sectionNumbering.\arabic{lemma}} + \renewcommand{\thedefinition}{\sectionNumbering.\arabic{definition}} + \renewcommand{\thecorollary}{\sectionNumbering.\arabic{corollary}} + \renewcommand{\thetheorem}{\sectionNumbering.\arabic{theorem}} + \renewcommand{\theaxiom}{\sectionNumbering.\arabic{axiom}} + \renewcommand{\theexample}{\sectionNumbering.\arabic{example}} + \renewcommand{\thefact}{\sectionNumbering.\arabic{fact}} + \renewcommand{\theproposition}{\sectionNumbering.\arabic{proposition}} + \renewcommand{\theformula}{\sectionNumbering.\arabic{formula}} + \renewcommand{\theremark}{\sectionNumbering.\arabic{remark}} + \renewcommand{\theall}{\sectionNumbering.\arabic{all}} + + \renewcommand{\thelemmass}{\sectionNumbering.\arabic{lemmass}} + \renewcommand{\thedefinitionss}{\sectionNumbering.\arabic{definitionss}} + \renewcommand{\thecorollaryss}{\sectionNumbering.\arabic{corollaryss}} + \renewcommand{\thetheoremss}{\sectionNumbering.\arabic{theoremss}} + \renewcommand{\theaxiomss}{\sectionNumbering.\arabic{axiomss}} + \renewcommand{\theexampless}{\sectionNumbering.\arabic{exampless}} + \renewcommand{\thefactss}{\sectionNumbering.\arabic{factss}} + \renewcommand{\thepropositionss}{\sectionNumbering.\arabic{propositionss}} + \renewcommand{\theformulass}{\sectionNumbering.\arabic{formulass}} + \renewcommand{\theremarkss}{\sectionNumbering.\arabic{remarkss}} + \renewcommand{\theallss}{\sectionNumbering.\arabic{allss}} + + \renewcommand{\thelemmasss}{\sectionNumbering.\arabic{lemmasss}} + \renewcommand{\thedefinitionsss}{\sectionNumbering.\arabic{definitionsss}} + \renewcommand{\thecorollarysss}{\sectionNumbering.\arabic{corollarysss}} + \renewcommand{\thetheoremsss}{\sectionNumbering.\arabic{theoremsss}} + \renewcommand{\theaxiomsss}{\sectionNumbering.\arabic{axiomsss}} + \renewcommand{\theexamplesss}{\sectionNumbering.\arabic{examplesss}} + \renewcommand{\thefactsss}{\sectionNumbering.\arabic{factsss}} + \renewcommand{\thepropositionsss}{\sectionNumbering.\arabic{propositionsss}} + \renewcommand{\theformulasss}{\sectionNumbering.\arabic{formulasss}} + \renewcommand{\theremarksss}{\sectionNumbering.\arabic{remarksss}} + \renewcommand{\theallsss}{\sectionNumbering.\arabic{allsss}} +} +\applySubsectionNumbering + +% ── Label generation ──────────────────────────────────────────────── +\newcommand{\labelSectionGeneration}{% + \ifnum\value{numberSubsections}=1 + \arabic{section}-\arabic{subsection}% + \else + \ifnum\value{numberSubsections}=2 + \arabic{section}-\arabic{subsection}-\arabic{subsubsection}% + \else + \arabic{section}% + \fi + \fi} + +\newcommand{\labelIt}[1]{\refstepcounter{#1\suffix}\edef\tempLabel{\genLabel{#1}{\arabic{#1\suffix}}}\label{\tempLabel}} +\newcommand{\genLabel}[2]{#1:\labelSectionGeneration-#2} + +% ┌ ┐ +% │ Number the counters appropriately │ +% └ ┘ +\newcommand{\usenumberArabic}[1]{% + \ifnum\value{numberingConfig}=1 + \labelIt{#1} + \printcounter{#1\suffix}% + \else + \ifnum\value{numberingConfig}=2 + \ifthenelse{\equal{#1}{definitions}}{% + \labelIt{definition} + \printcounter{definition\suffix}% + }{% + \labelIt{all} + \printcounter{all\suffix}% + }% + \else + \ifnum\value{numberingConfig}=3 + \labelIt{all} + \printcounter{all\suffix}% + \else + \relax% + \fi + \fi + \fi} + + +% ──────────────────────────────────────────────────────────────────── +% ┌ ┐ +% │ Enable or disable numbering │ +% └ ┘ +% Initialize with config file +\newcounter{numberingConfigStore} +\setcounter{numberingConfigStore}{\value{numberingConfig}} + +% For later change +\newcommand{\setNumberingStyle}[1]{ + \typeout{Setting NumberingStyle to #1} + \setcounter{numberingConfig}{#1} + \ifthenelse{\equal{#1}{0}}{}{ + \setcounter{numberingConfigStore}{#1} + } + \applyTableAndFigureNumbering +} + +% Enable / disable numbering +\newcommand{\numberingOff}{ + \setcounter{numberingConfig}{0} + \applyTableAndFigureNumbering +} +\newcommand{\numberingOn}{ + \setcounter{numberingConfig}{\value{numberingConfigStore}} + \applyTableAndFigureNumbering +} + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Reset definition, lemma, etc counters, add a │ +% │ new page │ +% ╰────────────────────────────────────────────────╯ +\newcommand{\newsection}{ + \newpage + \newsectionNoPB +} + +% ── Reset definitions, lemma, etc counters, do not add new page ───── +\newcommand{\newsectionNoPB}{ + \setcounter{lemma}{0} + \setcounter{definition}{0} + \setcounter{corollary}{0} + \setcounter{theorem}{0} + \setcounter{axiom}{0} + \setcounter{example}{0} + \setcounter{fact}{0} + \setcounter{proposition}{0} + \setcounter{formula}{0} + \setcounter{remark}{0} + \setcounter{all}{0} + + \setcounter{lemmass}{0} + \setcounter{definitionss}{0} + \setcounter{corollaryss}{0} + \setcounter{theoremss}{0} + \setcounter{axiomss}{0} + \setcounter{exampless}{0} + \setcounter{factss}{0} + \setcounter{propositionss}{0} + \setcounter{formulass}{0} + \setcounter{remarkss}{0} + \setcounter{allss}{0} + + \setcounter{lemmasss}{0} + \setcounter{definitionsss}{0} + \setcounter{corollarysss}{0} + \setcounter{theoremsss}{0} + \setcounter{axiomsss}{0} + \setcounter{examplesss}{0} + \setcounter{factsss}{0} + \setcounter{propositionsss}{0} + \setcounter{formulasss}{0} + \setcounter{remarksss}{0} + \setcounter{allsss}{0} + + % Tables & Figures + \setcounter{table}{0} + \setcounter{figure}{0} +} +\newsectionNoPB % Initializes + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Tcolorboxes │ +% ╰────────────────────────────────────────────────╯ +% ──────────────────────────────────────────────────────────────────── + +% Definitions +\newtcolorbox{definition}[2][]{mainboxstyle,colback=blue!5!white,colframe=blue!75!black,colbacktitle=blue!75!black,title={\large #2},overlay={\node[overlaystyle,draw=blue!75!black,fill=blue!75!black] at (frame.north east) {\large Definition\usenumberArabic{definition}};},#1} + +% Theorems +\newtcolorbox{theorem}[2][]{mainboxstyle,colback=ForestGreen!5!white,colframe=ForestGreen!75!black,colbacktitle=ForestGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=ForestGreen!75!black,fill=ForestGreen!75!black] at (frame.north east) {\large \translate{Theorem}{\theoremde}\usenumberArabic{theorem}};},#1} + +% Lemmas +\newtcolorbox{lemma}[2][]{mainboxstyle,colback=Aquamarine!5!white,colframe=Aquamarine!75!black,colbacktitle=Aquamarine!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Aquamarine!75!black,fill=Aquamarine!75!black] at (frame.north east) {\large Lemma\usenumberArabic{lemma}};},#1} + +% Corollaries +\newtcolorbox{corollary}[2][]{mainboxstyle,colback=teal!5!white,colframe=teal!75!black,colbacktitle=teal!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=teal!75!black,fill=teal!75!black] at (frame.north east) {\large \translate{Corollary}{Korollar}\usenumberArabic{corollary}};},#1} + +% Axioms +\newtcolorbox{axiom}[2][]{mainboxstyle,colback=JungleGreen!5!white,colframe=JungleGreen!75!black,colbacktitle=JungleGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=JungleGreen!75!black,fill=JungleGreen!75!black] at (frame.north east) {\large Axiom\usenumberArabic{axiom}};},#1} + +% Facts +\newtcolorbox{fact}[2][]{mainboxstyle,colback=SeaGreen!5!white,colframe=SeaGreen!75!black,colbacktitle=SeaGreen!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=SeaGreen!75!black,fill=SeaGreen!75!black] at (frame.north east) {\large \translate{Fact}{Fakt}\usenumberArabic{fact}};},#1} + +% Propositions +\newtcolorbox{proposition}[2][]{mainboxstyle,colback=Cyan!5!white,colframe=Cyan!75!black,colbacktitle=Cyan!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Cyan!75!black,fill=Cyan!75!black] at (frame.north east) {\large Proposition\usenumberArabic{proposition}};},#1} + +% Examples +\newtcolorbox{example}[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{Example}{Beispiel}\usenumberArabic{example}};},#1} + +% Formula +\newtcolorbox{formula}[2][]{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 \translate{Formula}{Formel}\usenumberArabic{formula}};},#1} + +% Remark +\newtcolorbox{remark}[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{Remark}{Bemerkung} \usenumberArabic{remark}};},#1} + + +% ──────────────────────────────────────────────────────────────────── +% ╭────────────────────────────────────────────────╮ +% │ Inline environments │ +% ╰────────────────────────────────────────────────╯ +% ──────────────────────────────────────────────────────────────────── + + +% Inline environments (inline) +\newcommand{\inlineex}{\bg{gray}{\translate{Example}{Beispiel}\usenumberArabic{example}:}} +\newcommand{\inlinedef}{\bg{blue}{Definition\usenumberArabic{definition}:}} +\newcommand{\inlineformula}{\bg{red}{\translate{Formula}{Formel}\usenumberArabic{formula}:}} +\newcommand{\inlinelemma}{\bg{Aquamarine}{Lemma\usenumberArabic{lemma}:}} +\newcommand{\inlinetheorem}{\bg{ForestGreen}{\translate{Theorem}{\theoremde}\usenumberArabic{theorem}:}} +\newcommand{\inlineaxiom}{\bg{JungleGreen}{Axiom\usenumberArabic{axiom}:}} +\newcommand{\inlinecorollary}{\bg{teal}{\translate{Corollary}{Korollar}\usenumberArabic{corollary}:}} +\newcommand{\inlinefact}{\bg{SeaGreen}{\translate{Fact}{Fakt}\usenumberArabic{fact}:}} +\newcommand{\inlineproposition}{\bg{Cyan}{Proposition\usenumberArabic{proposition}:}} +\newcommand{\inlineremark}{\bg{green}{\translate{Remark}{Bemerkung}\usenumberArabic{remark}:}} +\newcommand{\inlineproof}{\bg{magenta}{\translate{Proof}{Beweis}:}} + +% Enhanced inline environments +\newcommand{\fancyex}[1]{\bg{gray}{\translate{Example}{Beispiel}\usenumberArabic{example}:} \textit{(#1)}} +\newcommand{\fancydef}[1]{\bg{blue}{Definition\usenumberArabic{definition}:} \textit{(#1)}} +\newcommand{\fancyformula}[1]{\bg{red}{\translate{Formula}{Formel}\usenumberArabic{formula}:} \textit{(#1)}} +\newcommand{\fancylemma}[1]{\bg{Aquamarine}{Lemma\usenumberArabic{lemma}:} \textit{(#1)}} +\newcommand{\fancytheorem}[1]{\bg{ForestGreen}{\translate{Theorem}{\theoremde}\usenumberArabic{theorem}:} \textit{(#1)}} +\newcommand{\fancyaxiom}[1]{\bg{JungleGreen}{Axiom\usenumberArabic{axiom}:} \textit{(#1)}} +\newcommand{\fancycorollary}[1]{\bg{teal}{\translate{Corollary}{Korollar}\usenumberArabic{corollary}:} \textit{(#1)}} +\newcommand{\fancyfact}[1]{\bg{SeaGreen}{\translate{Fact}{Fakt}\usenumberArabic{fact}:} \textit{(#1)}} +\newcommand{\fancyproposition}[1]{\bg{Cyan}{Proposition\usenumberArabic{proposition}:} \textit{(#1)}} +\newcommand{\fancyremark}[1]{\bg{green}{\translate{Remark}{Bemerkung}\usenumberArabic{remark}:} \textit{(#1)}} +\newcommand{\fancyproof}[1]{\bg{magenta}{\translate{Proof}{Beweis}: \textit{(#1)}}} + +% short environments (abbreviated) +\newcommand{\shortex}{\bg{gray}{\translate{Ex}{Bsp}\usenumberArabic{example}:}} +\newcommand{\shortdef}{\bg{blue}{D\usenumberArabic{definition}:}} +\newcommand{\short}{\bg{red}{F\usenumberArabic{formula}:}} +\newcommand{\shortlemma}{\bg{Aquamarine}{L\usenumberArabic{lemma}:}} +\newcommand{\shorttheorem}{\bg{ForestGreen}{\translate{T}{\StrMid{\theoremde}{1}{1}}\usenumberArabic{theorem}:}} +\newcommand{\shortaxiom}{\bg{JungleGreen}{A\usenumberArabic{axiom}:}} +\newcommand{\shortcorollary}{\bg{teal}{\translate{C}{K}\usenumberArabic{corollary}:}} +\newcommand{\shortfact}{\bg{SeaGreen}{F\usenumberArabic{fact}:}} +\newcommand{\shortproposition}{\bg{Cyan}{P\usenumberArabic{proposition}:}} +\newcommand{\shortremark}{\bg{green}{\tr{R}{B}\usenumberArabic{remark}:}} +\newcommand{\shortproof}{\bg{magenta}{\translate{Proof}{Beweis}:}} + +% Enhanced short environments (abbreviated) +\newcommand{\compactex}[1]{\bg{gray}{\translate{Ex}{Bsp}\usenumberArabic{example}:} \textit{(#1)}} +\newcommand{\compactdef}[1]{\bg{blue}{D\usenumberArabic{definition}:} \textit{(#1)}} +\newcommand{\compactformula}[1]{\bg{red}{F\usenumberArabic{formula}:} \textit{(#1)}} +\newcommand{\compactlemma}[1]{\bg{Aquamarine}{L\usenumberArabic{lemma}:} \textit{(#1)}} +\newcommand{\compacttheorem}[1]{\bg{ForestGreen}{\translate{T}{\StrMid{\theoremde}{1}{1}} \usenumberArabic{theorem}:} \textit{(#1)}} +\newcommand{\compactaxiom}[1]{\bg{JungleGreen}{A\usenumberArabic{axiom}:} \textit{(#1)}} +\newcommand{\compactcorollary}[1]{\bg{teal}{\translate{C}{K}\usenumberArabic{corollary}:} \textit{(#1)}} +\newcommand{\compactfact}[1]{\bg{SeaGreen}{F\usenumberArabic{fact}:} \textit{(#1)}} +\newcommand{\compactproposition}[1]{\bg{Cyan}{P\usenumberArabic{proposition}:} \textit{(#1)}} +\newcommand{\compactremark}[1]{\bg{green}{\tr{R}{B}\usenumberArabic{remark}:} \textit{(#1)}} +\newcommand{\compactproof}[1]{\bg{magenta}{\translate{Proof}{Beweis}: \textit{(#1)}}} + +% ▄▄ +% ▄▄█▀▀▀█▄█ ██ ▄█▀▀▀█▄█ ██ +% ▄██▀ ▀█ ██ ▄██ ▀█ +% ██▀ ▀ ▄██▀██▄▀████████▄█████▄ ▀████████▄▀███ ▀███ ██████ ▄▄█▀██▀███▄███ ▀███▄ ▄██▀██▀███ ▄▄█▀██▀████████▄ ▄██▀██ ▄▄█▀██ +% ██ ██▀ ▀██ ██ ██ ██ ██ ▀██ ██ ██ ██ ▄█▀ ██ ██▀ ▀▀ ▀█████▄█▀ ██ ██ ▄█▀ ██ ██ ██ ██▀ ██ ▄█▀ ██ +% ██▄ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀▀▀▀▀ ██ ▄ ▀███ ██ ██▀▀▀▀▀▀ ██ ██ ██ ██▀▀▀▀▀▀ +% ▀██▄ ▄▀██▄ ▄██ ██ ██ ██ ██ ▄██ ██ ██ ██ ██▄ ▄ ██ ██ ███▄ ▄ ██ ██▄ ▄ ██ ██ ██▄ ▄██▄ ▄ +% ▀▀█████▀ ▀█████▀▄████ ████ ████▄ ██████▀ ▀████▀███▄ ▀████ ▀█████▀████▄ █▀█████▀ █████▀▄████▄ ▀█████▀████ ████▄█████▀ ▀█████▀ +% ██ +% ▄████▄ + +\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} +} + +% • ▌ ▄ ·. ▄▄▄· ▄▄▄▄▄ ▄ .▄ .▄▄ · ▄▄▄▄▄ ▄· ▄▌▄▄▌ ▄▄▄ . +% ·██ ▐███▪▐█ ▀█ •██ ██▪▐█ ▐█ ▀. •██ ▐█▪██▌██• ▀▄.▀· +% ▐█ ▌▐▌▐█·▄█▀▀█ ▐█.▪██▀▀█ ▄▀▀▀█▄ ▐█.▪▐█▌▐█▪██ ▪ ▐▀▀▪▄ +% ██ ██▌▐█▌▐█▪ ▐▌ ▐█▌·██▌▐▀ ▐█▄▪▐█ ▐█▌· ▐█▀·.▐█▌ ▄▐█▄▄▌ +% ▀▀ █▪▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀ · ▀▀▀▀ ▀▀▀ ▀ • .▀▀▀ ▀▀▀ + +% Replace some commonly used commands with better ones +\renewcommand{\vec}[1]{\overrightarrow{#1}} +\renewcommand{\hat}[1]{\widehat{#1}} +\renewcommand{\tilde}[1]{\widetilde{#1}} +\newcommand{\proven}{$\hspace{17cm}\square$} + + +% ░█▒░▒▄▀▄░█▄░█░▄▀▒░█▒█▒▄▀▄░▄▀▒▒██▀░░░▄▀▀░▀█▀░▀▄▀░█▒░▒██▀ +% ▒█▄▄░█▀█░█▒▀█░▀▄█░▀▄█░█▀█░▀▄█░█▄▄▒░▒▄██░▒█▒░▒█▒▒█▄▄░█▄▄ + +% Specific styles for language summaries and docs +\newtcolorbox{conjugation}[2][]{mainboxstyle,colback=blue!5!white,colframe=blue!75!black,colbacktitle=blue!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=blue!75!black,fill=blue!75!black] at (frame.north east) {\large \translate{Conjugation}{Konjugation}};},#1} + +\newtcolorbox{forms}[2][]{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 \translate{Forms}{Formen}};},#1} + +% _____ _ _ +% (_ _) ( ) (_ ) +% | | _ _| |_ | | __ ___ +% | | / _ ) _ \ | | / __ \ __) +% | | ( (_| | |_) )| |( ___/__ \ +% (_) \__ _)_ __/(___)\____)____/ + + +\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} +} + +% ___ _ _____ _ _ +% ( _ \ _( ) (_ _) ( ) ( ) +% | (_) )_) |_ | | __ \ \/ / +% | _ (| | _ \ | | / __ \ ) ( +% | (_) ) | |_) ) | | ( ___// /\ \ +% (____/(_)_ __/ (_) \____)_) (_) + +% Configs if you want to use BibTeX. Not included in any default configs. + +\newcommand{\setupBibtex}[1]{ + \usepackage{biblatex} + \usepackage[nottoc, numbib]{tocbibind} + \addbibresource{#1} +} + +\newcommand{\printbib}{ + \addcontentsline{toc}{section}{\translate{Sources}{Quellen}} + \printbibliography[title=\translate{Sources}{Quellen}] +} + + +%░▒█▀▀█░█░░▄▀▀▄░█▀▀░█▀▀░█▀▀▄░█▀▀▄░█░░█ +%░▒█░▄▄░█░░█░░█░▀▀▄░▀▀▄░█▄▄█░█▄▄▀░█▄▄█ +%░▒█▄▄▀░▀▀░░▀▀░░▀▀▀░▀▀▀░▀░░▀░▀░▀▀░▄▄▄▀ + +% Add glossaries functionality + +\newcommand{\setupGlossary}{ + \usepackage[nonumberlist, toc]{glossaries} + \usepackage[nottoc, numbib]{tocbibind} + \makenoidxglossaries +} + +\newcommand{\printGlossary}{ + \glsaddall + \printnoidxglossaries +} diff --git a/main/core.tex b/main/core.tex index 3400d41..41a5942 100644 --- a/main/core.tex +++ b/main/core.tex @@ -53,7 +53,7 @@ \ifx\lang\de \typeout{[Lang Switcher] Loading German} \setcounter{lang}{2} - \input{\dir/main/lang/de} + \usepackage[ngerman]{babel} \else \typeout{[Lang Switcher] No such language!} \fi diff --git a/main/lang/de.tex b/main/lang/de.tex deleted file mode 100644 index 0c0a798..0000000 --- a/main/lang/de.tex +++ /dev/null @@ -1 +0,0 @@ -\usepackage[ngerman]{babel} diff --git a/scopes/header.tex b/scopes/header.tex deleted file mode 100644 index 85af3c1..0000000 --- a/scopes/header.tex +++ /dev/null @@ -1,5 +0,0 @@ -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{janishutz-helpers} - -\usepackage{import} -\import{../}{config/config.tex}