Compare commits

1 Commits
main ... dev

Author SHA1 Message Date
5b1b65b0d8 [Build] Some experimentation 2025-11-03 15:40:18 +01:00
26 changed files with 823 additions and 2071 deletions

View File

@@ -8,61 +8,51 @@ echo "
█ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █ █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █
█ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █ █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █
█▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█ █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█
==> Building <==
" "
mkdir dist/ mkdir dist/
echo " cat ./janishutz-helpers.sty >./dist/janishutz-helpers-minimal.sty
% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄
% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █
% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█
% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄
% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █
% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █
% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█
" > ./dist/minimal.tex
# Build minimal scope # Build minimal scope
cat ./main/core.tex >>./dist/minimal.tex echo "" >>./dist/janishutz-helpers-minimal.sty
echo "" >>./dist/minimal.tex cat ./config/config.tex >>./dist/janishutz-helpers-minimal.sty
cat ./config/config.tex >>./dist/minimal.tex echo "" >>./dist/janishutz-helpers-minimal.sty
echo "" >>./dist/minimal.tex cat ./main/core.tex >>./dist/janishutz-helpers-minimal.sty
cat ./main/style/style.tex >>./dist/minimal.tex echo "" >>./dist/janishutz-helpers-minimal.sty
echo "" >>./dist/minimal.tex cat ./main/style/style.tex >>./dist/janishutz-helpers-minimal.sty
cat ./main/style/common.tex >>./dist/minimal.tex echo "" >>./dist/janishutz-helpers-minimal.sty
cat ./main/style/common.tex >>./dist/janishutz-helpers-minimal.sty
# Build most
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 # Build recommended
cat ./dist/most.tex >./dist/recommended.tex cat ./dist/janishutz-helpers-minimal.sty >./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/recommended.tex echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./extra/bib.tex >>./dist/recommended.tex cat ./main/math.tex >>./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/recommended.tex echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./extra/glossary.tex >>./dist/recommended.tex cat ./main/cs.tex >>./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./main/index.tex >>./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./main/style/counters.tex >>./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./main/style/cs.tex >>./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./main/style/math.tex >>./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./main/style/language.tex >>./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./extra/bib.tex >>./dist/janishutz-helpers-recommended.sty
echo "" >>./dist/janishutz-helpers-recommended.sty
cat ./extra/glossary.tex >>./dist/janishutz-helpers-recommended.sty
# Build full # Build full
cat ./dist/recommended.tex >./dist/full.tex cat ./dist/janishutz-helpers-recommended.sty >./dist/janishutz-helpers-full.sty
echo "" >>./dist/full.tex echo "" >>./dist/janishutz-helpers-full.sty
cat ./extra/minted.tex >>./dist/full.tex cat ./extra/minted.tex >>./dist/janishutz-helpers-full.sty
# Copy letter # Copy letter
cp ./scopes/letter.tex ./dist/letter.tex cp ./scopes/letter.tex ./dist/janishutz-helpers-letters.sty
echo "==> Done" echo "==> Done"

1083
dist/full.tex vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,160 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ \ProvidesPackage{janishutz-helpers}[2.0.0]
% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █
% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█
% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄
% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █
% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █
% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█
% ▄▄█▀▀▀█▄█
% ▄██▀ ▀█
% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██
% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██
% ██▄ ██ ██ ██ ██▀▀▀▀▀▀
% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄
% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀
% 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{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 }}
% ___ ___ % ___ ___
% ( _ \ / ___)_ % ( _ \ / ___)_
@@ -201,6 +46,158 @@
% The colour-saturation of the shade command (default = 20) % The colour-saturation of the shade command (default = 20)
\setcounter{shadeStrength}{20} \setcounter{shadeStrength}{20}
% ▄▄█▀▀▀█▄█
% ▄██▀ ▀█
% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██
% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██
% ██▄ ██ ██ ██ ██▀▀▀▀▀▀
% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄
% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀
% This file contains all necessary dependencies for the document to compile (at all) and some core macros
% Imports %
\typeout{[Core] Importing!}
\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{parskip}
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
\RequirePackage{tocloft}
\RequirePackage{wasysym}
\RequirePackage{wrapfig}
\RequirePackage{multicol}
\RequirePackage{ifthen}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage{enumitem}
\RequirePackage{gensymb}
\RequirePackage{pifont}
% 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 }}
%░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ %░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
%░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░ %░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░
%▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ %▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒
@@ -213,35 +210,35 @@
% Global style configs for tcolorbox (to reduce bloat) % Global style configs for tcolorbox (to reduce bloat)
\newcommand{\usetcolorboxes}{ \newcommand{\usetcolorboxes}{
\tcbset{ \tcbset{
mainboxstyle/.style={ mainboxstyle/.style={
arc=3mm, arc=3mm,
colback=red!5!white, colback=red!5!white,
colframe=red!75!black, colframe=red!75!black,
colbacktitle=red!75!black, colbacktitle=red!75!black,
fonttitle=\bfseries, fonttitle=\bfseries,
enhanced, enhanced,
attach boxed title to top left={yshift=-2mm,xshift=5mm}, attach boxed title to top left={yshift=-2mm,xshift=5mm},
breakable, breakable,
top=0.4cm, top=0.4cm,
} }
} }
\tikzset{ \tikzset{
overlaystyle/.style={ overlaystyle/.style={
draw=red!75!black, draw=red!75!black,
thick, thick,
fill=red!75!black, fill=red!75!black,
left, left,
anchor=east, anchor=east,
text=white, text=white,
rounded corners=1mm, rounded corners=1mm,
font=\bfseries, font=\bfseries,
xshift=-5mm, xshift=-5mm,
yshift=1mm, yshift=1mm,
inner xsep=3mm, inner xsep=3mm,
inner ysep=1.5mm inner ysep=1.5mm
} }
} }
} }
% -------------------- % % -------------------- %
@@ -268,16 +265,16 @@
% Add a color shade (similar to \fhlc, but nicer boxes) % Add a color shade (similar to \fhlc, but nicer boxes)
\newcommand{\background}[3]{\tcbox[on line, \newcommand{\background}[3]{\tcbox[on line,
boxsep=2pt, boxsep=2pt,
left=0pt, left=0pt,
right=0pt, right=0pt,
top=0pt, top=0pt,
bottom=0pt, bottom=0pt,
colframe=white, colframe=white,
frame empty, frame empty,
colback=#1!#2!white, colback=#1!#2!white,
highlight math style={enhanced} highlight math style={enhanced}
] {\textbf{#3}}} ] {\textbf{#3}}}
% Abstraction of background, where the brightness is set to 20% % Abstraction of background, where the brightness is set to 20%
\newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}} \newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}}
@@ -295,12 +292,6 @@
% Add a colorbox around your text with the color specified. Text is bold and underlined % Add a colorbox around your text with the color specified. Text is bold and underlined
\newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}} \newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}}
% 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}}
% Spacing (horizontal) % Spacing (horizontal)
\newcommand{\smallhspace}{\hspace{2mm}} \newcommand{\smallhspace}{\hspace{2mm}}
\newcommand{\mediumhspace}{\hspace{5mm}} \newcommand{\mediumhspace}{\hspace{5mm}}
@@ -312,14 +303,14 @@
% Print a table of contents as a tcolorbox % Print a table of contents as a tcolorbox
\newcommand{\printtoc}[1]{ \newcommand{\printtoc}[1]{
\renewcommand{\cfttoctitlefont}{} \renewcommand{\cfttoctitlefont}{}
\renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}} \renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}}
\renewcommand{\contentsname}{} \renewcommand{\contentsname}{}
\begin{tcolorbox}[colback=black!5!white,colbacktitle=#1!75!black,coltitle=black,enhanced,attach boxed title to top center={yshift=-2mm}, \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] title={\Large \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable]
\hspace{1cm} \hspace{1cm}
\tableofcontents \tableofcontents
\end{tcolorbox} \end{tcolorbox}
} }
%▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ %▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
@@ -391,31 +382,15 @@
% BB shortcuts (for number spaces, etc) % BB shortcuts (for number spaces, etc)
\newcommand{\A}{\mathbb{A}}
\newcommand{\B}{\mathbb{B}}
\newcommand{\C}{\mathbb{C}} \newcommand{\C}{\mathbb{C}}
\newcommand{\D}{\mathbb{D}} \newcommand{\D}{\mathbb{D}}
\newcommand{\E}{\mathbb{E}} \newcommand{\E}{\mathbb{E}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\G}{\mathbb{G}}
\renewcommand{\H}{\mathbb{H}}
\newcommand{\I}{\mathbb{I}} \newcommand{\I}{\mathbb{I}}
\newcommand{\J}{\mathbb{J}} \newcommand{\J}{\mathbb{J}}
\newcommand{\K}{\mathbb{K}}
\renewcommand{\L}{\mathbb{L}}
\newcommand{\M}{\mathbb{M}}
\newcommand{\N}{\mathbb{N}} \newcommand{\N}{\mathbb{N}}
\renewcommand{\O}{\mathbb{O}}
\renewcommand{\P}{\mathbb{P}}
\newcommand{\Q}{\mathbb{Q}} \newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}} \newcommand{\R}{\mathbb{R}}
\renewcommand{\S}{\mathbb{S}}
\newcommand{\T}{\mathbb{T}}
\newcommand{\U}{\mathbb{U}}
\newcommand{\V}{\mathbb{V}} \newcommand{\V}{\mathbb{V}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\X}{\mathbb{X}}
\newcommand{\Y}{\mathbb{Y}}
\newcommand{\Z}{\mathbb{Z}} \newcommand{\Z}{\mathbb{Z}}
% Caligraphic % Caligraphic
@@ -486,13 +461,13 @@
% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ % ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀
% Extra imports % Extra imports
\usepackage{stmaryrd} \RequirePackage{stmaryrd}
\usepackage{algorithm} \RequirePackage{algorithm}
\usepackage{algpseudocodex} \RequirePackage{algpseudocodex}
\usepackage{setspace} \RequirePackage{setspace}
\usepackage{verbatim} \RequirePackage{verbatim}
\usepackage{turnstile} \RequirePackage{turnstile}
\usepackage{forloop} \RequirePackage{forloop}
\newcommand{\Indent}{\hspace{\algorithmicindent}} \newcommand{\Indent}{\hspace{\algorithmicindent}}
@@ -525,8 +500,8 @@
% For using index package % For using index package
\newcommand{\prepareIndex}{ \newcommand{\prepareIndex}{
\usepackage[T1]{fontenc} \RequirePackage[T1]{fontenc}
\usepackage{imakeidx} \RequirePackage{imakeidx}
\makeindex \makeindex
} }
@@ -542,8 +517,8 @@
% ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌ % ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌
% ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀ % ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀
\usepackage{xstring} \RequirePackage{xstring}
\usepackage{etoolbox} \RequirePackage{etoolbox}
% tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters % tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters
\newcounter{lemma}[section] \newcounter{lemma}[section]
\newcounter{definition}[section] \newcounter{definition}[section]
@@ -989,40 +964,6 @@
\newtcolorbox{forms}[2][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2}, \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} overlay={\node[overlaystyle,draw=red!75!black,fill=red!75!black] at (frame.north east) {\large \translate{Forms}{Formen}};},#1}
% _____ _ _
% (_ _) ( ) (_ )
% | | _ _| |_ | | __ ___
% | | / _ ) _ \ | | / __ \ __)
% | | ( (_| | |_) )| |( ___/__ \
% (_) \__ _)_ __/(___)\____)____/
\usepackage{booktabs}
% 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}
}
% ___ _ _____ _ _ % ___ _ _____ _ _
% ( _ \ _( ) (_ _) ( ) ( ) % ( _ \ _( ) (_ _) ( ) ( )
% | (_) )_) |_ | | __ \ \/ / % | (_) )_) |_ | | __ \ \/ /
@@ -1060,3 +1001,21 @@
\glsaddall \glsaddall
\printnoidxglossaries \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}}

View File

@@ -1,160 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ \ProvidesPackage{janishutz-helpers}[2.0.0]
% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █
% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█
% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄
% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █
% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █
% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█
% ▄▄█▀▀▀█▄█
% ▄██▀ ▀█
% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██
% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██
% ██▄ ██ ██ ██ ██▀▀▀▀▀▀
% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄
% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀
% 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{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 }}
% ___ ___ % ___ ___
% ( _ \ / ___)_ % ( _ \ / ___)_
@@ -201,6 +46,158 @@
% The colour-saturation of the shade command (default = 20) % The colour-saturation of the shade command (default = 20)
\setcounter{shadeStrength}{20} \setcounter{shadeStrength}{20}
% ▄▄█▀▀▀█▄█
% ▄██▀ ▀█
% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██
% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██
% ██▄ ██ ██ ██ ██▀▀▀▀▀▀
% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄
% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀
% This file contains all necessary dependencies for the document to compile (at all) and some core macros
% Imports %
\typeout{[Core] Importing!}
\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{parskip}
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
\RequirePackage{tocloft}
\RequirePackage{wasysym}
\RequirePackage{wrapfig}
\RequirePackage{multicol}
\RequirePackage{ifthen}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage{enumitem}
\RequirePackage{gensymb}
\RequirePackage{pifont}
% 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 }}
%░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ %░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
%░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░ %░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░
%▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ %▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒
@@ -213,35 +210,35 @@
% Global style configs for tcolorbox (to reduce bloat) % Global style configs for tcolorbox (to reduce bloat)
\newcommand{\usetcolorboxes}{ \newcommand{\usetcolorboxes}{
\tcbset{ \tcbset{
mainboxstyle/.style={ mainboxstyle/.style={
arc=3mm, arc=3mm,
colback=red!5!white, colback=red!5!white,
colframe=red!75!black, colframe=red!75!black,
colbacktitle=red!75!black, colbacktitle=red!75!black,
fonttitle=\bfseries, fonttitle=\bfseries,
enhanced, enhanced,
attach boxed title to top left={yshift=-2mm,xshift=5mm}, attach boxed title to top left={yshift=-2mm,xshift=5mm},
breakable, breakable,
top=0.4cm, top=0.4cm,
} }
} }
\tikzset{ \tikzset{
overlaystyle/.style={ overlaystyle/.style={
draw=red!75!black, draw=red!75!black,
thick, thick,
fill=red!75!black, fill=red!75!black,
left, left,
anchor=east, anchor=east,
text=white, text=white,
rounded corners=1mm, rounded corners=1mm,
font=\bfseries, font=\bfseries,
xshift=-5mm, xshift=-5mm,
yshift=1mm, yshift=1mm,
inner xsep=3mm, inner xsep=3mm,
inner ysep=1.5mm inner ysep=1.5mm
} }
} }
} }
% -------------------- % % -------------------- %
@@ -268,16 +265,16 @@
% Add a color shade (similar to \fhlc, but nicer boxes) % Add a color shade (similar to \fhlc, but nicer boxes)
\newcommand{\background}[3]{\tcbox[on line, \newcommand{\background}[3]{\tcbox[on line,
boxsep=2pt, boxsep=2pt,
left=0pt, left=0pt,
right=0pt, right=0pt,
top=0pt, top=0pt,
bottom=0pt, bottom=0pt,
colframe=white, colframe=white,
frame empty, frame empty,
colback=#1!#2!white, colback=#1!#2!white,
highlight math style={enhanced} highlight math style={enhanced}
] {\textbf{#3}}} ] {\textbf{#3}}}
% Abstraction of background, where the brightness is set to 20% % Abstraction of background, where the brightness is set to 20%
\newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}} \newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}}
@@ -295,12 +292,6 @@
% Add a colorbox around your text with the color specified. Text is bold and underlined % Add a colorbox around your text with the color specified. Text is bold and underlined
\newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}} \newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}}
% 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}}
% Spacing (horizontal) % Spacing (horizontal)
\newcommand{\smallhspace}{\hspace{2mm}} \newcommand{\smallhspace}{\hspace{2mm}}
\newcommand{\mediumhspace}{\hspace{5mm}} \newcommand{\mediumhspace}{\hspace{5mm}}
@@ -312,14 +303,14 @@
% Print a table of contents as a tcolorbox % Print a table of contents as a tcolorbox
\newcommand{\printtoc}[1]{ \newcommand{\printtoc}[1]{
\renewcommand{\cfttoctitlefont}{} \renewcommand{\cfttoctitlefont}{}
\renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}} \renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}}
\renewcommand{\contentsname}{} \renewcommand{\contentsname}{}
\begin{tcolorbox}[colback=black!5!white,colbacktitle=#1!75!black,coltitle=black,enhanced,attach boxed title to top center={yshift=-2mm}, \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] title={\Large \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable]
\hspace{1cm} \hspace{1cm}
\tableofcontents \tableofcontents
\end{tcolorbox} \end{tcolorbox}
} }
%▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ %▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

View File

@@ -1,160 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
% ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ \ProvidesPackage{janishutz-helpers}[2.0.0]
% █ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █
% █ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█
% █ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄
% █ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █
% █ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █
% █▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█
% ▄▄█▀▀▀█▄█
% ▄██▀ ▀█
% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██
% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██
% ██▄ ██ ██ ██ ██▀▀▀▀▀▀
% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄
% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀
% 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{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 }}
% ___ ___ % ___ ___
% ( _ \ / ___)_ % ( _ \ / ___)_
@@ -201,6 +46,158 @@
% The colour-saturation of the shade command (default = 20) % The colour-saturation of the shade command (default = 20)
\setcounter{shadeStrength}{20} \setcounter{shadeStrength}{20}
% ▄▄█▀▀▀█▄█
% ▄██▀ ▀█
% ██▀ ▀ ▄██▀██▄▀███▄███ ▄▄█▀██
% ██ ██▀ ▀██ ██▀ ▀▀ ▄█▀ ██
% ██▄ ██ ██ ██ ██▀▀▀▀▀▀
% ▀██▄ ▄▀██▄ ▄██ ██ ██▄ ▄
% ▀▀█████▀ ▀█████▀▄████▄ ▀█████▀
% This file contains all necessary dependencies for the document to compile (at all) and some core macros
% Imports %
\typeout{[Core] Importing!}
\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{parskip}
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
\RequirePackage{tocloft}
\RequirePackage{wasysym}
\RequirePackage{wrapfig}
\RequirePackage{multicol}
\RequirePackage{ifthen}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage{enumitem}
\RequirePackage{gensymb}
\RequirePackage{pifont}
% 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 }}
%░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ %░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
%░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░ %░░░ ░░░░░ ░░░░░░░░░░░░░ ░░░░░░░░░░░
%▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ %▒ ▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒
@@ -213,35 +210,35 @@
% Global style configs for tcolorbox (to reduce bloat) % Global style configs for tcolorbox (to reduce bloat)
\newcommand{\usetcolorboxes}{ \newcommand{\usetcolorboxes}{
\tcbset{ \tcbset{
mainboxstyle/.style={ mainboxstyle/.style={
arc=3mm, arc=3mm,
colback=red!5!white, colback=red!5!white,
colframe=red!75!black, colframe=red!75!black,
colbacktitle=red!75!black, colbacktitle=red!75!black,
fonttitle=\bfseries, fonttitle=\bfseries,
enhanced, enhanced,
attach boxed title to top left={yshift=-2mm,xshift=5mm}, attach boxed title to top left={yshift=-2mm,xshift=5mm},
breakable, breakable,
top=0.4cm, top=0.4cm,
} }
} }
\tikzset{ \tikzset{
overlaystyle/.style={ overlaystyle/.style={
draw=red!75!black, draw=red!75!black,
thick, thick,
fill=red!75!black, fill=red!75!black,
left, left,
anchor=east, anchor=east,
text=white, text=white,
rounded corners=1mm, rounded corners=1mm,
font=\bfseries, font=\bfseries,
xshift=-5mm, xshift=-5mm,
yshift=1mm, yshift=1mm,
inner xsep=3mm, inner xsep=3mm,
inner ysep=1.5mm inner ysep=1.5mm
} }
} }
} }
% -------------------- % % -------------------- %
@@ -268,16 +265,16 @@
% Add a color shade (similar to \fhlc, but nicer boxes) % Add a color shade (similar to \fhlc, but nicer boxes)
\newcommand{\background}[3]{\tcbox[on line, \newcommand{\background}[3]{\tcbox[on line,
boxsep=2pt, boxsep=2pt,
left=0pt, left=0pt,
right=0pt, right=0pt,
top=0pt, top=0pt,
bottom=0pt, bottom=0pt,
colframe=white, colframe=white,
frame empty, frame empty,
colback=#1!#2!white, colback=#1!#2!white,
highlight math style={enhanced} highlight math style={enhanced}
] {\textbf{#3}}} ] {\textbf{#3}}}
% Abstraction of background, where the brightness is set to 20% % Abstraction of background, where the brightness is set to 20%
\newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}} \newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}}
@@ -295,12 +292,6 @@
% Add a colorbox around your text with the color specified. Text is bold and underlined % Add a colorbox around your text with the color specified. Text is bold and underlined
\newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}} \newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}}
% 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}}
% Spacing (horizontal) % Spacing (horizontal)
\newcommand{\smallhspace}{\hspace{2mm}} \newcommand{\smallhspace}{\hspace{2mm}}
\newcommand{\mediumhspace}{\hspace{5mm}} \newcommand{\mediumhspace}{\hspace{5mm}}
@@ -312,14 +303,14 @@
% Print a table of contents as a tcolorbox % Print a table of contents as a tcolorbox
\newcommand{\printtoc}[1]{ \newcommand{\printtoc}[1]{
\renewcommand{\cfttoctitlefont}{} \renewcommand{\cfttoctitlefont}{}
\renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}} \renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}}
\renewcommand{\contentsname}{} \renewcommand{\contentsname}{}
\begin{tcolorbox}[colback=black!5!white,colbacktitle=#1!75!black,coltitle=black,enhanced,attach boxed title to top center={yshift=-2mm}, \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] title={\Large \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable]
\hspace{1cm} \hspace{1cm}
\tableofcontents \tableofcontents
\end{tcolorbox} \end{tcolorbox}
} }
%▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ %▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
@@ -391,31 +382,15 @@
% BB shortcuts (for number spaces, etc) % BB shortcuts (for number spaces, etc)
\newcommand{\A}{\mathbb{A}}
\newcommand{\B}{\mathbb{B}}
\newcommand{\C}{\mathbb{C}} \newcommand{\C}{\mathbb{C}}
\newcommand{\D}{\mathbb{D}} \newcommand{\D}{\mathbb{D}}
\newcommand{\E}{\mathbb{E}} \newcommand{\E}{\mathbb{E}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\G}{\mathbb{G}}
\renewcommand{\H}{\mathbb{H}}
\newcommand{\I}{\mathbb{I}} \newcommand{\I}{\mathbb{I}}
\newcommand{\J}{\mathbb{J}} \newcommand{\J}{\mathbb{J}}
\newcommand{\K}{\mathbb{K}}
\renewcommand{\L}{\mathbb{L}}
\newcommand{\M}{\mathbb{M}}
\newcommand{\N}{\mathbb{N}} \newcommand{\N}{\mathbb{N}}
\renewcommand{\O}{\mathbb{O}}
\renewcommand{\P}{\mathbb{P}}
\newcommand{\Q}{\mathbb{Q}} \newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}} \newcommand{\R}{\mathbb{R}}
\renewcommand{\S}{\mathbb{S}}
\newcommand{\T}{\mathbb{T}}
\newcommand{\U}{\mathbb{U}}
\newcommand{\V}{\mathbb{V}} \newcommand{\V}{\mathbb{V}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\X}{\mathbb{X}}
\newcommand{\Y}{\mathbb{Y}}
\newcommand{\Z}{\mathbb{Z}} \newcommand{\Z}{\mathbb{Z}}
% Caligraphic % Caligraphic
@@ -486,13 +461,13 @@
% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ % ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀
% Extra imports % Extra imports
\usepackage{stmaryrd} \RequirePackage{stmaryrd}
\usepackage{algorithm} \RequirePackage{algorithm}
\usepackage{algpseudocodex} \RequirePackage{algpseudocodex}
\usepackage{setspace} \RequirePackage{setspace}
\usepackage{verbatim} \RequirePackage{verbatim}
\usepackage{turnstile} \RequirePackage{turnstile}
\usepackage{forloop} \RequirePackage{forloop}
\newcommand{\Indent}{\hspace{\algorithmicindent}} \newcommand{\Indent}{\hspace{\algorithmicindent}}
@@ -525,8 +500,8 @@
% For using index package % For using index package
\newcommand{\prepareIndex}{ \newcommand{\prepareIndex}{
\usepackage[T1]{fontenc} \RequirePackage[T1]{fontenc}
\usepackage{imakeidx} \RequirePackage{imakeidx}
\makeindex \makeindex
} }
@@ -542,8 +517,8 @@
% ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌ % ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌
% ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀ % ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀
\usepackage{xstring} \RequirePackage{xstring}
\usepackage{etoolbox} \RequirePackage{etoolbox}
% tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters % tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters
\newcounter{lemma}[section] \newcounter{lemma}[section]
\newcounter{definition}[section] \newcounter{definition}[section]
@@ -989,36 +964,40 @@
\newtcolorbox{forms}[2][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2}, \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} overlay={\node[overlaystyle,draw=red!75!black,fill=red!75!black] at (frame.north east) {\large \translate{Forms}{Formen}};},#1}
% _____ _ _ % ___ _ _____ _ _
% (_ _) ( ) (_ ) % ( _ \ _( ) (_ _) ( ) ( )
% | | _ _| |_ | | __ ___ % | (_) )_) |_ | | __ \ \/ /
% | | / _ ) _ \ | | / __ \ __) % | _ (| | _ \ | | / __ \ ) (
% | | ( (_| | |_) )| |( ___/__ \ % | (_) ) | |_) ) | | ( ___// /\ \
% (_) \__ _)_ __/(___)\____)____/ % (____/(_)_ __/ (_) \____)_) (_)
% Configs if you want to use BibTeX. Not included in any default configs.
\usepackage{booktabs} \newcommand{\setupBibtex}[1]{
\usepackage{biblatex}
% Create new table. #1 Layout, #2 title row \usepackage[nottoc, numbib]{tocbibind}
\newenvironment{tables}[2]{ \addbibresource{#1}
\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 \newcommand{\printbib}{
\newenvironment{fullTable}[3]{ \addcontentsline{toc}{section}{\translate{Sources}{Quellen}}
\edef\tableCaption{#3} \printbibliography[title=\translate{Sources}{Quellen}]
\begin{table}[h!] }
\begin{tables}{#1}{#2}
}{
\end{tables} %░▒█▀▀█░█░░▄▀▀▄░█▀▀░█▀▀░█▀▀▄░█▀▀▄░█░░█
\caption{\tableCaption} %░▒█░▄▄░█░░█░░█░▀▀▄░▀▀▄░█▄▄█░█▄▄▀░█▄▄█
\end{table} %░▒█▄▄▀░▀▀░░▀▀░░▀▀▀░▀▀▀░▀░░▀░▀░▀▀░▄▄▄▀
% Add glossaries functionality
\newcommand{\setupGlossary}{
\usepackage[nonumberlist, toc]{glossaries}
\usepackage[nottoc, numbib]{tocbibind}
\makenoidxglossaries
}
\newcommand{\printGlossary}{
\glsaddall
\printnoidxglossaries
} }

Binary file not shown.

View File

@@ -1,6 +1,8 @@
\documentclass{article} \documentclass{article}
\input{~/projects/latex/dist/full.tex} \newcommand{\dir}{~/projects/latex}
\input{\dir/include.tex}
\load{full}
\setup{Docs - \LaTeX \hspace{0mm} helpers} \setup{Docs - \LaTeX \hspace{0mm} helpers}
\setLang{en} \setLang{en}
@@ -33,9 +35,9 @@ The timecomplexity commands have been updated to require math environment. You c
and \verb|/\\text{\\tc\([olt]\){\(.*\)}}/\\tc\1{\2}/g| and \verb|/\\text{\\tc\([olt]\){\(.*\)}}/\\tc\1{\2}/g|
\subsection{Labels \& Environments} \subsection{Labels \& Environments}
The counter environments can now be referenced (see \ref{sec:counters}). The counter environments can now be referenced (see \ref{sec:counters}).
Due to the new requirements set out by that addition, it is now no longer possible to manually update the counters using Due to the new requirements set out by that addition, it is now no longer possible to manually update the counters using
\verb|\setcounter|. \verb|\setcounter|.
Use the below regex to replace all occurrences of \verb|\setcounter| with the new format. Use the below regex to replace all occurrences of \verb|\setcounter| with the new format.
Please note that this will overwrite \textit{all} occurrences of \verb|\setcounter| with the specific old format with \verb|\setLabelNumber|: Please note that this will overwrite \textit{all} occurrences of \verb|\setcounter| with the specific old format with \verb|\setLabelNumber|:

View File

@@ -5,7 +5,9 @@ You can type \texttt{latex-prepare} and press tab, if you have installed the VSC
\begin{minted}{latex} \begin{minted}{latex}
\documentclass{article} \documentclass{article}
\input{~/projects/latex/dist/recommended.tex} % TODO: Change here your inclusion level and path \newcommand{\dir}{~/path/to/helper} % TODO: Change your path here! No trailing slashes!
\input{\dir/include.tex}
\load{recommended} % TODO: Change the inclusion level (if necessary), see below
\setup{Type your title here} \setup{Type your title here}
@@ -17,19 +19,15 @@ Type your \LaTeX here
\end{document} \end{document}
\end{minted} \end{minted}
On the line with the TODO, you can change the import path, as well as scope. The \verb|\load| command takes one parameter, which can be one of the following:
Simply replace the ``recommended'' with any of the below.
\begin{itemize} \begin{itemize}
\item \texttt{minimal} Just the core styling and core functionality. \item \texttt{minimal} Just the core styling and core functionality.
\item \texttt{most} Includes Math, CS, Language and all styling. \item \texttt{most} Includes Math, CS, Language and all styling.
\item \texttt{recommended} The recommended setup. Includes BibTeX in addition to what is in most \item \texttt{recommended} The recommended setup. Includes BibTeX in addition to what is in most
\item \texttt{full} If you want to also include glossaries or code with highlighting \item \texttt{all} If you want to also include glossaries or code with highlighting
\item \texttt{letter} If you want to typeset a letter (see \ref{sec:letters}) \item \texttt{letter} If you want to typeset a letter (see \ref{sec:letters})
\end{itemize} \end{itemize}
If you are using the old import style, you can use the \verb|\load| command with these options
\subsection{Configuration} \subsection{Configuration}
You can set a global config in config file in helper files directory. The file is located at You can set a global config in config file in helper files directory. The file is located at

View File

@@ -1,6 +1,3 @@
% ┌ ┐
% │ Minted │
% └ ┘
\usepackage{minted} \usepackage{minted}
\usepackage{fancyvrb} \usepackage{fancyvrb}

View File

@@ -1,42 +1,3 @@
% Loader % Loader
\ClassWarning{janishutz-helpers}{Using legacy loading method. Please see the docs for updating} \usepackage{currfile}
\newcommand{\load}[1]{ \usepackage{\currfileabsdir janishutz-helpers}
\edef\recommended{recommended}
\edef\minimal{minimal}
\edef\most{most}
\edef\full{full}
\edef\letters{letter}
\edef\temp{#1}
\ifx \temp\recommended
\typeout{[CustomLaTeXHelperLoader]: Loading config recommended}
\input{\dir/scopes/recommended.tex}
\loadRecommended
\else
\ifx \temp\minimal
\typeout{[CustomLaTeXHelperLoader]: Loading config minimal}
\input{\dir/scopes/minimal.tex}
\loadMinimal
\else
\ifx \temp\most
\typeout{[CustomLaTeXHelperLoader]: Loading config most}
\input{\dir/scopes/most.tex}
\loadMost
\else
\ifx \temp\full
\typeout{[CustomLaTeXHelperLoader]: Loading config full}
\input{\dir/scopes/full.tex}
\loadFull
\else
\ifx \temp\letters
\typeout{[CustomLaTeXHelperLoader]: Loading config letter}
\input{\dir/scopes/minimal.tex}
\loadMinimal
\input{\dir/scopes/letter.tex}
\else
\typeout{[CustomLaTeXHelperLoader]: INVALID CONFIG SPECIFIED, NOTHING LOADED!}
\fi
\fi
\fi
\fi
\fi
}

2
janishutz-helpers.sty Normal file
View File

@@ -0,0 +1,2 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{janishutz-helpers}[2.0.0]

View File

@@ -11,36 +11,39 @@
% Imports % % Imports %
\typeout{[Core] Importing!} \typeout{[Core] Importing!}
\usepackage[table, dvipsnames]{xcolor} \RequirePackage[table, dvipsnames]{xcolor}
\usepackage{amsmath} \RequirePackage{amsmath}
\usepackage{graphicx} \RequirePackage{graphicx}
\usepackage{subcaption} \RequirePackage{subcaption}
\usepackage[export]{adjustbox} \RequirePackage[export]{adjustbox}
\usepackage[most]{tcolorbox} \RequirePackage[most]{tcolorbox}
\usepackage{cancel} \RequirePackage{cancel}
\usepackage{dsfont} \RequirePackage{dsfont}
\usepackage{amssymb} \RequirePackage{amssymb}
\usepackage{mathrsfs} \RequirePackage{mathrsfs}
\usepackage{ulem} \RequirePackage{lipsum}
\usepackage{soul} \RequirePackage{ulem}
\usepackage{parskip} \RequirePackage{soul}
\usepackage{fancyhdr} \RequirePackage{parskip}
\usepackage{lastpage} \RequirePackage{fancyhdr}
\usepackage{tocloft} \RequirePackage{lastpage}
\usepackage{wasysym} \RequirePackage{tocloft}
\usepackage{wrapfig} \RequirePackage{wasysym}
\usepackage{multicol} \RequirePackage{wrapfig}
\usepackage{ifthen} \RequirePackage{multicol}
\usepackage[hidelinks]{hyperref} \RequirePackage{ifthen}
\usepackage{enumitem} \RequirePackage[hidelinks]{hyperref}
\usepackage{gensymb} \RequirePackage{enumitem}
\usepackage{pifont} \RequirePackage{gensymb}
\RequirePackage{pifont}
% Language Switching. Currently only English and German are supported % Language Switching. Currently only English and German are supported
% See docs for how to use % See docs for how to use
\newcounter{lang} \newcounter{lang}
\typeout{Loading helpers}
% TODO: Fix this up
\newcommand{\setLang}[1]{ \newcommand{\setLang}[1]{
\edef\lang{#1} \edef\lang{#1}
\edef\en{en} \edef\en{en}
@@ -52,7 +55,7 @@
\ifx\lang\de \ifx\lang\de
\typeout{[Lang Switcher] Loading German} \typeout{[Lang Switcher] Loading German}
\setcounter{lang}{2} \setcounter{lang}{2}
\usepackage[ngerman]{babel} \input{\dir/main/lang/de}
\else \else
\typeout{[Lang Switcher] No such language!} \typeout{[Lang Switcher] No such language!}
\fi \fi
@@ -80,7 +83,7 @@
\newcommand{\setup}[1]{ \newcommand{\setup}[1]{
\typeout{[Setup] Setting up...} \typeout{[Setup] Setting up...}
\loadLang \loadLang
\usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} \RequirePackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry}
\title{\Huge \textbf{#1}} \title{\Huge \textbf{#1}}
\author{\authorTitle} \author{\authorTitle}
\makeatletter \makeatletter
@@ -111,7 +114,7 @@
% Set up the latex document, only configuring the author, title and page size % Set up the latex document, only configuring the author, title and page size
\newcommand{\setupBarebones}[1]{ \newcommand{\setupBarebones}[1]{
\loadLang \loadLang
\usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} \RequirePackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry}
\title{\Huge \textbf{#1}} \title{\Huge \textbf{#1}}
\author{\authorTitle} \author{\authorTitle}
} }
@@ -119,7 +122,7 @@
% Set up the latex document for exam summaries (Extra wide body, small margins, no header) % Set up the latex document for exam summaries (Extra wide body, small margins, no header)
\newcommand{\setupCheatSheet}[1]{ \newcommand{\setupCheatSheet}[1]{
\loadLang \loadLang
\usepackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} \RequirePackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry}
\title{\Huge \textbf{#1}} \title{\Huge \textbf{#1}}
\author{\authorTitle} \author{\authorTitle}
} }

View File

@@ -4,13 +4,13 @@
% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ % ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀
% Extra imports % Extra imports
\usepackage{stmaryrd} \RequirePackage{stmaryrd}
\usepackage{algorithm} \RequirePackage{algorithm}
\usepackage{algpseudocodex} \RequirePackage{algpseudocodex}
\usepackage{setspace} \RequirePackage{setspace}
\usepackage{verbatim} \RequirePackage{verbatim}
\usepackage{turnstile} \RequirePackage{turnstile}
\usepackage{forloop} \RequirePackage{forloop}
\newcommand{\Indent}{\hspace{\algorithmicindent}} \newcommand{\Indent}{\hspace{\algorithmicindent}}

View File

@@ -10,8 +10,8 @@
% For using index package % For using index package
\newcommand{\prepareIndex}{ \newcommand{\prepareIndex}{
\usepackage[T1]{fontenc} \RequirePackage[T1]{fontenc}
\usepackage{imakeidx} \RequirePackage{imakeidx}
\makeindex \makeindex
} }

1
main/lang/de.tex Normal file
View File

@@ -0,0 +1 @@
\RequirePackage[ngerman]{babel}

View File

@@ -9,31 +9,15 @@
% BB shortcuts (for number spaces, etc) % BB shortcuts (for number spaces, etc)
\newcommand{\A}{\mathbb{A}}
\newcommand{\B}{\mathbb{B}}
\newcommand{\C}{\mathbb{C}} \newcommand{\C}{\mathbb{C}}
\newcommand{\D}{\mathbb{D}} \newcommand{\D}{\mathbb{D}}
\newcommand{\E}{\mathbb{E}} \newcommand{\E}{\mathbb{E}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\G}{\mathbb{G}}
\renewcommand{\H}{\mathbb{H}}
\newcommand{\I}{\mathbb{I}} \newcommand{\I}{\mathbb{I}}
\newcommand{\J}{\mathbb{J}} \newcommand{\J}{\mathbb{J}}
\newcommand{\K}{\mathbb{K}}
\renewcommand{\L}{\mathbb{L}}
\newcommand{\M}{\mathbb{M}}
\newcommand{\N}{\mathbb{N}} \newcommand{\N}{\mathbb{N}}
\renewcommand{\O}{\mathbb{O}}
\renewcommand{\P}{\mathbb{P}}
\newcommand{\Q}{\mathbb{Q}} \newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}} \newcommand{\R}{\mathbb{R}}
\renewcommand{\S}{\mathbb{S}}
\newcommand{\T}{\mathbb{T}}
\newcommand{\U}{\mathbb{U}}
\newcommand{\V}{\mathbb{V}} \newcommand{\V}{\mathbb{V}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\X}{\mathbb{X}}
\newcommand{\Y}{\mathbb{Y}}
\newcommand{\Z}{\mathbb{Z}} \newcommand{\Z}{\mathbb{Z}}
% Caligraphic % Caligraphic

View File

@@ -5,8 +5,8 @@
% ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌ % ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█▄▄▌▐█•█▌
% ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀ % ·▀▀▀ ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ ▀▀▀ .▀ ▀
\usepackage{xstring} \RequirePackage{xstring}
\usepackage{etoolbox} \RequirePackage{etoolbox}
% tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters % tcolorbox and other stylistic elements (i.e. inline versions of them) that have counters
\newcounter{lemma}[section] \newcounter{lemma}[section]
\newcounter{definition}[section] \newcounter{definition}[section]

View File

@@ -10,35 +10,35 @@
% Global style configs for tcolorbox (to reduce bloat) % Global style configs for tcolorbox (to reduce bloat)
\newcommand{\usetcolorboxes}{ \newcommand{\usetcolorboxes}{
\tcbset{ \tcbset{
mainboxstyle/.style={ mainboxstyle/.style={
arc=3mm, arc=3mm,
colback=red!5!white, colback=red!5!white,
colframe=red!75!black, colframe=red!75!black,
colbacktitle=red!75!black, colbacktitle=red!75!black,
fonttitle=\bfseries, fonttitle=\bfseries,
enhanced, enhanced,
attach boxed title to top left={yshift=-2mm,xshift=5mm}, attach boxed title to top left={yshift=-2mm,xshift=5mm},
breakable, breakable,
top=0.4cm, top=0.4cm,
} }
} }
\tikzset{ \tikzset{
overlaystyle/.style={ overlaystyle/.style={
draw=red!75!black, draw=red!75!black,
thick, thick,
fill=red!75!black, fill=red!75!black,
left, left,
anchor=east, anchor=east,
text=white, text=white,
rounded corners=1mm, rounded corners=1mm,
font=\bfseries, font=\bfseries,
xshift=-5mm, xshift=-5mm,
yshift=1mm, yshift=1mm,
inner xsep=3mm, inner xsep=3mm,
inner ysep=1.5mm inner ysep=1.5mm
} }
} }
} }
% -------------------- % % -------------------- %
@@ -65,16 +65,16 @@
% Add a color shade (similar to \fhlc, but nicer boxes) % Add a color shade (similar to \fhlc, but nicer boxes)
\newcommand{\background}[3]{\tcbox[on line, \newcommand{\background}[3]{\tcbox[on line,
boxsep=2pt, boxsep=2pt,
left=0pt, left=0pt,
right=0pt, right=0pt,
top=0pt, top=0pt,
bottom=0pt, bottom=0pt,
colframe=white, colframe=white,
frame empty, frame empty,
colback=#1!#2!white, colback=#1!#2!white,
highlight math style={enhanced} highlight math style={enhanced}
] {\textbf{#3}}} ] {\textbf{#3}}}
% Abstraction of background, where the brightness is set to 20% % Abstraction of background, where the brightness is set to 20%
\newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}} \newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}}
@@ -92,12 +92,6 @@
% Add a colorbox around your text with the color specified. Text is bold and underlined % Add a colorbox around your text with the color specified. Text is bold and underlined
\newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}} \newcommand{\fhlc}[2]{\textbf{\underline{\colorbox{#1}{#2}}}}
% 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}}
% Spacing (horizontal) % Spacing (horizontal)
\newcommand{\smallhspace}{\hspace{2mm}} \newcommand{\smallhspace}{\hspace{2mm}}
\newcommand{\mediumhspace}{\hspace{5mm}} \newcommand{\mediumhspace}{\hspace{5mm}}
@@ -109,12 +103,12 @@
% Print a table of contents as a tcolorbox % Print a table of contents as a tcolorbox
\newcommand{\printtoc}[1]{ \newcommand{\printtoc}[1]{
\renewcommand{\cfttoctitlefont}{} \renewcommand{\cfttoctitlefont}{}
\renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}} \renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}}
\renewcommand{\contentsname}{} \renewcommand{\contentsname}{}
\begin{tcolorbox}[colback=black!5!white,colbacktitle=#1!75!black,coltitle=black,enhanced,attach boxed title to top center={yshift=-2mm}, \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] title={\Large \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable]
\hspace{1cm} \hspace{1cm}
\tableofcontents \tableofcontents
\end{tcolorbox} \end{tcolorbox}
} }

View File

@@ -6,7 +6,8 @@
% (_) \__ _)_ __/(___)\____)____/ % (_) \__ _)_ __/(___)\____)____/
\usepackage{booktabs} \RequirePackage{booktabs}
\RequirePackage{tabulary}
% Create new table. #1 Layout, #2 title row % Create new table. #1 Layout, #2 title row
\newenvironment{tables}[2]{ \newenvironment{tables}[2]{

View File

@@ -1,5 +0,0 @@
\newcommand{\loadFull}{
\input{\dir/scopes/recommended.tex}
\loadRecommended
\input{\dir/extra/minted.tex}
}

View File

@@ -1,7 +0,0 @@
\newcommand{\loadMinimal}{
\typeout{[CustomLaTeXHelperLoader]: Loaded minimal}
\input{\dir/main/core.tex}
\input{\dir/config/config.tex}
\input{\dir/main/style/style.tex}
\input{\dir/main/style/common.tex}
}

View File

@@ -1,13 +0,0 @@
\newcommand{\loadMost}{
\typeout{[CustomLaTeXHelperLoader]: Loaded most}
\input{\dir/scopes/minimal.tex}
\loadMinimal
\input{\dir/main/math.tex}
\input{\dir/main/cs.tex}
\input{\dir/main/index.tex}
\input{\dir/main/tables.tex}
\input{\dir/main/style/counters.tex}
\input{\dir/main/style/cs.tex}
\input{\dir/main/style/math.tex}
\input{\dir/main/style/language.tex}
}

View File

@@ -1,7 +0,0 @@
\newcommand{\loadRecommended}{
\typeout{[CustomLaTeXHelperLoader]: Loaded recommended}
\input{\dir/scopes/most.tex}
\loadMost
\input{\dir/extra/bib.tex}
\input{\dir/extra/glossary.tex}
}

1
setup.sh Normal file
View File

@@ -0,0 +1 @@
# TODO: Make this script extend tex path

View File

@@ -3,7 +3,9 @@
"prefix": "latex-prepare", "prefix": "latex-prepare",
"body": [ "body": [
"\\documentclass{article}\n", "\\documentclass{article}\n",
"\\input{~/projects/latex/dist/recommended.tex}\n", "\\newcommand{\\dir}{~/projects/latex} % IMPORTANT: No trailing slashes!",
"\\input{\\dir/include.tex}",
"\\load{recommended}\n",
"\\setup{$1}\n", "\\setup{$1}\n",
"\\begin{document}", "\\begin{document}",
"\\startDocument", "\\startDocument",
@@ -428,7 +430,9 @@
"prefix": "latex-letter", "prefix": "latex-letter",
"body": [ "body": [
"\\documentclass[12pt,a4paper]{scrlttr2}\n", "\\documentclass[12pt,a4paper]{scrlttr2}\n",
"\\input{~/projects/latex/dist/letter.tex}\n", "\\newcommand{\\dir}{~/projects/latex} % IMPORTANT: No trailing slashes!",
"\\input{\\dir/include.tex}",
"\\load{letter}\n",
"% Subject", "% Subject",
"\\setkomavar{subject}{$1}", "\\setkomavar{subject}{$1}",
"\\begin{document}\\raggedright", "\\begin{document}\\raggedright",