From 36ced5e37a5e25080b146e800f65c348c8537925 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Thu, 19 Feb 2026 17:21:10 +0100 Subject: [PATCH] Some fixes --- build/build.py | 4 +- install.sh | 7 +- janishutz-helpers.sty | 787 ++++++++++++++++++++++++++++++++++++++++-- janishutz-helpers.tex | 530 ++++++++++++++-------------- uninstall.sh | 1 + 5 files changed, 1034 insertions(+), 295 deletions(-) mode change 100644 => 100755 uninstall.sh diff --git a/build/build.py b/build/build.py index 520a60f..5c4d544 100644 --- a/build/build.py +++ b/build/build.py @@ -27,7 +27,9 @@ def load_all_files_of_array(dirname: str, files: List[str]): return data -output = load_all_files_of_array("../src/", ["header.sty", "core.sty"]) +output = load_all_files_of_array("../src/", ["header.sty"]) +output += f"\\ProvidesPackage{{janishutz-helpers}}[{datetime.datetime.now().date().isoformat()} v{version}]\n\n" +output += load_all_files_of_array("../src/", ["core.sty"]) output += load_all_files_of_array("../src/config/", os.listdir("../src/config/")) output += load_all_files_of_array("../src/", ["style.sty"]) output += load_all_files_of_array("../src/core/", os.listdir("../src/core/")) diff --git a/install.sh b/install.sh index 747a778..294a8db 100755 --- a/install.sh +++ b/install.sh @@ -15,8 +15,11 @@ if [[ "$loc" == "l" ]]; then mkdir -p $TEXMFHOME/tex/latex/janishutz-helpers cp ./janishutz-helpers.sty $TEXMFHOME/tex/latex/janishutz-helpers/ else - sudo mkdir -p /usr/share/texmf/tex/latex/janishutz-helpers - sudo cp ./janishutz-helpers.sty /usr/share/texmf/tex/latex/janishutz-helpers/ + # sudo mkdir -p /usr/share/texmf/tex/latex/janishutz-helpers + # sudo cp ./janishutz-helpers.sty /usr/share/texmf/tex/latex/janishutz-helpers/ + sudo mkdir -p /usr/share/texmf-dist/tex/latex/janishutz-helpers/ + sudo cp ./janishutz-helpers.sty /usr/share/texmf-dist/tex/latex/janishutz-helpers/ + sudo chmod -R 777 /usr/share/texmf-dist/tex/latex/janishutz-helpers echo "Updating file database" sudo texhash fi diff --git a/janishutz-helpers.sty b/janishutz-helpers.sty index a1e89a6..01be5fc 100644 --- a/janishutz-helpers.sty +++ b/janishutz-helpers.sty @@ -207,35 +207,6 @@ \newcommand{\propertiesNamingDE}{Eigenschaften} -% ┌ ┐ -% │ Translation │ -% └ ┘ -\newcommand{\translate}[2]{% - \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2} -} -\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 }} - - -\DeclareOption{de}{ - \RequirePackage[ngerman]{babel} - \renewcommand{\currentLanguage}{de} -} -\ProcessOptions - - % ┌ ┐ % │ STYLE: Globals │ % └ ┘ @@ -351,3 +322,761 @@ } +% ┌ ┐ +% │ Math │ +% └ ┘ + +% BB shortcuts (for number spaces, etc) +\newcommand{\A}{\mathbb{A}} +\newcommand{\B}{\mathbb{B}} +\newcommand{\C}{\mathbb{C}} +\newcommand{\D}{\mathbb{D}} +\newcommand{\E}{\mathbb{E}} +\newcommand{\F}{\mathbb{F}} +\newcommand{\G}{\mathbb{G}} +\renewcommand{\H}{\mathbb{H}} +\newcommand{\I}{\mathbb{I}} +\newcommand{\J}{\mathbb{J}} +\newcommand{\K}{\mathbb{K}} +\renewcommand{\L}{\mathbb{L}} +\newcommand{\M}{\mathbb{M}} +\newcommand{\N}{\mathbb{N}} +\renewcommand{\O}{\mathbb{O}} +\renewcommand{\P}{\mathbb{P}} +\newcommand{\Q}{\mathbb{Q}} +\newcommand{\R}{\mathbb{R}} +\renewcommand{\S}{\mathbb{S}} +\newcommand{\T}{\mathbb{T}} +\newcommand{\U}{\mathbb{U}} +\newcommand{\V}{\mathbb{V}} +\newcommand{\W}{\mathbb{W}} +\newcommand{\X}{\mathbb{X}} +\newcommand{\Y}{\mathbb{Y}} +\newcommand{\Z}{\mathbb{Z}} + +% Caligraphic +\newcommand{\cA}{\mathcal{A}} +\newcommand{\cB}{\mathcal{B}} +\newcommand{\cC}{\mathcal{C}} +\newcommand{\cD}{\mathcal{D}} +\newcommand{\cE}{\mathcal{E}} +\newcommand{\cF}{\mathcal{F}} +\newcommand{\cG}{\mathcal{G}} +\newcommand{\cH}{\mathcal{H}} +\newcommand{\cI}{\mathcal{I}} +\newcommand{\cJ}{\mathcal{J}} +\newcommand{\cK}{\mathcal{K}} +\newcommand{\cL}{\mathcal{L}} +\newcommand{\cM}{\mathcal{M}} +\newcommand{\cN}{\mathcal{N}} +\newcommand{\cO}{\mathcal{O}} +\newcommand{\cP}{\mathcal{P}} +\newcommand{\cQ}{\mathcal{Q}} +\newcommand{\cR}{\mathcal{R}} +\newcommand{\cS}{\mathcal{S}} +\newcommand{\cT}{\mathcal{T}} +\newcommand{\cU}{\mathcal{U}} +\newcommand{\cV}{\mathcal{V}} +\newcommand{\cW}{\mathcal{W}} +\newcommand{\cX}{\mathcal{X}} +\newcommand{\cY}{\mathcal{Y}} +\newcommand{\cZ}{\mathcal{Z}} + +% other useful shortcuts +\newcommand{\elementstack}[2]{\genfrac{}{}{0pt}{}{#1}{#2}} +\newcommand{\8}{\infty} +\newcommand{\cond}{\text{cond}} +\newcommand{\argmin}[1]{\underset{#1}{\text{argmin}}} +\newcommand{\dx}{\text{ d}} +\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor} +\newcommand{\ceil}[1]{\left\lceil #1 \right\rceil} +\newcommand{\hastoeq}{\overset{!}{=}} +\newcommand{\Leftrightarrowequiv}{\overset{\cdot}{\Leftrightarrow}} +\newcommand{\Longleftrightarrowequiv}{\overset{\cdot}{\Longleftrightarrow}} +\newcommand{\Rightarrowequiv}{\overset{\cdot}{\Rightarrow}} +\newcommand{\Leftarrowequiv}{\overset{\cdot}{\Leftarrow}} +\newcommand{\defAs}{\overset{\text{def}}{=}} +\newcommand{\der}[1]{\frac{\mbox{d}}{\mbox{d}#1}} +\newcommand{\dern}[2]{\frac{\mbox{d}^{#2}}{\mbox{d}^{#2}#1}} +\newcommand{\parder}[1]{\frac{\partial}{\partial #1}} +\newcommand{\pardern}[2]{\frac{\partial^{#2}}{\partial^{#2} #1}} +\newcommand{\defEquiv}{\overset{\text{def}}{\Leftrightarrow}} +\newcommand{\defImplies}{\overset{\text{def}}{\Rightarrow}} +\newcommand{\divides}{\hspace{0.25em}|\hspace{0.25em}} +\newcommand{\lcm}{\text{lcm}} +\newcommand{\limit}[2]{\underset{#1 \rightarrow #2}{\lim}} +\newcommand{\seq}[1]{(#1_n)_{n \geq 1}} +\newcommand{\ser}[2]{\sum_{k = 1}^{#2} #1_k} +\newcommand{\limni}{\limit{n}{\infty}} +\newcommand{\limnz}{\limit{n}{0}} +\newcommand{\limxz}{\limit{x_0}{0}} +\newcommand{\limhz}{\limit{h}{0}} +\newcommand{\liminfni}{\liminf_{n \rightarrow \infty}} +\newcommand{\limsupni}{\limsup_{n \rightarrow \infty}} + +\DeclareMathOperator\arctanh{arctanh} +\DeclareMathOperator\arccosh{arccosh} +\DeclareMathOperator\arcsinh{arcsinh} + + +% ┌ ┐ +% │ Index │ +% └ ┘ + +% 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} + + + +% ┌ ┐ +% │ 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} +} + + +% ┌ ┐ +% │ Translation │ +% └ ┘ +\newcommand{\translate}[2]{% + \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2} +} +\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 }} + + +% ┌ ┐ +% │ 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...} + \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}} + } +} + +% 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} +} + + +% TODO: Use landscape and columns for new version +% Set up the latex document for exam summaries (Extra wide body, small margins, no header) +\newcommand{\setupCheatSheet}[1]{ + \loadLang + \RequirePackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + + +% ┌ ┐ +% │ Document start │ +% └ ┘ +% Start document command (required) +\newcommand{\startDocument}{ + \maketitle + \pagestyle{fancy} + \thispagestyle{fancy} +} + + + +% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ +% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ +% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ + +% Extra imports +\RequirePackage{stmaryrd} +\RequirePackage{algorithm} +\RequirePackage{algpseudocodex} +\RequirePackage{setspace} +\RequirePackage{verbatim} +\RequirePackage{turnstile} +\RequirePackage{forloop} + +\newcommand{\Indent}{\hspace{\algorithmicindent}} + +\newcommand{\tc}[1]{\tco{#1}} +\newcommand{\tct}[1]{\Theta\left(#1\right)} +\newcommand{\tco}[1]{\mathcal{O}\left(#1\right)} +\newcommand{\tcl}[1]{\Omega\left(#1\right)} +\newcommand{\wordbool}{(\Sigma_{\text{bool}})^*} +\newcommand{\words}[1]{(\Sigma_{\text{#1}})^*} +\newcommand{\word}{\Sigma^*} +\newcommand{\wordm}[1]{\Sigma_{\text{#1}}^*} +\newcommand{\alphabets}[1]{\Sigma_{\text{#1}}} +\newcommand{\alphabetbool}{\Sigma_{\text{bool}}} +\newcommand{\tR}{\text{R}} +\newcommand{\tC}{\text{C}} +\newcommand{\tN}{\text{N}} +\newcommand{\bigvdash}[2]{\sststile{#1}{#2}} +\newcommand{\class}{\text{\tr{Cl}{Kl}}} + + +% ┌ ┐ +% │ STYLE: Math │ +% └ ┘ + +% Add shortcuts to commonly used commands +\newcommand{\vect}[1]{\overrightarrow{#1}} +\renewcommand{\hat}[1]{\widehat{#1}} +\renewcommand{\tilde}[1]{\widetilde{#1}} +\newcommand{\proven}{$\hspace{17cm}\square$} + + +% ┌ ┐ +% │ STYLE: Common tcolorboxes │ +% └ ┘ +% TODO: Update colors + +\newtcolorbox{recall}[2][]{mainboxstyle,colback=recallcolor!5!white,colframe=recallcolor!75!black,colbacktitle=recallcolor!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=recallcolor!75!black,,fill=recallcolor!75!black] at (frame.north east) {\large \translate{Recall }{Repetition }};},#1} + +\newtcolorbox{remarks}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Remarks }{Bemerkungen }};},#1} + +\newtcolorbox{guides}[3][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=red!75!black,,fill=red!75!black] at (frame.north east) {\large #3};},#1} + + +\newtcolorbox{properties}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Properties }{Eigenschaften }};},#1} + +\newtcolorbox{restrictions}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Restrictions }{Einschränkungen }};},#1} + +\newtcolorbox{limitations}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Limitations }{Limitierungen }};},#1} + +\newtcolorbox{intuition}[2][]{mainboxstyle,colback=Emerald!5!white,colframe=Emerald!75!black,colbacktitle=Emerald!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Emerald!75!black,,fill=Emerald!75!black] at (frame.north east) {\large Intuition};},#1} + +\newcommand{\inlineintuition}{\bg{Emerald}{Intuition:}} + + +% Terms and notation +\newtcolorbox{terms}[2][]{mainboxstyle,colback=orange!5!white,colframe=orange!75!black,colbacktitle=orange!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=orange!75!black,,fill=orange!75!black] at (frame.north east) {\large \translate{Terms }{Begriffe }};},#1} + +\newtcolorbox{notation}[2][]{mainboxstyle,colback=Peach!5!white,colframe=Peach!75!black,colbacktitle=Peach!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Peach!75!black,,fill=Peach!75!black] at (frame.north east) {\large Notation};},#1} + + +\newtcolorbox{usage}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Usage }{Nutzung }};},#1} + + +% Task +\newtcolorbox{task}[2][]{mainboxstyle,colback=gray!5!white,colframe=gray!75!black,colbacktitle=gray!75!black,title={\large #2},overlay={\node[overlaystyle,draw=gray!75!black,fill=gray!75!black] at (frame.north east) {\large \translate{Task}{Aufgabe}};},#1} + + +% Proof +\newtcolorbox{proof}[2][]{mainboxstyle,colback=magenta!5!white,colframe=magenta!75!black,colbacktitle=magenta!75!black,title={\large #2},overlay={\node[overlaystyle,draw=magenta!75!black,fill=magenta!75!black] at (frame.north east) {\large \translate{Proof}{Beweis}};},#1} + + +% General +\newtcolorbox{general}[4][]{mainboxstyle,colback=#4!5!white,colframe=#4!75!black,colbacktitle=#4!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=#4!75!black,,fill=#4!75!black] at (frame.north east) {\large #3};},#1} + +% Simple +\newtcolorbox{simplebox}[2][]{colback=#2!5!white,colframe=#2!75!black,#1} + + +% ── Label generator ───────────────────────────────────────────────── +\newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname} +\newcommand{\printCounter}[1]{\csname the#1\endcsname} + +\newcommand{\printLabel}[1]{% + \ifcsdef{#1numbering}{% Extra config present + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{ + \printCounter{#1\subsectionnumbering}% + }{ + \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}% + }{} + } +} + +% Inline environments (inline) +\newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname} +\newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname} + +\newcommand{\inline}[2][__NONAME__]{% + \ifthenelse{\equal{__NONAME__}{#1}}{% + \anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}% + }{% + \inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}% + } +} + +\newcommand{\short}[2][__NONAME__]{% + \ifthenelse{\equal{__NONAME__}{#1}}{% + \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% + }{% + \shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}% + } +} + +% ── Set the current number of a label ─────────────────────────────── +\newcommand{\setLabelNumber}[2]{% + \setcounter{#1none}{#2}% + \addtocounter{#1none}{-1}% + \setcounter{#1section}{#2}% + \addtocounter{#1section}{-1}% + \setcounter{#1subsection}{#2}% + \addtocounter{#1subsection}{-1}% + \setcounter{#1subsubsection}{#2}% + \addtocounter{#1subsubsection}{-1}% + \setcounter{#1paragraph}{#2}% + \addtocounter{#1paragraph}{-1}% +} + +\newcommand{\stepLabelNumber}[1]{% + \stepcounter{#1none}% + \stepcounter{#1section}% + \stepcounter{#1subsection}% + \stepcounter{#1subsubsection}% + \stepcounter{#1paragraph}% +} + +% ┌ ┐ +% │ Counter numbering │ +% └ ┘ +% TODO: Update +\newcommand{\preTableAndFigHook}[1]{% + \ifnum\value{numberingConfig}>1% + \ifnum\value{numberSubsections}=1% + \stepcounter{allss}% + \else + \ifnum\value{numberSubsections}=2% + \stepcounter{allsss}% + \else% + \stepcounter{all}% + \fi + \fi + \fi + \renewcommand{\thetable}{\arabic{table}} + \renewcommand{\thefigure}{\arabic{figure}} +} +\AtBeginEnvironment{table}{\preTableAndFigHook{table}} +\AtBeginEnvironment{figure}{\preTableAndFigHook{figure}} + + +\newcommand{\newsection}{ + \newpage + \newsectionNoPB +} + + +% ┌ ┐ +% │ 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} +} + + +\newcounter{definitionnone} +\newcounter{definitionsection}[section] +\renewcommand{\thedefinitionsection}{\thesection.\arabic{definitionsection}} +\newcounter{definitionsubsection}[subsection] +\renewcommand{\thedefinitionsubsection}{\thesection.\thesubsection.\arabic{definitionsubsection}} +\newcounter{definitionsubsubsection}[subsubsection] +\renewcommand{\thedefinitionsubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{definitionsubsubsection}} +\newcounter{definitionparagraph}[paragraph] +\renewcommand{\thedefinitionparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{definitionparagraph}} +\newtcolorbox{definition}[2][]{ + mainboxstyle, + colback=definitioncolor!5!white, + colframe=definitioncolor!75!black, + colbacktitle=definitioncolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=definitioncolor!75!black, + fill=definitioncolor!75!black + ] at (frame.north east) + { + \large \tr{\definitionNamingEN}{\definitionNamingDE}\printLabel{definition} + }; + }, #1 + } + +\newcounter{examplenone} +\newcounter{examplesection}[section] +\renewcommand{\theexamplesection}{\thesection.\arabic{examplesection}} +\newcounter{examplesubsection}[subsection] +\renewcommand{\theexamplesubsection}{\thesection.\thesubsection.\arabic{examplesubsection}} +\newcounter{examplesubsubsection}[subsubsection] +\renewcommand{\theexamplesubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{examplesubsubsection}} +\newcounter{exampleparagraph}[paragraph] +\renewcommand{\theexampleparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{exampleparagraph}} +\newtcolorbox{example}[2][]{ + mainboxstyle, + colback=examplecolor!5!white, + colframe=examplecolor!75!black, + colbacktitle=examplecolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=examplecolor!75!black, + fill=examplecolor!75!black + ] at (frame.north east) + { + \large \tr{\exampleNamingEN}{\exampleNamingDE}\printLabel{example} + }; + }, #1 + } + +\newcounter{theoremnone} +\newcounter{theoremsection}[section] +\renewcommand{\thetheoremsection}{\thesection.\arabic{theoremsection}} +\newcounter{theoremsubsection}[subsection] +\renewcommand{\thetheoremsubsection}{\thesection.\thesubsection.\arabic{theoremsubsection}} +\newcounter{theoremsubsubsection}[subsubsection] +\renewcommand{\thetheoremsubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{theoremsubsubsection}} +\newcounter{theoremparagraph}[paragraph] +\renewcommand{\thetheoremparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{theoremparagraph}} +\newtcolorbox{theorem}[2][]{ + mainboxstyle, + colback=theoremcolor!5!white, + colframe=theoremcolor!75!black, + colbacktitle=theoremcolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=theoremcolor!75!black, + fill=theoremcolor!75!black + ] at (frame.north east) + { + \large \tr{\theoremNamingEN}{\theoremNamingDE}\printLabel{theorem} + }; + }, #1 + } + +\newcounter{lemmanone} +\newcounter{lemmasection}[section] +\renewcommand{\thelemmasection}{\thesection.\arabic{lemmasection}} +\newcounter{lemmasubsection}[subsection] +\renewcommand{\thelemmasubsection}{\thesection.\thesubsection.\arabic{lemmasubsection}} +\newcounter{lemmasubsubsection}[subsubsection] +\renewcommand{\thelemmasubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{lemmasubsubsection}} +\newcounter{lemmaparagraph}[paragraph] +\renewcommand{\thelemmaparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{lemmaparagraph}} +\newtcolorbox{lemma}[2][]{ + mainboxstyle, + colback=lemmacolor!5!white, + colframe=lemmacolor!75!black, + colbacktitle=lemmacolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=lemmacolor!75!black, + fill=lemmacolor!75!black + ] at (frame.north east) + { + \large \tr{\lemmaNamingEN}{\lemmaNamingDE}\printLabel{lemma} + }; + }, #1 + } + +\newcounter{corollarynone} +\newcounter{corollarysection}[section] +\renewcommand{\thecorollarysection}{\thesection.\arabic{corollarysection}} +\newcounter{corollarysubsection}[subsection] +\renewcommand{\thecorollarysubsection}{\thesection.\thesubsection.\arabic{corollarysubsection}} +\newcounter{corollarysubsubsection}[subsubsection] +\renewcommand{\thecorollarysubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{corollarysubsubsection}} +\newcounter{corollaryparagraph}[paragraph] +\renewcommand{\thecorollaryparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{corollaryparagraph}} +\newtcolorbox{corollary}[2][]{ + mainboxstyle, + colback=corollarycolor!5!white, + colframe=corollarycolor!75!black, + colbacktitle=corollarycolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=corollarycolor!75!black, + fill=corollarycolor!75!black + ] at (frame.north east) + { + \large \tr{\corollaryNamingEN}{\corollaryNamingDE}\printLabel{corollary} + }; + }, #1 + } + +\newcounter{propositionnone} +\newcounter{propositionsection}[section] +\renewcommand{\thepropositionsection}{\thesection.\arabic{propositionsection}} +\newcounter{propositionsubsection}[subsection] +\renewcommand{\thepropositionsubsection}{\thesection.\thesubsection.\arabic{propositionsubsection}} +\newcounter{propositionsubsubsection}[subsubsection] +\renewcommand{\thepropositionsubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{propositionsubsubsection}} +\newcounter{propositionparagraph}[paragraph] +\renewcommand{\thepropositionparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{propositionparagraph}} +\newtcolorbox{proposition}[2][]{ + mainboxstyle, + colback=propositioncolor!5!white, + colframe=propositioncolor!75!black, + colbacktitle=propositioncolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=propositioncolor!75!black, + fill=propositioncolor!75!black + ] at (frame.north east) + { + \large \tr{\propositionNamingEN}{\propositionNamingDE}\printLabel{proposition} + }; + }, #1 + } + +\newcounter{factnone} +\newcounter{factsection}[section] +\renewcommand{\thefactsection}{\thesection.\arabic{factsection}} +\newcounter{factsubsection}[subsection] +\renewcommand{\thefactsubsection}{\thesection.\thesubsection.\arabic{factsubsection}} +\newcounter{factsubsubsection}[subsubsection] +\renewcommand{\thefactsubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{factsubsubsection}} +\newcounter{factparagraph}[paragraph] +\renewcommand{\thefactparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{factparagraph}} +\newtcolorbox{fact}[2][]{ + mainboxstyle, + colback=factcolor!5!white, + colframe=factcolor!75!black, + colbacktitle=factcolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=factcolor!75!black, + fill=factcolor!75!black + ] at (frame.north east) + { + \large \tr{\factNamingEN}{\factNamingDE}\printLabel{fact} + }; + }, #1 + } + +\newcounter{formulanone} +\newcounter{formulasection}[section] +\renewcommand{\theformulasection}{\thesection.\arabic{formulasection}} +\newcounter{formulasubsection}[subsection] +\renewcommand{\theformulasubsection}{\thesection.\thesubsection.\arabic{formulasubsection}} +\newcounter{formulasubsubsection}[subsubsection] +\renewcommand{\theformulasubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{formulasubsubsection}} +\newcounter{formulaparagraph}[paragraph] +\renewcommand{\theformulaparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{formulaparagraph}} +\newtcolorbox{formula}[2][]{ + mainboxstyle, + colback=formulacolor!5!white, + colframe=formulacolor!75!black, + colbacktitle=formulacolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=formulacolor!75!black, + fill=formulacolor!75!black + ] at (frame.north east) + { + \large \tr{\formulaNamingEN}{\formulaNamingDE}\printLabel{formula} + }; + }, #1 + } + +\newcounter{remarknone} +\newcounter{remarksection}[section] +\renewcommand{\theremarksection}{\thesection.\arabic{remarksection}} +\newcounter{remarksubsection}[subsection] +\renewcommand{\theremarksubsection}{\thesection.\thesubsection.\arabic{remarksubsection}} +\newcounter{remarksubsubsection}[subsubsection] +\renewcommand{\theremarksubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{remarksubsubsection}} +\newcounter{remarkparagraph}[paragraph] +\renewcommand{\theremarkparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{remarkparagraph}} +\newtcolorbox{remark}[2][]{ + mainboxstyle, + colback=remarkcolor!5!white, + colframe=remarkcolor!75!black, + colbacktitle=remarkcolor!75!black, + title={\large #2}, + overlay={ + \node[overlaystyle, + draw=remarkcolor!75!black, + fill=remarkcolor!75!black + ] at (frame.north east) + { + \large \tr{\remarkNamingEN}{\remarkNamingDE}\printLabel{remark} + }; + }, #1 + } + +\newcounter{combinenone} +\newcounter{combinesection}[section] +\renewcommand{\thecombinesection}{\thesection.\arabic{combinesection}} +\newcounter{combinesubsection}[subsection] +\renewcommand{\thecombinesubsection}{\thesection.\thesubsection.\arabic{combinesubsection}} +\newcounter{combinesubsubsection}[subsubsection] +\renewcommand{\thecombinesubsubsection}{\thesection.\thesubsection.\thesubsubsection.\arabic{combinesubsubsection}} +\newcounter{combineparagraph}[paragraph] +\renewcommand{\thecombineparagraph}{\thesection.\thesubsection.\thesubsubsection.\theparagraph.\arabic{combineparagraph}} + + +\newcommand{\newsectionNoPB}{ + \setcounter{definitionnone}{0} + \setcounter{definitionsection}{0} + \setcounter{definitionsubsection}{0} + \setcounter{definitionsubsubsection}{0} + \setcounter{definitionparagraph}{0} + + \setcounter{examplenone}{0} + \setcounter{examplesection}{0} + \setcounter{examplesubsection}{0} + \setcounter{examplesubsubsection}{0} + \setcounter{exampleparagraph}{0} + + \setcounter{theoremnone}{0} + \setcounter{theoremsection}{0} + \setcounter{theoremsubsection}{0} + \setcounter{theoremsubsubsection}{0} + \setcounter{theoremparagraph}{0} + + \setcounter{lemmanone}{0} + \setcounter{lemmasection}{0} + \setcounter{lemmasubsection}{0} + \setcounter{lemmasubsubsection}{0} + \setcounter{lemmaparagraph}{0} + + \setcounter{corollarynone}{0} + \setcounter{corollarysection}{0} + \setcounter{corollarysubsection}{0} + \setcounter{corollarysubsubsection}{0} + \setcounter{corollaryparagraph}{0} + + \setcounter{propositionnone}{0} + \setcounter{propositionsection}{0} + \setcounter{propositionsubsection}{0} + \setcounter{propositionsubsubsection}{0} + \setcounter{propositionparagraph}{0} + + \setcounter{factnone}{0} + \setcounter{factsection}{0} + \setcounter{factsubsection}{0} + \setcounter{factsubsubsection}{0} + \setcounter{factparagraph}{0} + + \setcounter{formulanone}{0} + \setcounter{formulasection}{0} + \setcounter{formulasubsection}{0} + \setcounter{formulasubsubsection}{0} + \setcounter{formulaparagraph}{0} + + \setcounter{remarknone}{0} + \setcounter{remarksection}{0} + \setcounter{remarksubsection}{0} + \setcounter{remarksubsubsection}{0} + \setcounter{remarkparagraph}{0} + + \setcounter{combinenone}{0} + \setcounter{combinesection}{0} + \setcounter{combinesubsection}{0} + \setcounter{combinesubsubsection}{0} + \setcounter{combineparagraph}{0} + + \setcounter{table}{0} + \setcounter{figure}{0} +} diff --git a/janishutz-helpers.tex b/janishutz-helpers.tex index 61bafc6..01be5fc 100644 --- a/janishutz-helpers.tex +++ b/janishutz-helpers.tex @@ -9,6 +9,10 @@ %% and version 1.3c or later is part of all distributions of %% LaTeX version 2008-05-04 or later. +\NeedsTeXFormat{LaTeX2e} + + +\ProvidesPackage{janishutz-helpers}[2026-02-19 v1.0.0] % Package imports \RequirePackage[table, dvipsnames]{xcolor} @@ -47,46 +51,47 @@ % ┌ ┐ -% │ Naming │ +% │ General config │ % └ ┘ -% Here you may specify how each descriptor is named -\newcommand{\definitionNamingEN}{Definition} -\newcommand{\theoremNamingEN}{Theorem} -\newcommand{\lemmaNamingEN}{Lemma} -\newcommand{\corollaryNamingEN}{Corollary} -\newcommand{\axiomNamingEN}{Axiom} -\newcommand{\factNamingEN}{Fact} -\newcommand{\propositionNamingEN}{Proposition} -\newcommand{\exampleNamingEN}{Example} -\newcommand{\formulaNamingEN}{Formula} -\newcommand{\remarkNamingEN}{Remark} -\newcommand{\proofNamingEN}{Proof} -\newcommand{\intuitionNamingEN}{Intuition} -\newcommand{\termNamingEN}{Term} -\newcommand{\notationNamingEN}{Notation} -\newcommand{\taskNamingEN}{Task} -\newcommand{\usageNamingEN}{Usage} -\newcommand{\recallNamingEN}{Recall} -\newcommand{\propertiesNamingEN}{Properties} +% Configure your author name here +\newcommand{\authorTitle}{Janis Hutz\\\url{https://janishutz.com}} +\newcommand{\authorHeaders}{Janis Hutz} -\newcommand{\definitionNamingDE}{Definition} -\newcommand{\theoremNamingDE}{Theorem} -\newcommand{\lemmaNamingDE}{Lemma} -\newcommand{\corollaryNamingDE}{Korollar} -\newcommand{\axiomNamingDE}{Axiom} -\newcommand{\factNamingDE}{Fakt} -\newcommand{\propositionNamingDE}{Satz} -\newcommand{\exampleNamingDE}{Beispiel} -\newcommand{\formulaNamingDE}{Formel} -\newcommand{\remarkNamingDE}{Bemerkung} -\newcommand{\proofNamingDE}{Beweis} -\newcommand{\intuitionNamingDE}{Intuition} -\newcommand{\termNamingDE}{Begriff} -\newcommand{\notationNamingDE}{Notation} -\newcommand{\taskNamingDE}{Aufgabe} -\newcommand{\usageNamingDE}{Nutzung} -\newcommand{\recallNamingDE}{Repetition} -\newcommand{\propertiesNamingDE}{Eigenschaften} +% Configure your address here +\newcommand{\name}{Janis Hutz} +\newcommand{\street}{Street} +\newcommand{\city}{City} +\newcommand{\countrycode}{CH} + +% Set the default language +\renewcommand{\currentLanguage}{en} + + +% ┌ ┐ +% │ Rendering │ +% └ ┘ +% Short descriptors are generated from the naming defined in naming.sty +% You may here configure how they are generated. #1 is the full name. +\newcommand{\shortDescriptorNameTemplate}[1]{\StrBefore[1]{#1}} + +% Decide if the numbering should show a space preceding it. +% \newcommand{\useSpaceBeforeNumbering}{true} +% TODO: Remove above if works without + +% Specify how the inline and short descriptors (e.g. Lemma, etc) are rendered. +% - #1 is the name of the descriptor +% - #2 is the number (correctly rendered according to settings and preceded with space if not disabled) +% - #3 is the name passed (non-empty asserted) +\newcommand{\shortDescriptorTemplate}[4]{\bg{#1color}{\shortDescriptorNameTemplate{#1}#2} \textit{(#3)}\ } +\newcommand{\inlineDescriptorTemplate}[4]{\bg{#1color}{#1#2}: \textit{(#3)}\ } + +% These are used if no name is provided and argument #4 from above is the missing argument +\newcommand{\anonymousShortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{#1}#2}\ } +\newcommand{\anonymousInlineDescriptorTemplate}[3]{\bg{#3color}{#1#2}\ } + +% background command config (draws a small box around the content) +\newcommand{\backgroundPadding}{2pt} +\newcommand{\backgroundRounding}{0.1pt} % ┌ ┐ @@ -160,84 +165,83 @@ % ┌ ┐ -% │ General config │ +% │ Naming │ % └ ┘ -% Configure your author name here -\newcommand{\authorTitle}{Janis Hutz\\\url{https://janishutz.com}} -\newcommand{\authorHeaders}{Janis Hutz} +% Here you may specify how each descriptor is named +\newcommand{\definitionNamingEN}{Definition} +\newcommand{\theoremNamingEN}{Theorem} +\newcommand{\lemmaNamingEN}{Lemma} +\newcommand{\corollaryNamingEN}{Corollary} +\newcommand{\axiomNamingEN}{Axiom} +\newcommand{\factNamingEN}{Fact} +\newcommand{\propositionNamingEN}{Proposition} +\newcommand{\exampleNamingEN}{Example} +\newcommand{\formulaNamingEN}{Formula} +\newcommand{\remarkNamingEN}{Remark} +\newcommand{\proofNamingEN}{Proof} +\newcommand{\intuitionNamingEN}{Intuition} +\newcommand{\termNamingEN}{Term} +\newcommand{\notationNamingEN}{Notation} +\newcommand{\taskNamingEN}{Task} +\newcommand{\usageNamingEN}{Usage} +\newcommand{\recallNamingEN}{Recall} +\newcommand{\propertiesNamingEN}{Properties} -% Configure your address here -\newcommand{\name}{Janis Hutz} -\newcommand{\street}{Street} -\newcommand{\city}{City} -\newcommand{\countrycode}{CH} - -% Set the default language -\renewcommand{\currentLanguage}{en} - - -% ┌ ┐ -% │ Rendering │ -% └ ┘ -% Short descriptors are generated from the naming defined in naming.sty -% You may here configure how they are generated. #1 is the full name. -\newcommand{\shortDescriptorNameTemplate}[1]{\StrBefore[1]{#1}} - -% Decide if the numbering should show a space preceding it. -% \newcommand{\useSpaceBeforeNumbering}{true} -% TODO: Remove above if works without - -% Specify how the inline and short descriptors (e.g. Lemma, etc) are rendered. -% - #1 is the name of the descriptor -% - #2 is the number (correctly rendered according to settings and preceded with space if not disabled) -% - #3 is the name passed (non-empty asserted) -\newcommand{\shortDescriptorTemplate}[4]{\bg{#1color}{\shortDescriptorNameTemplate{#1}#2} \textit{(#3)}\ } -\newcommand{\inlineDescriptorTemplate}[4]{\bg{#1color}{#1#2}: \textit{(#3)}\ } - -% These are used if no name is provided and argument #4 from above is the missing argument -\newcommand{\anonymousShortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{#1}#2}\ } -\newcommand{\anonymousInlineDescriptorTemplate}[3]{\bg{#3color}{#1#2}\ } - -% background command config (draws a small box around the content) -\newcommand{\backgroundPadding}{2pt} -\newcommand{\backgroundRounding}{0.1pt} +\newcommand{\definitionNamingDE}{Definition} +\newcommand{\theoremNamingDE}{Theorem} +\newcommand{\lemmaNamingDE}{Lemma} +\newcommand{\corollaryNamingDE}{Korollar} +\newcommand{\axiomNamingDE}{Axiom} +\newcommand{\factNamingDE}{Fakt} +\newcommand{\propositionNamingDE}{Satz} +\newcommand{\exampleNamingDE}{Beispiel} +\newcommand{\formulaNamingDE}{Formel} +\newcommand{\remarkNamingDE}{Bemerkung} +\newcommand{\proofNamingDE}{Beweis} +\newcommand{\intuitionNamingDE}{Intuition} +\newcommand{\termNamingDE}{Begriff} +\newcommand{\notationNamingDE}{Notation} +\newcommand{\taskNamingDE}{Aufgabe} +\newcommand{\usageNamingDE}{Nutzung} +\newcommand{\recallNamingDE}{Repetition} +\newcommand{\propertiesNamingDE}{Eigenschaften} % ┌ ┐ % │ STYLE: Globals │ % └ ┘ % Global style configs for tcolorbox (to reduce bloat) -\AtBeginDocument{ - \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 - } - } -} +% \AtBeginDocument{ +% \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 +% } +% } +% } % ── Fonts ─────────────────────────────────────────────────────────── \newcommand{\setFont}[1]{\fontfamily{#1}\selectfont} @@ -318,103 +322,6 @@ } -% ┌ ┐ -% │ Index │ -% └ ┘ - -% 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} - - - -% ┌ ┐ -% │ 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...} - \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}} - } -} - -% 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} -} - - -% TODO: Use landscape and columns for new version -% Set up the latex document for exam summaries (Extra wide body, small margins, no header) -\newcommand{\setupCheatSheet}[1]{ - \loadLang - \RequirePackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} - \title{\Huge \textbf{#1}} - \author{\authorTitle} -} - - -% ┌ ┐ -% │ Document start │ -% └ ┘ -% Start document command (required) -\newcommand{\startDocument}{ - \maketitle - \pagestyle{fancy} - \thispagestyle{fancy} -} - - -% ┌ ┐ -% │ Translation │ -% └ ┘ -\newcommand{\translate}[2]{% - \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2} -} -\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 }} - - % ┌ ┐ % │ Math │ % └ ┘ @@ -512,6 +419,23 @@ \DeclareMathOperator\arcsinh{arcsinh} +% ┌ ┐ +% │ Index │ +% └ ┘ + +% 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} + + + % ┌ ┐ % │ Tables │ % └ ┘ @@ -544,6 +468,86 @@ } +% ┌ ┐ +% │ Translation │ +% └ ┘ +\newcommand{\translate}[2]{% + \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2} +} +\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 }} + + +% ┌ ┐ +% │ 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...} + \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}} + } +} + +% 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} +} + + +% TODO: Use landscape and columns for new version +% Set up the latex document for exam summaries (Extra wide body, small margins, no header) +\newcommand{\setupCheatSheet}[1]{ + \loadLang + \RequirePackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} +} + + +% ┌ ┐ +% │ Document start │ +% └ ┘ +% Start document command (required) +\newcommand{\startDocument}{ + \maketitle + \pagestyle{fancy} + \thispagestyle{fancy} +} + + % ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ % ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ @@ -588,6 +592,64 @@ \newcommand{\proven}{$\hspace{17cm}\square$} +% ┌ ┐ +% │ STYLE: Common tcolorboxes │ +% └ ┘ +% TODO: Update colors + +\newtcolorbox{recall}[2][]{mainboxstyle,colback=recallcolor!5!white,colframe=recallcolor!75!black,colbacktitle=recallcolor!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=recallcolor!75!black,,fill=recallcolor!75!black] at (frame.north east) {\large \translate{Recall }{Repetition }};},#1} + +\newtcolorbox{remarks}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Remarks }{Bemerkungen }};},#1} + +\newtcolorbox{guides}[3][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=red!75!black,,fill=red!75!black] at (frame.north east) {\large #3};},#1} + + +\newtcolorbox{properties}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Properties }{Eigenschaften }};},#1} + +\newtcolorbox{restrictions}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Restrictions }{Einschränkungen }};},#1} + +\newtcolorbox{limitations}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Limitations }{Limitierungen }};},#1} + +\newtcolorbox{intuition}[2][]{mainboxstyle,colback=Emerald!5!white,colframe=Emerald!75!black,colbacktitle=Emerald!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Emerald!75!black,,fill=Emerald!75!black] at (frame.north east) {\large Intuition};},#1} + +\newcommand{\inlineintuition}{\bg{Emerald}{Intuition:}} + + +% Terms and notation +\newtcolorbox{terms}[2][]{mainboxstyle,colback=orange!5!white,colframe=orange!75!black,colbacktitle=orange!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=orange!75!black,,fill=orange!75!black] at (frame.north east) {\large \translate{Terms }{Begriffe }};},#1} + +\newtcolorbox{notation}[2][]{mainboxstyle,colback=Peach!5!white,colframe=Peach!75!black,colbacktitle=Peach!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=Peach!75!black,,fill=Peach!75!black] at (frame.north east) {\large Notation};},#1} + + +\newtcolorbox{usage}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Usage }{Nutzung }};},#1} + + +% Task +\newtcolorbox{task}[2][]{mainboxstyle,colback=gray!5!white,colframe=gray!75!black,colbacktitle=gray!75!black,title={\large #2},overlay={\node[overlaystyle,draw=gray!75!black,fill=gray!75!black] at (frame.north east) {\large \translate{Task}{Aufgabe}};},#1} + + +% Proof +\newtcolorbox{proof}[2][]{mainboxstyle,colback=magenta!5!white,colframe=magenta!75!black,colbacktitle=magenta!75!black,title={\large #2},overlay={\node[overlaystyle,draw=magenta!75!black,fill=magenta!75!black] at (frame.north east) {\large \translate{Proof}{Beweis}};},#1} + + +% General +\newtcolorbox{general}[4][]{mainboxstyle,colback=#4!5!white,colframe=#4!75!black,colbacktitle=#4!75!black,title={\large #2}, + overlay={\node[overlaystyle,draw=#4!75!black,,fill=#4!75!black] at (frame.north east) {\large #3};},#1} + +% Simple +\newtcolorbox{simplebox}[2][]{colback=#2!5!white,colframe=#2!75!black,#1} + + % ── Label generator ───────────────────────────────────────────────── \newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname} \newcommand{\printCounter}[1]{\csname the#1\endcsname} @@ -709,64 +771,6 @@ } -% ┌ ┐ -% │ STYLE: Common tcolorboxes │ -% └ ┘ -% TODO: Update colors - -\newtcolorbox{recall}[2][]{mainboxstyle,colback=recallcolor!5!white,colframe=recallcolor!75!black,colbacktitle=recallcolor!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=recallcolor!75!black,,fill=recallcolor!75!black] at (frame.north east) {\large \translate{Recall }{Repetition }};},#1} - -\newtcolorbox{remarks}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Remarks }{Bemerkungen }};},#1} - -\newtcolorbox{guides}[3][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=red!75!black,,fill=red!75!black] at (frame.north east) {\large #3};},#1} - - -\newtcolorbox{properties}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Properties }{Eigenschaften }};},#1} - -\newtcolorbox{restrictions}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Restrictions }{Einschränkungen }};},#1} - -\newtcolorbox{limitations}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Limitations }{Limitierungen }};},#1} - -\newtcolorbox{intuition}[2][]{mainboxstyle,colback=Emerald!5!white,colframe=Emerald!75!black,colbacktitle=Emerald!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=Emerald!75!black,,fill=Emerald!75!black] at (frame.north east) {\large Intuition};},#1} - -\newcommand{\inlineintuition}{\bg{Emerald}{Intuition:}} - - -% Terms and notation -\newtcolorbox{terms}[2][]{mainboxstyle,colback=orange!5!white,colframe=orange!75!black,colbacktitle=orange!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=orange!75!black,,fill=orange!75!black] at (frame.north east) {\large \translate{Terms }{Begriffe }};},#1} - -\newtcolorbox{notation}[2][]{mainboxstyle,colback=Peach!5!white,colframe=Peach!75!black,colbacktitle=Peach!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=Peach!75!black,,fill=Peach!75!black] at (frame.north east) {\large Notation};},#1} - - -\newtcolorbox{usage}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Usage }{Nutzung }};},#1} - - -% Task -\newtcolorbox{task}[2][]{mainboxstyle,colback=gray!5!white,colframe=gray!75!black,colbacktitle=gray!75!black,title={\large #2},overlay={\node[overlaystyle,draw=gray!75!black,fill=gray!75!black] at (frame.north east) {\large \translate{Task}{Aufgabe}};},#1} - - -% Proof -\newtcolorbox{proof}[2][]{mainboxstyle,colback=magenta!5!white,colframe=magenta!75!black,colbacktitle=magenta!75!black,title={\large #2},overlay={\node[overlaystyle,draw=magenta!75!black,fill=magenta!75!black] at (frame.north east) {\large \translate{Proof}{Beweis}};},#1} - - -% General -\newtcolorbox{general}[4][]{mainboxstyle,colback=#4!5!white,colframe=#4!75!black,colbacktitle=#4!75!black,title={\large #2}, - overlay={\node[overlaystyle,draw=#4!75!black,,fill=#4!75!black] at (frame.north east) {\large #3};},#1} - -% Simple -\newtcolorbox{simplebox}[2][]{colback=#2!5!white,colframe=#2!75!black,#1} - - \newcounter{definitionnone} \newcounter{definitionsection}[section] \renewcommand{\thedefinitionsection}{\thesection.\arabic{definitionsection}} diff --git a/uninstall.sh b/uninstall.sh old mode 100644 new mode 100755 index aa9f02f..61d7c26 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,5 +1,6 @@ #!/bin/sh + if [[ -z "${TEXMFHOME+x}" ]]; then export TEXMFHOME=~/texmf/ fi