Merge branch 'dev'
This commit is contained in:
48
src/core.sty
Normal file
48
src/core.sty
Normal file
@@ -0,0 +1,48 @@
|
||||
% Package imports
|
||||
\RequirePackage{tocloft}
|
||||
\RequirePackage[table, dvipsnames]{xcolor}
|
||||
\RequirePackage{amsmath}
|
||||
\RequirePackage{graphicx}
|
||||
\RequirePackage{subcaption}
|
||||
\RequirePackage[export]{adjustbox}
|
||||
\RequirePackage[most]{tcolorbox}
|
||||
\RequirePackage{cancel}
|
||||
\RequirePackage{dsfont}
|
||||
\RequirePackage{amssymb}
|
||||
\RequirePackage{mathrsfs}
|
||||
\RequirePackage{lipsum}
|
||||
\RequirePackage{ulem}
|
||||
\RequirePackage{soul}
|
||||
\RequirePackage{fancyhdr}
|
||||
\RequirePackage{lastpage}
|
||||
\RequirePackage{wasysym}
|
||||
\RequirePackage{wrapfig}
|
||||
\RequirePackage{multicol}
|
||||
\RequirePackage{ifthen}
|
||||
\RequirePackage[hidelinks]{hyperref}
|
||||
\RequirePackage{enumitem}
|
||||
\RequirePackage{gensymb}
|
||||
\RequirePackage{pifont}
|
||||
\RequirePackage{xstring}
|
||||
\RequirePackage{etoolbox}
|
||||
\RequirePackage{makecell}
|
||||
\RequirePackage{parskip}
|
||||
|
||||
\newcounter{descriptorShadeStrength}
|
||||
\newcounter{shadeStrength}
|
||||
\newcommand{\currentLanguage}{en}
|
||||
|
||||
\setcounter{secnumdepth}{4}
|
||||
|
||||
\newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname}
|
||||
\newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname}
|
||||
\newcommand{\printShortTranslationOptionEN}[1]{\csname #1ShortNamingEN\endcsname}
|
||||
\newcommand{\printShortTranslationOptionDE}[1]{\csname #1ShortNamingDE\endcsname}
|
||||
|
||||
\newboolean{numberingDisabled}
|
||||
\setboolean{numberingDisabled}{false}
|
||||
|
||||
\newcommand{\loadGerman}{
|
||||
\usepackage[ngerman]{babel}
|
||||
\renewcommand{\currentLanguage}{de}
|
||||
}
|
||||
19
src/core/bib.sty
Normal file
19
src/core/bib.sty
Normal file
@@ -0,0 +1,19 @@
|
||||
% ___ _ _____ _ _
|
||||
% ( _ \ _( ) (_ _) ( ) ( )
|
||||
% | (_) )_) |_ | | __ \ \/ /
|
||||
% | _ (| | _ \ | | / __ \ ) (
|
||||
% | (_) ) | |_) ) | | ( ___// /\ \
|
||||
% (____/(_)_ __/ (_) \____)_) (_)
|
||||
|
||||
% Configs if you want to use BibTeX
|
||||
|
||||
\newcommand{\setupBibtex}[1]{
|
||||
\RequirePackage{biblatex}
|
||||
\RequirePackage[nottoc, numbib]{tocbibind}
|
||||
\addbibresource{#1}
|
||||
}
|
||||
|
||||
\newcommand{\printbib}{
|
||||
\addcontentsline{toc}{section}{\translate{Sources}{Quellen}}
|
||||
\printbibliography[title=\translate{Sources}{Quellen}]
|
||||
}
|
||||
30
src/core/cs.sty
Normal file
30
src/core/cs.sty
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀
|
||||
% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀
|
||||
% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀
|
||||
|
||||
% Extra imports
|
||||
\RequirePackage{stmaryrd}
|
||||
\RequirePackage{algorithm}
|
||||
\RequirePackage{algpseudocodex}
|
||||
\RequirePackage{setspace}
|
||||
\RequirePackage{verbatim}
|
||||
\RequirePackage{turnstile}
|
||||
\RequirePackage{forloop}
|
||||
|
||||
\newcommand{\Indent}{\hspace{\algorithmicindent}}
|
||||
|
||||
\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}}}
|
||||
12
src/core/glossary.sty
Normal file
12
src/core/glossary.sty
Normal file
@@ -0,0 +1,12 @@
|
||||
% Add glossaries functionality
|
||||
|
||||
\newcommand{\setupGlossary}{
|
||||
\RequirePackage[nonumberlist, toc]{glossaries}
|
||||
\RequirePackage[nottoc, numbib]{tocbibind}
|
||||
\makenoidxglossaries
|
||||
}
|
||||
|
||||
\newcommand{\printGlossary}{
|
||||
\glsaddall
|
||||
\printnoidxglossaries
|
||||
}
|
||||
16
src/core/index.sty
Normal file
16
src/core/index.sty
Normal file
@@ -0,0 +1,16 @@
|
||||
% ┌ ┐
|
||||
% │ Index │
|
||||
% └ ┘
|
||||
|
||||
% For using index package
|
||||
\newcommand{\prepareIndex}{
|
||||
\RequirePackage[T1]{fontenc}
|
||||
\RequirePackage{imakeidx}
|
||||
\makeindex
|
||||
}
|
||||
|
||||
\newcommand{\addIndexBold}[1]{\textbf{\index{\MakeLowercase{#1}} #1}}
|
||||
\newcommand{\addIndexBI}[1]{\textbf\textit{{\index{\MakeLowercase{#1}} #1}}}
|
||||
\newcommand{\addIndexItalic}[1]{\textit{\index{\MakeLowercase{#1}} #1}}
|
||||
\newcommand{\addIndex}[1]{\index{\MakeLowercase{#1}} #1}
|
||||
|
||||
95
src/core/math.sty
Normal file
95
src/core/math.sty
Normal file
@@ -0,0 +1,95 @@
|
||||
% ┌ ┐
|
||||
% │ Math │
|
||||
% └ ┘
|
||||
|
||||
% BB shortcuts (for number spaces, etc)
|
||||
\newcommand{\A}{\mathbb{A}}
|
||||
\newcommand{\B}{\mathbb{B}}
|
||||
\newcommand{\C}{\mathbb{C}}
|
||||
\newcommand{\D}{\mathbb{D}}
|
||||
\newcommand{\E}{\mathbb{E}}
|
||||
\newcommand{\F}{\mathbb{F}}
|
||||
\newcommand{\G}{\mathbb{G}}
|
||||
\renewcommand{\H}{\mathbb{H}}
|
||||
\newcommand{\I}{\mathbb{I}}
|
||||
\newcommand{\J}{\mathbb{J}}
|
||||
\newcommand{\K}{\mathbb{K}}
|
||||
\renewcommand{\L}{\mathbb{L}}
|
||||
\newcommand{\M}{\mathbb{M}}
|
||||
\newcommand{\N}{\mathbb{N}}
|
||||
\renewcommand{\O}{\mathbb{O}}
|
||||
\renewcommand{\P}{\mathbb{P}}
|
||||
\newcommand{\Q}{\mathbb{Q}}
|
||||
\newcommand{\R}{\mathbb{R}}
|
||||
\renewcommand{\S}{\mathbb{S}}
|
||||
\newcommand{\T}{\mathbb{T}}
|
||||
\newcommand{\U}{\mathbb{U}}
|
||||
\newcommand{\V}{\mathbb{V}}
|
||||
\newcommand{\W}{\mathbb{W}}
|
||||
\newcommand{\X}{\mathbb{X}}
|
||||
\newcommand{\Y}{\mathbb{Y}}
|
||||
\newcommand{\Z}{\mathbb{Z}}
|
||||
|
||||
% Caligraphic
|
||||
\newcommand{\cA}{\mathcal{A}}
|
||||
\newcommand{\cB}{\mathcal{B}}
|
||||
\newcommand{\cC}{\mathcal{C}}
|
||||
\newcommand{\cD}{\mathcal{D}}
|
||||
\newcommand{\cE}{\mathcal{E}}
|
||||
\newcommand{\cF}{\mathcal{F}}
|
||||
\newcommand{\cG}{\mathcal{G}}
|
||||
\newcommand{\cH}{\mathcal{H}}
|
||||
\newcommand{\cI}{\mathcal{I}}
|
||||
\newcommand{\cJ}{\mathcal{J}}
|
||||
\newcommand{\cK}{\mathcal{K}}
|
||||
\newcommand{\cL}{\mathcal{L}}
|
||||
\newcommand{\cM}{\mathcal{M}}
|
||||
\newcommand{\cN}{\mathcal{N}}
|
||||
\newcommand{\cO}{\mathcal{O}}
|
||||
\newcommand{\cP}{\mathcal{P}}
|
||||
\newcommand{\cQ}{\mathcal{Q}}
|
||||
\newcommand{\cR}{\mathcal{R}}
|
||||
\newcommand{\cS}{\mathcal{S}}
|
||||
\newcommand{\cT}{\mathcal{T}}
|
||||
\newcommand{\cU}{\mathcal{U}}
|
||||
\newcommand{\cV}{\mathcal{V}}
|
||||
\newcommand{\cW}{\mathcal{W}}
|
||||
\newcommand{\cX}{\mathcal{X}}
|
||||
\newcommand{\cY}{\mathcal{Y}}
|
||||
\newcommand{\cZ}{\mathcal{Z}}
|
||||
|
||||
% other useful shortcuts
|
||||
\newcommand{\elementstack}[2]{\genfrac{}{}{0pt}{}{#1}{#2}}
|
||||
\newcommand{\8}{\infty}
|
||||
\newcommand{\cond}{\text{cond}}
|
||||
\newcommand{\argmin}[1]{\underset{#1}{\text{argmin}}}
|
||||
\newcommand{\dx}{\text{ d}}
|
||||
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
|
||||
\newcommand{\ceil}[1]{\left\lceil #1 \right\rceil}
|
||||
\newcommand{\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{\defEquiv}{\overset{\text{def}}{\Leftrightarrow}}
|
||||
\newcommand{\defImplies}{\overset{\text{def}}{\Rightarrow}}
|
||||
\newcommand{\diff}[1]{\frac{\mbox{d}}{\mbox{d}#1}}
|
||||
\newcommand{\diffn}[2]{\frac{\mbox{d}^{#2}}{\mbox{d}^{#2}#1}}
|
||||
\newcommand{\pardiff}[1]{\frac{\partial}{\partial #1}}
|
||||
\newcommand{\pardiffn}[2]{\frac{\partial^{#2}}{\partial^{#2} #1}}
|
||||
\newcommand{\divider}{\hspace{0.25em}|\hspace{0.25em}}
|
||||
\newcommand{\lcm}{\text{lcm}}
|
||||
\newcommand{\limit}[2]{\underset{#1 \rightarrow #2}{\lim}}
|
||||
\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{\sequence}[1]{(#1_n)_{n \geq 1}}
|
||||
\newcommand{\series}[2]{\sum_{k = 1}^{#2} #1_k}
|
||||
\newcommand{\elementstack}[2]{\genfrac{}{}{0pt}{}{#1}{#2}}
|
||||
|
||||
\DeclareMathOperator\arctanh{arctanh}
|
||||
\DeclareMathOperator\arccosh{arccosh}
|
||||
\DeclareMathOperator\arcsinh{arcsinh}
|
||||
43
src/core/minted.sty
Normal file
43
src/core/minted.sty
Normal file
@@ -0,0 +1,43 @@
|
||||
% ┌ ┐
|
||||
% │ Minted │
|
||||
% └ ┘
|
||||
\RequirePackage{minted}
|
||||
\RequirePackage{fancyvrb}
|
||||
|
||||
% Args: Language, Code
|
||||
\newenvironment{code}[1]{
|
||||
\VerbatimEnvironment
|
||||
\begin{minted}[
|
||||
autogobble,
|
||||
breaklines,
|
||||
breakindentnchars=2,
|
||||
frame=lines,
|
||||
framesep=2mm,
|
||||
mathescape,
|
||||
baselinestretch=1.1,
|
||||
linenos
|
||||
]{#1}}
|
||||
{\end{minted}}
|
||||
|
||||
% Args: Language, file relative to root file
|
||||
\newcommand{\inputcode}[2]{
|
||||
\inputminted[
|
||||
autogobble,
|
||||
breaklines,
|
||||
breakindentnchars=2,
|
||||
frame=lines,
|
||||
framesep=2mm,
|
||||
mathescape,
|
||||
baselinestretch=1.1,
|
||||
linenos
|
||||
]{#1}{#2}
|
||||
}
|
||||
|
||||
% Args: Language, Base directory (with trailing slash), file (no slash at start)
|
||||
\newcommand{\inputcodewithfilename}[3]{
|
||||
\begin{figure}[h!]
|
||||
\texttt{File: \detokenize{#3}}
|
||||
\rmvspace
|
||||
\inputcode{#1}{#2#3}
|
||||
\end{figure}
|
||||
}
|
||||
91
src/core/setup.sty
Normal file
91
src/core/setup.sty
Normal file
@@ -0,0 +1,91 @@
|
||||
% ┌ ┐
|
||||
% │ Setup │
|
||||
% └ ┘
|
||||
% Set up the latex document, configure author, title (as first argument), as well as headers and footers
|
||||
\newcommand{\setup}[1]{
|
||||
\typeout{[Setup] Setting up...}
|
||||
\RequirePackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry}
|
||||
\title{\Huge \textbf{#1}}
|
||||
\author{\authorTitle}
|
||||
\makeatletter
|
||||
\makeatother
|
||||
\fancyhead{}
|
||||
\fancyhead[L]{#1}
|
||||
\fancyhead[R]{\authorHeaders}
|
||||
\fancyfoot{}
|
||||
\fancyfoot[L]{\today}
|
||||
\fancyfoot[R]{\thepage\ /\ \pageref{LastPage}}
|
||||
\fancypagestyle{plain}{%
|
||||
\fancyhead{}
|
||||
\fancyhead[L]{#1}
|
||||
\fancyhead[R]{\authorHeaders}
|
||||
\fancyfoot{}
|
||||
\fancyfoot[L]{\today}
|
||||
\fancyfoot[R]{\thepage\ /\ \pageref{LastPage}}
|
||||
}
|
||||
}
|
||||
|
||||
% Set up the latex document, only configuring the author, title and page size
|
||||
\newcommand{\setupBarebones}[1]{
|
||||
\RequirePackage[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}[2][true]{
|
||||
\ifthenelse{\equal{#1}{true}}{
|
||||
\RequirePackage[a4paper,textwidth=28.5cm,textheight=20cm,landscape]{geometry}
|
||||
\RequirePackage{flowfram}
|
||||
\ffvadjustfalse
|
||||
\setlength{\columnsep}{1cm}
|
||||
\Ncolumn{3}
|
||||
}{
|
||||
\RequirePackage[a4paper,textwidth=28.5cm,textheight=20cm]{geometry}
|
||||
}
|
||||
\title{\Huge \textbf{#2}}
|
||||
\author{\authorTitle}
|
||||
}
|
||||
|
||||
|
||||
% ┌ ┐
|
||||
% │ Document start │
|
||||
% └ ┘
|
||||
% Start document command (required)
|
||||
\newcommand{\startDocument}{
|
||||
% TODO: Cheat sheet needs different setup?
|
||||
\maketitle
|
||||
\pagestyle{fancy}
|
||||
\thispagestyle{fancy}
|
||||
|
||||
\tcbset{
|
||||
mainboxstyle/.style={
|
||||
arc=3mm,
|
||||
colback=red!5!white,
|
||||
colframe=red!75!black,
|
||||
colbacktitle=red!75!black,
|
||||
fonttitle=\bfseries,
|
||||
enhanced,
|
||||
attach boxed title to top left={yshift=-2mm,xshift=5mm},
|
||||
breakable,
|
||||
top=0.4cm,
|
||||
}
|
||||
}
|
||||
\tikzset{
|
||||
overlaystyle/.style={
|
||||
draw=red!75!black,
|
||||
thick,
|
||||
fill=red!75!black,
|
||||
left,
|
||||
anchor=east,
|
||||
text=white,
|
||||
rounded corners=1mm,
|
||||
font=\bfseries,
|
||||
xshift=-5mm,
|
||||
yshift=1mm,
|
||||
inner xsep=3mm,
|
||||
inner ysep=1.5mm
|
||||
}
|
||||
}
|
||||
}
|
||||
30
src/core/tables.sty
Normal file
30
src/core/tables.sty
Normal file
@@ -0,0 +1,30 @@
|
||||
% ┌ ┐
|
||||
% │ Tables │
|
||||
% └ ┘
|
||||
|
||||
\RequirePackage{booktabs}
|
||||
\RequirePackage{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}
|
||||
}
|
||||
22
src/core/translation.sty
Normal file
22
src/core/translation.sty
Normal file
@@ -0,0 +1,22 @@
|
||||
% ┌ ┐
|
||||
% │ Translation │
|
||||
% └ ┘
|
||||
\newcommand{\translate}[2]{%
|
||||
\ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}%
|
||||
}
|
||||
\newcommand{\tr}[2]{\translate{#1}{#2}}
|
||||
\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionDE{#1}}}
|
||||
\newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionDE{#1}}}
|
||||
|
||||
% Translation aids (commonly used)
|
||||
\newcommand{\trif}{\translate{if }{falls }}
|
||||
\newcommand{\trIf}{\translate{If }{Falls }}
|
||||
\newcommand{\trLet}{\translate{Let }{Sei }}
|
||||
\newcommand{\trLets}{\translate{Let }{Seien }}
|
||||
\newcommand{\trFor}{\translate{For }{Für }}
|
||||
\newcommand{\trfor}{\translate{for }{für }}
|
||||
\newcommand{\trand}{\translate{and }{und }}
|
||||
\newcommand{\tror}{\translate{or }{oder }}
|
||||
\newcommand{\trst}{\translate{s.t. }{s.d. }}
|
||||
\newcommand{\trsuchthat}{\translate{such that }{so dass }}
|
||||
\newcommand{\trwith}{\translate{with }{mit }}
|
||||
69
src/counters/figures-tables.sty
Normal file
69
src/counters/figures-tables.sty
Normal file
@@ -0,0 +1,69 @@
|
||||
% ┌ ┐
|
||||
% │ Counter numbering │
|
||||
% └ ┘
|
||||
\newcommand{\preEnvHook}[1]{%
|
||||
\stepLabelNumber{combined}%
|
||||
\ifthenelse{\equal{\numberingpreset}{combined}}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{
|
||||
\stepLabelNumber{combined}%
|
||||
}{}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{%
|
||||
\stepLabelNumber{combined}%
|
||||
}{}%
|
||||
}%
|
||||
}
|
||||
|
||||
% Decides on the numbering to use (combined or not)
|
||||
\newcommand{\loadNumberingConfiguration}{%
|
||||
\ifthenelse{\boolean{numberingDisabled}}{%
|
||||
\renewcommand{\thetable}{\arabic{table}}
|
||||
\renewcommand{\thefigure}{\arabic{figure}}
|
||||
}{
|
||||
\ifthenelse{\equal{\numberingpreset}{combined}}{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{none}}{
|
||||
\renewcommand{\thetable}{\arabic{combinednone}}
|
||||
\renewcommand{\thefigure}{\arabic{combinednone}}
|
||||
}{%
|
||||
\renewcommand{\thetable}{\ssprinter.\arabic{combined\subsectionnumbering}}
|
||||
\renewcommand{\thefigure}{\ssprinter.\arabic{combined\subsectionnumbering}}
|
||||
}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\numberingpreset}{separate}}{
|
||||
\ifthenelse{\equal{\subsectionnumbering}{none}}{}{
|
||||
\renewcommand{\thetable}{\ssprinter.\arabic{table}}
|
||||
\renewcommand{\thefigure}{\ssprinter.\arabic{figure}}
|
||||
}
|
||||
}{%
|
||||
\renewcommand{\thetable}{\arabic{table}}
|
||||
\renewcommand{\thefigure}{\arabic{figure}}
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
% Prints the preceding subsection numbers
|
||||
\newcommand{\ssprinter}{\thesection}
|
||||
\newcommand{\generateSubsection}{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{section}}{%
|
||||
\renewcommand{\ssprinter}{\thesection}
|
||||
}{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{subsection}}{%
|
||||
\renewcommand{\ssprinter}{\thesubsection}
|
||||
}{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{subsubsection}}{%
|
||||
\renewcommand{\ssprinter}{\thesubsubsection}
|
||||
}{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{paragraph}}{%
|
||||
\renewcommand{\ssprinter}{\theparagraph}
|
||||
}{
|
||||
\renewcommand{\ssprinter}{}
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
\loadNumberingConfiguration
|
||||
|
||||
\AtBeginEnvironment{table}{\preEnvHook{table}}
|
||||
\AtBeginEnvironment{figure}{\preEnvHook{figure}}
|
||||
33
src/counters/generator.sty
Normal file
33
src/counters/generator.sty
Normal file
@@ -0,0 +1,33 @@
|
||||
% ── Label generator ─────────────────────────────────────────────────
|
||||
\newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname}
|
||||
\newcommand{\printCounter}[1]{\refstepcounter{#1}\csname the#1\endcsname}
|
||||
|
||||
\newcommand{\printLabel}[1]{%
|
||||
\ifthenelse{\boolean{numberingDisabled}}{}{%
|
||||
\ifcsdef{#1numbering}{% Extra config present
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{%
|
||||
\labelPrintBackendRoutine{#1}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{%
|
||||
\printCounter{#1\subsectionnumbering}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{%
|
||||
\printCounter{combined\subsectionnumbering}%
|
||||
}{}%
|
||||
}%
|
||||
}%
|
||||
}{%
|
||||
\labelPrintBackendRoutine{#1}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\labelPrintBackendRoutine}[1]{%
|
||||
\ifthenelse{\equal{\numberingpreset}{combined}}{%
|
||||
\printCounter{combined\subsectionnumbering}%
|
||||
}{
|
||||
\ifthenelse{\equal{\numberingpreset}{separate}}{%
|
||||
\printCounter{#1\subsectionnumbering}%
|
||||
}{}%
|
||||
}%
|
||||
}
|
||||
70
src/counters/usercommands.sty
Normal file
70
src/counters/usercommands.sty
Normal file
@@ -0,0 +1,70 @@
|
||||
% ── Set the current number of a label ───────────────────────────────
|
||||
\newcommand{\setLabelNumber}[2]{%
|
||||
\setcounter{#1none}{#2}%
|
||||
\addtocounter{#1none}{-1}%
|
||||
\setcounter{#1section}{#2}%
|
||||
\addtocounter{#1section}{-1}%
|
||||
\setcounter{#1subsection}{#2}%
|
||||
\addtocounter{#1subsection}{-1}%
|
||||
\setcounter{#1subsubsection}{#2}%
|
||||
\addtocounter{#1subsubsection}{-1}%
|
||||
\setcounter{#1paragraph}{#2}%
|
||||
\addtocounter{#1paragraph}{-1}%
|
||||
}
|
||||
|
||||
\newcommand{\stepLabelNumber}[1]{%
|
||||
\stepcounter{#1none}%
|
||||
\stepcounter{#1section}%
|
||||
\stepcounter{#1subsection}%
|
||||
\stepcounter{#1subsubsection}%
|
||||
\stepcounter{#1paragraph}%
|
||||
}
|
||||
|
||||
|
||||
\newcommand{\newsection}{%
|
||||
\newpage
|
||||
\newsectionNoPB
|
||||
}
|
||||
|
||||
\newcommand{\newsectionNoPB}{
|
||||
\ifthenelse{\equal{\numberingpreset}{off}}{}{%
|
||||
\resetNumbering%
|
||||
\resetTableAndFigureNumbering%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\resetTableAndFigureNumbering}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{table}}{combined}}{
|
||||
\setcounter{table}{0}
|
||||
}{}%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{table}}{default}}{
|
||||
\setcounter{table}{0}
|
||||
}{}%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{figure}}{combined}}{%
|
||||
\setcounter{figure}{0}
|
||||
}{}%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{figure}}{default}}{
|
||||
\setcounter{figure}{0}
|
||||
}{}%
|
||||
}
|
||||
|
||||
|
||||
% Numbering toggling
|
||||
\newcommand{\numberingOff}{
|
||||
\setboolean{numberingDisabled}{true}
|
||||
\loadNumberingConfig
|
||||
}
|
||||
\newcommand{\numberingOn}{
|
||||
\setboolean{numberingDisabled}{false}
|
||||
\loadNumberingConfig
|
||||
}
|
||||
|
||||
\newcommand{\setsubsectionnumbering}[1]{
|
||||
\renewcommand{\subsectionnumbering}{#1}
|
||||
\loadNumberingConfiguration
|
||||
}
|
||||
|
||||
\newcommand{\setnumberingpreset}[1]{
|
||||
\renewcommand{\numberingpreset}{#1}
|
||||
\loadNumberingConfiguration
|
||||
}
|
||||
12
src/header.sty
Normal file
12
src/header.sty
Normal file
@@ -0,0 +1,12 @@
|
||||
%%
|
||||
%% Copyright (C) 2026 Janis Hutz
|
||||
%%
|
||||
%% This file may be distributed and/or modified under the
|
||||
%% conditions of the LaTeX Project Public License, either
|
||||
%% version 1.3 of this license or (at your option) any later
|
||||
%% version. The latest version of this license is in:
|
||||
%% http://www.latex-project.org/lppl.txt
|
||||
%% and version 1.3c or later is part of all distributions of
|
||||
%% LaTeX version 2008-05-04 or later.
|
||||
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
5
src/opts.sty
Normal file
5
src/opts.sty
Normal file
@@ -0,0 +1,5 @@
|
||||
\DeclareOption{de}{
|
||||
\RequirePackage[ngerman]{babel}
|
||||
\renewcommand{\currentLanguage}{de}
|
||||
}
|
||||
\ProcessOptions
|
||||
82
src/style.sty
Normal file
82
src/style.sty
Normal file
@@ -0,0 +1,82 @@
|
||||
% ┌ ┐
|
||||
% │ STYLE: Globals │
|
||||
% └ ┘
|
||||
% ── Fonts ───────────────────────────────────────────────────────────
|
||||
\newcommand{\setFont}[1]{\fontfamily{#1}\selectfont}
|
||||
\newcommand{\setFontType}[1]{
|
||||
\ifthenelse{\equal{#1}{mono}}{
|
||||
\renewcommand{\familydefault}{\ttdefault}
|
||||
}{
|
||||
\ifthenelse{\equal{#1}{serif}}{
|
||||
\renewcommand{\familydefault}{\rmdefault}
|
||||
}{
|
||||
\renewcommand{\familydefault}{\sfdefault}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
% ── Small common style elements ─────────────────────────────────────
|
||||
% Spacing (vertical)
|
||||
\newcommand{\rmvspace}[1][0.5]{\vspace{-#1pc}}
|
||||
|
||||
% Spacing (horizontal)
|
||||
\newcommand{\smallhspace}{\hspace{2mm}}
|
||||
\newcommand{\mediumhspace}{\hspace{5mm}}
|
||||
\newcommand{\largehspace}{\hspace{1cm}}
|
||||
|
||||
% other elements
|
||||
\renewcommand{\footrulewidth}{0.4pt}
|
||||
\newcommand{\TODO}{\color{red} \hl{TODO:} \color{black}}
|
||||
\newcommand{\bi}[1]{\textbf{\textit{#1}}}
|
||||
\renewcommand{\quote}[1]{``\textit{#1}''}
|
||||
|
||||
% Add a color shade (similar to \fhlc, but nicer boxes)
|
||||
\newcommand{\background}[3]{%
|
||||
\tcbox[on line,
|
||||
boxsep=\backgroundPadding,
|
||||
arc=\backgroundRounding,
|
||||
left=0pt,
|
||||
right=0pt,
|
||||
top=0pt,
|
||||
bottom=0pt,
|
||||
frame empty,
|
||||
colback=#1!#2!white,
|
||||
highlight math style={enhanced}
|
||||
] {\textbf{#3}}%
|
||||
}
|
||||
|
||||
% Abstraction of background, where the brightness is set to 20%
|
||||
\newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}}
|
||||
|
||||
% This command is used for the short and inline descriptors
|
||||
\newcommand{\bg}[2]{\background{#1}{\arabic{descriptorShadeStrength}}{#2}}
|
||||
|
||||
% Add a gray backdrop
|
||||
\newcommand{\backdrop}[1]{\shade{black}{#1}}
|
||||
|
||||
% Print a table of contents as a tcolorbox
|
||||
\newcommand{\printtoc}[1]{
|
||||
\renewcommand{\cfttoctitlefont}{}
|
||||
\renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}}
|
||||
\renewcommand{\contentsname}{}
|
||||
\begin{tcolorbox}[
|
||||
colback=black!5!white,
|
||||
colbacktitle=#1!75!black,
|
||||
coltitle=black,
|
||||
enhanced,
|
||||
attach boxed title to top center={yshift=-2mm},
|
||||
title={\Large \tr{Contents}{Inhaltsverzeichnis}},
|
||||
fonttitle=\bfseries,
|
||||
breakable
|
||||
]
|
||||
\hspace{1cm}
|
||||
\tableofcontents
|
||||
\end{tcolorbox}
|
||||
}
|
||||
|
||||
|
||||
% Draw box around links. First arg link, second arg display
|
||||
\newcommand{\hlhref}[2]{\color{MidnightBlue}\fbox{\href{#1}{#2}}\color{black}}
|
||||
|
||||
% Same for urls (just one arg tho)
|
||||
\newcommand{\hlurl}[1]{\color{MidnightBlue}\fbox{\url{#1}}\color{black}}
|
||||
17
src/style/cs.sty
Normal file
17
src/style/cs.sty
Normal file
@@ -0,0 +1,17 @@
|
||||
% ┌ ┐
|
||||
% │ STYLE: Computer Science │
|
||||
% └ ┘
|
||||
\RequirePackage{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}
|
||||
}
|
||||
51
src/style/environments-descriptors.sty
Normal file
51
src/style/environments-descriptors.sty
Normal file
@@ -0,0 +1,51 @@
|
||||
% ── Inline environments ─────────────────────────────────────────────
|
||||
% TODO: ref label generation
|
||||
\newcommand{\inline}[2][NONAME]{%
|
||||
\ifthenelse{\equal{NONAME}{#1}}{%
|
||||
\anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}%
|
||||
}{%
|
||||
\inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\labeledInline}[3][NONAME]{%
|
||||
\edef{\tempLabel}{#3}
|
||||
\label{\tempLabel}
|
||||
\inline[#1]{#2}
|
||||
}
|
||||
|
||||
\newcommand{\unnumberedInline}[2][NONAME]{%
|
||||
\ifthenelse{\equal{NONAME}{#1}}{%
|
||||
\anonymousInlineDescriptorTemplate{#2}{}%
|
||||
}{%
|
||||
\inlineDescriptorTemplate{#2}{}{#1}%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\short}[2][NONAME]{%
|
||||
\ifthenelse{\equal{NONAME}{#1}}{%
|
||||
\anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}%
|
||||
}{%
|
||||
\shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\labeledShort}[3][NONAME]{%
|
||||
\edef{\tempLabel}{#3}
|
||||
\label{\tempLabel}
|
||||
\short[#1]{#2}
|
||||
}
|
||||
|
||||
\newcommand{\unnumberedShort}[2][NONAME]{%
|
||||
\ifthenelse{\equal{NONAME}{#1}}{%
|
||||
\anonymousShortDescriptorTemplate{#2}{}%
|
||||
}{%
|
||||
\shortDescriptorTemplate{#2}{}{#1}%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\inlineproof}[1][NONAME]{\unnumberedInline[#1]{proof}}
|
||||
\newcommand{\inlineterm}[1][NONAME]{\unnumberedInline[#1]{term}}
|
||||
|
||||
\newcommand{\shortproof}[1][NONAME]{\unnumberedShort[#1]{proof}}
|
||||
\newcommand{\shortterm}[1][NONAME]{\unnumberedShort[#1]{term}}
|
||||
9
src/style/math.sty
Normal file
9
src/style/math.sty
Normal file
@@ -0,0 +1,9 @@
|
||||
% ┌ ┐
|
||||
% │ STYLE: Math │
|
||||
% └ ┘
|
||||
|
||||
% Add shortcuts to commonly used commands
|
||||
\newcommand{\vect}[1]{\overrightarrow{#1}}
|
||||
\renewcommand{\hat}[1]{\widehat{#1}}
|
||||
\renewcommand{\tilde}[1]{\widetilde{#1}}
|
||||
\newcommand{\proven}{$\hspace{17cm}\square$}
|
||||
44
src/style/spacing.sty
Normal file
44
src/style/spacing.sty
Normal file
@@ -0,0 +1,44 @@
|
||||
\newcommand{\noverticalspacing}{
|
||||
\abovedisplayskip 1pt plus 2pt minus 1pt
|
||||
\belowdisplayskip 1pt plus 2pt minus 1pt
|
||||
\abovedisplayshortskip -10pt
|
||||
\belowdisplayshortskip 1pt plus 2pt minus 1pt
|
||||
\floatsep 1pt plus 2pt minus 1pt
|
||||
\intextsep 1pt plus 2pt minus 1pt
|
||||
\textfloatsep 1pt plus 2pt minus 1pt
|
||||
\abovecaptionskip 2pt
|
||||
\setlist{noitemsep,topsep=1pt,partopsep=0pt}
|
||||
}
|
||||
\newcommand{\smallverticalspacing}{
|
||||
\abovedisplayskip 4pt plus 3pt minus 2pt
|
||||
\belowdisplayskip 5pt plus 5pt minus 2pt
|
||||
\abovedisplayshortskip -5pt
|
||||
\belowdisplayshortskip 3pt plus 4pt minus 2pt
|
||||
\floatsep 4pt plus 3pt minus 2pt
|
||||
\intextsep 4pt plus 3pt minus 2pt
|
||||
\textfloatsep 4pt plus 3pt minus 2pt
|
||||
\abovecaptionskip 4pt
|
||||
\setlist{itemsep=2pt,topsep=2pt,partopsep=1pt}
|
||||
}
|
||||
\newcommand{\mediumverticalspacing}{
|
||||
\abovedisplayskip 7pt plus 4pt minus 3pt
|
||||
\belowdisplayskip 9pt plus 6pt minus 3pt
|
||||
\abovedisplayshortskip 0pt
|
||||
\belowdisplayshortskip 5pt plus 4pt minus 2pt
|
||||
\floatsep 7pt plus 4pt minus 3pt
|
||||
\intextsep 7pt plus 4pt minus 3pt
|
||||
\textfloatsep 7pt plus 4pt minus 3pt
|
||||
\abovecaptionskip 7pt
|
||||
\setlist{itemsep=4pt,topsep=4pt,partopsep=2pt}
|
||||
}
|
||||
\newcommand{\largeverticalspacing}{
|
||||
\abovedisplayskip 13pt plus 5pt minus 4pt
|
||||
\belowdisplayskip 15pt plus 9pt minus 6pt
|
||||
\abovedisplayshortskip 5pt plus 2pt minus 3pt
|
||||
\belowdisplayshortskip 7pt plus 5pt minus 2pt
|
||||
\floatsep 12pt plus 5pt minus 4pt
|
||||
\intextsep 12pt plus 5pt minus 4pt
|
||||
\textfloatsep 12pt plus 5pt minus 4pt
|
||||
\abovecaptionskip 10pt
|
||||
\setlist{itemsep=6pt,topsep=6pt,partopsep=2pt}
|
||||
}
|
||||
48
src/style/tcb.sty
Normal file
48
src/style/tcb.sty
Normal file
@@ -0,0 +1,48 @@
|
||||
% ┌ ┐
|
||||
% │ STYLE: Common tcolorboxes │
|
||||
% └ ┘
|
||||
|
||||
\newtcolorbox{recall}[2][]{mainboxstyle,colback=recallcolor!5!white,colframe=recallcolor!75!black,colbacktitle=recallcolor!75!black,title={\large #2},
|
||||
overlay={\node[overlaystyle,draw=recallcolor!75!black,fill=recallcolor!75!black] at (frame.north east) {\large \translate{Recall }{Repetition }};},#1}
|
||||
|
||||
\newtcolorbox{properties}[2][]{mainboxstyle,colback=propertiescolor!5!white,colframe=propertiescolor!75!black,colbacktitle=propertiescolor!75!black,title={\large #2},
|
||||
overlay={\node[overlaystyle,draw=propertiescolor!75!black,fill=propertiescolor!75!black] at (frame.north east) {\large \translate{Properties }{Eigenschaften }};},#1}
|
||||
|
||||
\newtcolorbox{restrictions}[2][]{mainboxstyle,colback=propertiescolor!5!white,colframe=propertiescolor!75!black,colbacktitle=propertiescolor!75!black,title={\large #2},
|
||||
overlay={\node[overlaystyle,draw=propertiescolor!75!black,fill=propertiescolor!75!black] at (frame.north east) {\large \translate{Restrictions }{Einschränkungen }};},#1}
|
||||
|
||||
\newtcolorbox{limitations}[2][]{mainboxstyle,colback=propertiescolor!5!white,colframe=propertiescolor!75!black,colbacktitle=propertiescolor!75!black,title={\large #2},
|
||||
overlay={\node[overlaystyle,draw=propertiescolor!75!black,fill=propertiescolor!75!black] at (frame.north east) {\large \translate{Limitations }{Limitierungen }};},#1}
|
||||
|
||||
\newtcolorbox{intuition}[2][]{mainboxstyle,colback=intuitioncolor!5!white,colframe=intuitioncolor!75!black,colbacktitle=intuitioncolor!75!black,title={\large #2},
|
||||
overlay={\node[overlaystyle,draw=intuitioncolor!75!black,fill=intuitioncolor!75!black] at (frame.north east) {\large Intuition};},#1}
|
||||
|
||||
\newcommand{\inlineintuition}{\bg{intuitioncolor}{Intuition:}}
|
||||
|
||||
|
||||
% Terms and notation
|
||||
\newtcolorbox{terms}[2][]{mainboxstyle,colback=termcolor!5!white,colframe=termcolor!75!black,colbacktitle=termcolor!75!black,title={\large #2},
|
||||
overlay={\node[overlaystyle,draw=termcolor!75!black,fill=termcolor!75!black] at (frame.north east) {\large \translate{Terms }{Begriffe }};},#1}
|
||||
|
||||
\newtcolorbox{notation}[2][]{mainboxstyle,colback=notationcolor!5!white,colframe=notationcolor!75!black,colbacktitle=notationcolor!75!black,title={\large #2},
|
||||
overlay={\node[overlaystyle,draw=notationcolor!75!black,fill=notationcolor!75!black] at (frame.north east) {\large Notation};},#1}
|
||||
|
||||
|
||||
\newtcolorbox{usage}[2][]{mainboxstyle,colback=usagecolor!5!white,colframe=usagecolor!75!black,colbacktitle=usagecolor!75!black,title={\large #2},
|
||||
overlay={\node[overlaystyle,draw=usagecolor!75!black,fill=usagecolor!75!black] at (frame.north east) {\large \translate{Usage }{Nutzung }};},#1}
|
||||
|
||||
|
||||
% Task
|
||||
\newtcolorbox{task}[2][]{mainboxstyle,colback=taskcolor!5!white,colframe=taskcolor!75!black,colbacktitle=taskcolor!75!black,title={\large #2},overlay={\node[overlaystyle,draw=taskcolor!75!black,fill=taskcolor!75!black] at (frame.north east) {\large \translate{Task}{Aufgabe}};},#1}
|
||||
|
||||
|
||||
% Proof
|
||||
\newtcolorbox{proof}[2][]{mainboxstyle,colback=proofcolor!5!white,colframe=proofcolor!75!black,colbacktitle=proofcolor!75!black,title={\large #2},overlay={\node[overlaystyle,draw=proofcolor!75!black,fill=proofcolor!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}
|
||||
Reference in New Issue
Block a user