Start reworking helpers
This commit is contained in:
126
src/core/core.tex
Normal file
126
src/core/core.tex
Normal file
@@ -0,0 +1,126 @@
|
||||
|
||||
% ▄▄█▀▀▀█▄█
|
||||
% ▄██▀ ▀█
|
||||
% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██
|
||||
% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██
|
||||
% ██▄ ██ ██ ██ ██▀▀▀▀▀▀
|
||||
% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄
|
||||
% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀
|
||||
|
||||
% This file contains all necessary dependencies for the document to compile (at all) and some core macros
|
||||
|
||||
% Imports %
|
||||
\typeout{[Core] Importing!}
|
||||
|
||||
|
||||
% Language Switching. Currently only English and German are supported
|
||||
% See docs for how to use
|
||||
\newcounter{lang}
|
||||
\typeout{Loading helpers}
|
||||
|
||||
% TODO: Fix this up
|
||||
\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}
|
||||
\input{\dir/main/lang/de}
|
||||
\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
|
||||
\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}}
|
||||
}
|
||||
}
|
||||
|
||||
% 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
|
||||
\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}[1]{
|
||||
\loadLang
|
||||
\RequirePackage[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 }}
|
||||
32
src/core/cs.tex
Normal file
32
src/core/cs.tex
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀
|
||||
% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀
|
||||
% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀
|
||||
|
||||
% Extra imports
|
||||
\RequirePackage{stmaryrd}
|
||||
\RequirePackage{algorithm}
|
||||
\RequirePackage{algpseudocodex}
|
||||
\RequirePackage{setspace}
|
||||
\RequirePackage{verbatim}
|
||||
\RequirePackage{turnstile}
|
||||
\RequirePackage{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}}}
|
||||
21
src/core/index.tex
Normal file
21
src/core/index.tex
Normal file
@@ -0,0 +1,21 @@
|
||||
% ▄▄
|
||||
% ▀████▀ ▀███
|
||||
% ██ ██
|
||||
% ██ ▀████████▄ ▄█▀▀███ ▄▄█▀██▀██▀ ▀██▀
|
||||
% ██ ██ ██ ▄██ ██ ▄█▀ ██ ▀██ ▄█▀
|
||||
% ██ ██ ██ ███ ██ ██▀▀▀▀▀▀ ███
|
||||
% ██ ██ ██ ▀██ ██ ██▄ ▄ ▄█▀ ██▄
|
||||
% ▄████▄████ ████▄ ▀████▀███▄ ▀█████▀██▄ ▄██▄
|
||||
|
||||
|
||||
% For using index package
|
||||
\newcommand{\prepareIndex}{
|
||||
\RequirePackage[T1]{fontenc}
|
||||
\RequirePackage{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}
|
||||
|
||||
83
src/core/math.tex
Normal file
83
src/core/math.tex
Normal file
@@ -0,0 +1,83 @@
|
||||
% ▄▄
|
||||
% ▀████▄ ▄███▀ ██ ███
|
||||
% ████ ████ ██ ██
|
||||
% █ ██ ▄█ ██ ▄█▀██▄ ██████ ███████▄
|
||||
% █ ██ █▀ ██ ██ ██ ██ ██ ██
|
||||
% █ ██▄█▀ ██ ▄█████ ██ ██ ██
|
||||
% █ ▀██▀ ██ ██ ██ ██ ██ ██
|
||||
% ▄███▄ ▀▀ ▄████▄████▀██▄ ▀███████ ████▄
|
||||
|
||||
|
||||
% 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}
|
||||
34
src/core/tables.tex
Normal file
34
src/core/tables.tex
Normal file
@@ -0,0 +1,34 @@
|
||||
% _____ _ _
|
||||
% (_ _) ( ) (_ )
|
||||
% | | _ _| |_ | | __ ___
|
||||
% | | / _ ) _ \ | | / __ \ __)
|
||||
% | | ( (_| | |_) )| |( ___/__ \
|
||||
% (_) \__ _)_ __/(___)\____)____/
|
||||
|
||||
|
||||
\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}
|
||||
}
|
||||
Reference in New Issue
Block a user