Get working

This commit is contained in:
2026-02-19 19:49:59 +01:00
parent b7b365dd36
commit 35bd979c98
10 changed files with 500 additions and 515 deletions

View File

@@ -29,7 +29,7 @@ def load_all_files_of_array(dirname: str, files: List[str]):
data = "" data = ""
for filename in files: for filename in files:
with open(dirname + "/" + filename, "r") as file: with open(dirname + "/" + filename, "r") as file:
data += file.read() + "\n\n" data += (file.read() + "\n\n").replace( 'RequirePackage', 'usepackage' )
return data return data
@@ -39,13 +39,12 @@ if build_sty:
output += f"\\ProvidesPackage{{janishutz-helpers}}[{datetime.datetime.now().date().isoformat()} v{version}]\n\n" 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/", ["core.sty"])
output += load_all_files_of_array("../src/config/", os.listdir("../src/config/")) 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/"))
output += load_all_files_of_array("../src/style/", os.listdir("../src/style/"))
l = labels.generate_labels() l = labels.generate_labels()
output += l[0] + "\n\n" output += l[0] + "\n\n"
output += l[1] output += l[1]
output += load_all_files_of_array("../src/", ["style.sty"])
output += load_all_files_of_array("../src/core/", os.listdir("../src/core/"))
output += load_all_files_of_array("../src/style/", os.listdir("../src/style/"))
output += "\\endinput" output += "\\endinput"

View File

@@ -23,15 +23,15 @@ def generate_labels():
reset_func += f" \\setcounter{{{label}section}}{{0}}\n" reset_func += f" \\setcounter{{{label}section}}{{0}}\n"
data += f"\\newcounter{{{label}subsection}}[subsection]\n" data += f"\\newcounter{{{label}subsection}}[subsection]\n"
data += f"\\renewcommand{{\\the{label}subsection}}{{\\thesection.\\thesubsection.\\arabic{{{label}subsection}}}}\n" data += f"\\renewcommand{{\\the{label}subsection}}{{\\thesubsection.\\arabic{{{label}subsection}}}}\n"
reset_func += f" \\setcounter{{{label}subsection}}{{0}}\n" reset_func += f" \\setcounter{{{label}subsection}}{{0}}\n"
data += f"\\newcounter{{{label}subsubsection}}[subsubsection]\n" data += f"\\newcounter{{{label}subsubsection}}[subsubsection]\n"
data += f"\\renewcommand{{\\the{label}subsubsection}}{{\\thesection.\\thesubsection.\\thesubsubsection.\\arabic{{{label}subsubsection}}}}\n" data += f"\\renewcommand{{\\the{label}subsubsection}}{{\\thesubsubsection.\\arabic{{{label}subsubsection}}}}\n"
reset_func += f" \\setcounter{{{label}subsubsection}}{{0}}\n" reset_func += f" \\setcounter{{{label}subsubsection}}{{0}}\n"
data += f"\\newcounter{{{label}paragraph}}[paragraph]\n" data += f"\\newcounter{{{label}paragraph}}[paragraph]\n"
data += f"\\renewcommand{{\\the{label}paragraph}}{{\\thesection.\\thesubsection.\\thesubsubsection.\\theparagraph.\\arabic{{{label}paragraph}}}}\n" data += f"\\renewcommand{{\\the{label}paragraph}}{{\\theparagraph.\\arabic{{{label}paragraph}}}}\n"
reset_func += f" \\setcounter{{{label}paragraph}}{{0}}\n" reset_func += f" \\setcounter{{{label}paragraph}}{{0}}\n"
# Generate tcolorboxes # Generate tcolorboxes
@@ -52,7 +52,8 @@ def generate_labels():
}}; }};
}}, #1 }}, #1
}}\n\n""" }}\n\n"""
# TODO: If needed, add aliases for \short{definition} as e.g \shortdefinition data += f"\\newcommand{{\\inline{label}}}[1][NONAME]{{\\inline[#1]{{{label}}}}}"
data += f"\\newcommand{{\\short{label}}}[1][NONAME]{{\\short[#1]{{{label}}}}}"
reset_func += "\n \\setcounter{table}{0}\n" reset_func += "\n \\setcounter{table}{0}\n"
reset_func += " \\setcounter{figure}{0}\n" reset_func += " \\setcounter{figure}{0}\n"

View File

@@ -211,37 +211,37 @@
% │ STYLE: Globals │ % │ STYLE: Globals │
% └ ┘ % └ ┘
% Global style configs for tcolorbox (to reduce bloat) % Global style configs for tcolorbox (to reduce bloat)
% \AtBeginDocument{ \AtBeginDocument{
% \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
% } }
% } }
% } }
% ── Fonts ─────────────────────────────────────────────────────────── % ── Fonts ───────────────────────────────────────────────────────────
\newcommand{\setFont}[1]{\fontfamily{#1}\selectfont} \newcommand{\setFont}[1]{\fontfamily{#1}\selectfont}
@@ -1077,4 +1077,4 @@
\setcounter{table}{0} \setcounter{table}{0}
\setcounter{figure}{0} \setcounter{figure}{0}
} }
\endinput \endinput

View File

@@ -13,33 +13,33 @@
% Package imports % Package imports
\RequirePackage[table, dvipsnames]{xcolor} \usepackage[table, dvipsnames]{xcolor}
\RequirePackage{amsmath} \usepackage{amsmath}
\RequirePackage{graphicx} \usepackage{graphicx}
\RequirePackage{subcaption} \usepackage{subcaption}
\RequirePackage[export]{adjustbox} \usepackage[export]{adjustbox}
\RequirePackage[most]{tcolorbox} \usepackage[most]{tcolorbox}
\RequirePackage{cancel} \usepackage{cancel}
\RequirePackage{dsfont} \usepackage{dsfont}
\RequirePackage{amssymb} \usepackage{amssymb}
\RequirePackage{mathrsfs} \usepackage{mathrsfs}
\RequirePackage{lipsum} \usepackage{lipsum}
\RequirePackage{ulem} \usepackage{ulem}
\RequirePackage{soul} \usepackage{soul}
\RequirePackage{parskip} \usepackage{parskip}
\RequirePackage{fancyhdr} \usepackage{fancyhdr}
\RequirePackage{lastpage} \usepackage{lastpage}
\RequirePackage{tocloft} \usepackage{tocloft}
\RequirePackage{wasysym} \usepackage{wasysym}
\RequirePackage{wrapfig} \usepackage{wrapfig}
\RequirePackage{multicol} \usepackage{multicol}
\RequirePackage{ifthen} \usepackage{ifthen}
\RequirePackage[hidelinks]{hyperref} \usepackage[hidelinks]{hyperref}
\RequirePackage{enumitem} \usepackage{enumitem}
\RequirePackage{gensymb} \usepackage{gensymb}
\RequirePackage{pifont} \usepackage{pifont}
\RequirePackage{xstring} \usepackage{xstring}
\RequirePackage{etoolbox} \usepackage{etoolbox}
\newcounter{descriptorShadeStrength} \newcounter{descriptorShadeStrength}
\newcounter{shadeStrength} \newcounter{shadeStrength}
@@ -47,6 +47,9 @@
\setcounter{secnumdepth}{4} \setcounter{secnumdepth}{4}
\newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname}
\newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname}
% ┌ ┐ % ┌ ┐
% │ General config │ % │ General config │
@@ -72,24 +75,20 @@
% You may here configure how they are generated. #1 is the full name. % You may here configure how they are generated. #1 is the full name.
\newcommand{\shortDescriptorNameTemplate}[1]{\StrBefore[1]{#1}} \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. % Specify how the inline and short descriptors (e.g. Lemma, etc) are rendered.
% - #1 is the name of the descriptor % - #1 is the name of the descriptor
% - #2 is the number (correctly rendered according to settings and preceded with space if not disabled) % - #2 is the number (correctly rendered according to settings and preceded with space if not disabled)
% - #3 is the name passed (non-empty asserted) % - #3 is the name passed (non-empty asserted)
\newcommand{\shortDescriptorTemplate}[4]{\bg{#1color}{\shortDescriptorNameTemplate{#1}#2} \textit{(#3)}\ } \newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#1}} #2} \textit{(#3)}}
\newcommand{\inlineDescriptorTemplate}[4]{\bg{#1color}{#1#2}: \textit{(#3)}\ } \newcommand{\inlineDescriptorTemplate}[3]{\bg{#1color}{\namingTranslate{#1} #2}: \textit{(#3)}}
% These are used if no name is provided and argument #4 from above is the missing argument % 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{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#1}} #2}}
\newcommand{\anonymousInlineDescriptorTemplate}[3]{\bg{#3color}{#1#2}\ } \newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}}
% background command config (draws a small box around the content) % background command config (draws a small box around the content)
\newcommand{\backgroundPadding}{2pt} \newcommand{\backgroundPadding}{2pt}
\newcommand{\backgroundRounding}{0.1pt} \newcommand{\backgroundRounding}{1pt}
% ┌ ┐ % ┌ ┐
@@ -205,42 +204,318 @@
\newcommand{\propertiesNamingDE}{Eigenschaften} \newcommand{\propertiesNamingDE}{Eigenschaften}
\newcounter{definitionnone}
\newcounter{definitionsection}[section]
\renewcommand{\thedefinitionsection}{\thesection.\arabic{definitionsection}}
\newcounter{definitionsubsection}[subsection]
\renewcommand{\thedefinitionsubsection}{\thesubsection.\arabic{definitionsubsection}}
\newcounter{definitionsubsubsection}[subsubsection]
\renewcommand{\thedefinitionsubsubsection}{\thesubsubsection.\arabic{definitionsubsubsection}}
\newcounter{definitionparagraph}[paragraph]
\renewcommand{\thedefinitionparagraph}{\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
}
\newcommand{\inlinedefinition}[1][NONAME]{\inline[#1]{definition}}\newcommand{\shortdefinition}[1][NONAME]{\short[#1]{definition}}\newcounter{examplenone}
\newcounter{examplesection}[section]
\renewcommand{\theexamplesection}{\thesection.\arabic{examplesection}}
\newcounter{examplesubsection}[subsection]
\renewcommand{\theexamplesubsection}{\thesubsection.\arabic{examplesubsection}}
\newcounter{examplesubsubsection}[subsubsection]
\renewcommand{\theexamplesubsubsection}{\thesubsubsection.\arabic{examplesubsubsection}}
\newcounter{exampleparagraph}[paragraph]
\renewcommand{\theexampleparagraph}{\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
}
\newcommand{\inlineexample}[1][NONAME]{\inline[#1]{example}}\newcommand{\shortexample}[1][NONAME]{\short[#1]{example}}\newcounter{theoremnone}
\newcounter{theoremsection}[section]
\renewcommand{\thetheoremsection}{\thesection.\arabic{theoremsection}}
\newcounter{theoremsubsection}[subsection]
\renewcommand{\thetheoremsubsection}{\thesubsection.\arabic{theoremsubsection}}
\newcounter{theoremsubsubsection}[subsubsection]
\renewcommand{\thetheoremsubsubsection}{\thesubsubsection.\arabic{theoremsubsubsection}}
\newcounter{theoremparagraph}[paragraph]
\renewcommand{\thetheoremparagraph}{\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
}
\newcommand{\inlinetheorem}[1][NONAME]{\inline[#1]{theorem}}\newcommand{\shorttheorem}[1][NONAME]{\short[#1]{theorem}}\newcounter{lemmanone}
\newcounter{lemmasection}[section]
\renewcommand{\thelemmasection}{\thesection.\arabic{lemmasection}}
\newcounter{lemmasubsection}[subsection]
\renewcommand{\thelemmasubsection}{\thesubsection.\arabic{lemmasubsection}}
\newcounter{lemmasubsubsection}[subsubsection]
\renewcommand{\thelemmasubsubsection}{\thesubsubsection.\arabic{lemmasubsubsection}}
\newcounter{lemmaparagraph}[paragraph]
\renewcommand{\thelemmaparagraph}{\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
}
\newcommand{\inlinelemma}[1][NONAME]{\inline[#1]{lemma}}\newcommand{\shortlemma}[1][NONAME]{\short[#1]{lemma}}\newcounter{corollarynone}
\newcounter{corollarysection}[section]
\renewcommand{\thecorollarysection}{\thesection.\arabic{corollarysection}}
\newcounter{corollarysubsection}[subsection]
\renewcommand{\thecorollarysubsection}{\thesubsection.\arabic{corollarysubsection}}
\newcounter{corollarysubsubsection}[subsubsection]
\renewcommand{\thecorollarysubsubsection}{\thesubsubsection.\arabic{corollarysubsubsection}}
\newcounter{corollaryparagraph}[paragraph]
\renewcommand{\thecorollaryparagraph}{\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
}
\newcommand{\inlinecorollary}[1][NONAME]{\inline[#1]{corollary}}\newcommand{\shortcorollary}[1][NONAME]{\short[#1]{corollary}}\newcounter{propositionnone}
\newcounter{propositionsection}[section]
\renewcommand{\thepropositionsection}{\thesection.\arabic{propositionsection}}
\newcounter{propositionsubsection}[subsection]
\renewcommand{\thepropositionsubsection}{\thesubsection.\arabic{propositionsubsection}}
\newcounter{propositionsubsubsection}[subsubsection]
\renewcommand{\thepropositionsubsubsection}{\thesubsubsection.\arabic{propositionsubsubsection}}
\newcounter{propositionparagraph}[paragraph]
\renewcommand{\thepropositionparagraph}{\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
}
\newcommand{\inlineproposition}[1][NONAME]{\inline[#1]{proposition}}\newcommand{\shortproposition}[1][NONAME]{\short[#1]{proposition}}\newcounter{factnone}
\newcounter{factsection}[section]
\renewcommand{\thefactsection}{\thesection.\arabic{factsection}}
\newcounter{factsubsection}[subsection]
\renewcommand{\thefactsubsection}{\thesubsection.\arabic{factsubsection}}
\newcounter{factsubsubsection}[subsubsection]
\renewcommand{\thefactsubsubsection}{\thesubsubsection.\arabic{factsubsubsection}}
\newcounter{factparagraph}[paragraph]
\renewcommand{\thefactparagraph}{\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
}
\newcommand{\inlinefact}[1][NONAME]{\inline[#1]{fact}}\newcommand{\shortfact}[1][NONAME]{\short[#1]{fact}}\newcounter{formulanone}
\newcounter{formulasection}[section]
\renewcommand{\theformulasection}{\thesection.\arabic{formulasection}}
\newcounter{formulasubsection}[subsection]
\renewcommand{\theformulasubsection}{\thesubsection.\arabic{formulasubsection}}
\newcounter{formulasubsubsection}[subsubsection]
\renewcommand{\theformulasubsubsection}{\thesubsubsection.\arabic{formulasubsubsection}}
\newcounter{formulaparagraph}[paragraph]
\renewcommand{\theformulaparagraph}{\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
}
\newcommand{\inlineformula}[1][NONAME]{\inline[#1]{formula}}\newcommand{\shortformula}[1][NONAME]{\short[#1]{formula}}\newcounter{remarknone}
\newcounter{remarksection}[section]
\renewcommand{\theremarksection}{\thesection.\arabic{remarksection}}
\newcounter{remarksubsection}[subsection]
\renewcommand{\theremarksubsection}{\thesubsection.\arabic{remarksubsection}}
\newcounter{remarksubsubsection}[subsubsection]
\renewcommand{\theremarksubsubsection}{\thesubsubsection.\arabic{remarksubsubsection}}
\newcounter{remarkparagraph}[paragraph]
\renewcommand{\theremarkparagraph}{\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
}
\newcommand{\inlineremark}[1][NONAME]{\inline[#1]{remark}}\newcommand{\shortremark}[1][NONAME]{\short[#1]{remark}}\newcounter{combinenone}
\newcounter{combinesection}[section]
\renewcommand{\thecombinesection}{\thesection.\arabic{combinesection}}
\newcounter{combinesubsection}[subsection]
\renewcommand{\thecombinesubsection}{\thesubsection.\arabic{combinesubsection}}
\newcounter{combinesubsubsection}[subsubsection]
\renewcommand{\thecombinesubsubsection}{\thesubsubsection.\arabic{combinesubsubsection}}
\newcounter{combineparagraph}[paragraph]
\renewcommand{\thecombineparagraph}{\theparagraph.\arabic{combineparagraph}}
\newcommand{\inlinecombine}[1][NONAME]{\inline[#1]{combine}}\newcommand{\shortcombine}[1][NONAME]{\short[#1]{combine}}
\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}
}
% ┌ ┐ % ┌ ┐
% │ STYLE: Globals │ % │ 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
% }
% }
% }
% ── Fonts ─────────────────────────────────────────────────────────── % ── Fonts ───────────────────────────────────────────────────────────
\newcommand{\setFont}[1]{\fontfamily{#1}\selectfont} \newcommand{\setFont}[1]{\fontfamily{#1}\selectfont}
\newcommand{\setFontType}[1]{ \newcommand{\setFontType}[1]{
@@ -423,8 +698,8 @@
% For using index package % For using index package
\newcommand{\prepareIndex}{ \newcommand{\prepareIndex}{
\RequirePackage[T1]{fontenc} \usepackage[T1]{fontenc}
\RequirePackage{imakeidx} \usepackage{imakeidx}
\makeindex \makeindex
} }
@@ -438,8 +713,8 @@
% │ Tables │ % │ Tables │
% └ ┘ % └ ┘
\RequirePackage{booktabs} \usepackage{booktabs}
\RequirePackage{tabulary} \usepackage{tabulary}
% Create new table. #1 Layout, #2 title row % Create new table. #1 Layout, #2 title row
\newenvironment{tables}[2]{ \newenvironment{tables}[2]{
@@ -470,9 +745,10 @@
% │ Translation │ % │ Translation │
% └ ┘ % └ ┘
\newcommand{\translate}[2]{% \newcommand{\translate}[2]{%
\ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2} \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}%
} }
\newcommand{\tr}[2]{\translate{#1}{#2}} \newcommand{\tr}[2]{\translate{#1}{#2}}
\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionEN{#1}}}
% Translation aids (commonly used) % Translation aids (commonly used)
\newcommand{\trif}{\translate{if }{falls }} \newcommand{\trif}{\translate{if }{falls }}
@@ -494,7 +770,7 @@
% Set up the latex document, configure author, title (as first argument), as well as headers and footers % Set up the latex document, configure author, title (as first argument), as well as headers and footers
\newcommand{\setup}[1]{ \newcommand{\setup}[1]{
\typeout{[Setup] Setting up...} \typeout{[Setup] Setting up...}
\RequirePackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry}
\title{\Huge \textbf{#1}} \title{\Huge \textbf{#1}}
\author{\authorTitle} \author{\authorTitle}
\makeatletter \makeatletter
@@ -517,7 +793,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]{
\RequirePackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry}
\title{\Huge \textbf{#1}} \title{\Huge \textbf{#1}}
\author{\authorTitle} \author{\authorTitle}
} }
@@ -526,7 +802,7 @@
% TODO: Use landscape and columns for new version % TODO: Use landscape and columns for new version
% 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]{
\RequirePackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} \usepackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry}
\title{\Huge \textbf{#1}} \title{\Huge \textbf{#1}}
\author{\authorTitle} \author{\authorTitle}
} }
@@ -537,9 +813,40 @@
% └ ┘ % └ ┘
% Start document command (required) % Start document command (required)
\newcommand{\startDocument}{ \newcommand{\startDocument}{
% TODO: Cheat sheet needs different setup
\maketitle \maketitle
\pagestyle{fancy} \pagestyle{fancy}
\thispagestyle{fancy} \thispagestyle{fancy}
\tcbset{
mainboxstyle/.style={
arc=3mm,
colback=red!5!white,
colframe=red!75!black,
colbacktitle=red!75!black,
fonttitle=\bfseries,
enhanced,
attach boxed title to top left={yshift=-2mm,xshift=5mm},
breakable,
top=0.4cm,
}
}
\tikzset{
overlaystyle/.style={
draw=red!75!black,
thick,
fill=red!75!black,
left,
anchor=east,
text=white,
rounded corners=1mm,
font=\bfseries,
xshift=-5mm,
yshift=1mm,
inner xsep=3mm,
inner ysep=1.5mm
}
}
} }
@@ -549,13 +856,13 @@
% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ % ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀
% Extra imports % Extra imports
\RequirePackage{stmaryrd} \usepackage{stmaryrd}
\RequirePackage{algorithm} \usepackage{algorithm}
\RequirePackage{algpseudocodex} \usepackage{algpseudocodex}
\RequirePackage{setspace} \usepackage{setspace}
\RequirePackage{verbatim} \usepackage{verbatim}
\RequirePackage{turnstile} \usepackage{turnstile}
\RequirePackage{forloop} \usepackage{forloop}
\newcommand{\Indent}{\hspace{\algorithmicindent}} \newcommand{\Indent}{\hspace{\algorithmicindent}}
@@ -647,25 +954,24 @@
% ── Label generator ───────────────────────────────────────────────── % ── Label generator ─────────────────────────────────────────────────
\newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname} \newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname}
\newcommand{\printCounter}[1]{\csname the#1\endcsname} \newcommand{\printCounter}[1]{\refstepcounter{#1}\csname the#1\endcsname}
\newcommand{\printLabel}[1]{% \newcommand{\printLabel}[1]{%
\ifcsdef{#1numbering}{% Extra config present \ifcsdef{#1numbering}{% Extra config present
% TODO: Increment \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{%
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{
\printCounter{#1\subsectionnumbering}% \printCounter{#1\subsectionnumbering}%
}{ }{%
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{ \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{%
\printCounter{#1\subsectionnumbering}% \printCounter{#1\subsectionnumbering}%
}{ }{%
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{ \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{%
\printCounter{combined\subsectionnumbering}% \printCounter{combined\subsectionnumbering}%
}{} }{}%
} }%
} }%
}{% }{%
\labelPrintBackendRoutine{#1}% \labelPrintBackendRoutine{#1}%
} }%
} }
\newcommand{\labelPrintBackendRoutine}[1]{ \newcommand{\labelPrintBackendRoutine}[1]{
\ifthenelse{\equal{\numberingpreset}{combined}}{ \ifthenelse{\equal{\numberingpreset}{combined}}{
@@ -678,22 +984,16 @@
} }
% Inline environments (inline) % Inline environments (inline)
\newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname}
\newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname}
\newcommand{\inline}[2][NONAME]{% \newcommand{\inline}[2][NONAME]{%
\ifthenelse{\equal{NONAME}{#1}}{% \ifthenelse{\equal{NONAME}{#1}}{%
% \anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}% \anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}%
\anonymousInlineDescriptorTemplate{#2}{Test}
\printLabel{#2}
}{% }{%
% \inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}% \inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}%
#2
} }
} }
\newcommand{\short}[2][__NONAME__]{% \newcommand{\short}[2][NONAME]{%
\ifthenelse{\equal{__NONAME__}{#1}}{% \ifthenelse{\equal{NONAME}{#1}}{%
\anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}%
}{% }{%
\shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}% \shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}%
@@ -754,7 +1054,7 @@
% ┌ ┐ % ┌ ┐
% │ STYLE: Computer Science │ % │ STYLE: Computer Science │
% └ ┘ % └ ┘
\RequirePackage{forest} \usepackage{forest}
\tikzset{algpxIndentLine/.style={draw=lightgray}} \tikzset{algpxIndentLine/.style={draw=lightgray}}
\algrenewcommand{\alglinenumber}[1]{#1} \algrenewcommand{\alglinenumber}[1]{#1}
@@ -770,313 +1070,4 @@
} }
\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}
}
\endinput \endinput

View File

@@ -22,21 +22,17 @@
% You may here configure how they are generated. #1 is the full name. % You may here configure how they are generated. #1 is the full name.
\newcommand{\shortDescriptorNameTemplate}[1]{\StrBefore[1]{#1}} \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. % Specify how the inline and short descriptors (e.g. Lemma, etc) are rendered.
% - #1 is the name of the descriptor % - #1 is the name of the descriptor
% - #2 is the number (correctly rendered according to settings and preceded with space if not disabled) % - #2 is the number (correctly rendered according to settings and preceded with space if not disabled)
% - #3 is the name passed (non-empty asserted) % - #3 is the name passed (non-empty asserted)
\newcommand{\shortDescriptorTemplate}[4]{\bg{#1color}{\shortDescriptorNameTemplate{#1}#2} \textit{(#3)}\ } \newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#1}} #2} \textit{(#3)}}
\newcommand{\inlineDescriptorTemplate}[4]{\bg{#1color}{#1#2}: \textit{(#3)}\ } \newcommand{\inlineDescriptorTemplate}[3]{\bg{#1color}{\namingTranslate{#1} #2}: \textit{(#3)}}
% These are used if no name is provided and argument #4 from above is the missing argument % 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{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#1}} #2}}
\newcommand{\anonymousInlineDescriptorTemplate}[3]{\bg{#3color}{#1#2}\ } \newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}}
% background command config (draws a small box around the content) % background command config (draws a small box around the content)
\newcommand{\backgroundPadding}{2pt} \newcommand{\backgroundPadding}{2pt}
\newcommand{\backgroundRounding}{0.1pt} \newcommand{\backgroundRounding}{1pt}

View File

@@ -32,3 +32,6 @@
\newcommand{\currentLanguage}{en} \newcommand{\currentLanguage}{en}
\setcounter{secnumdepth}{4} \setcounter{secnumdepth}{4}
\newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname}
\newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname}

View File

@@ -47,7 +47,38 @@
% └ ┘ % └ ┘
% Start document command (required) % Start document command (required)
\newcommand{\startDocument}{ \newcommand{\startDocument}{
% TODO: Cheat sheet needs different setup
\maketitle \maketitle
\pagestyle{fancy} \pagestyle{fancy}
\thispagestyle{fancy} \thispagestyle{fancy}
\tcbset{
mainboxstyle/.style={
arc=3mm,
colback=red!5!white,
colframe=red!75!black,
colbacktitle=red!75!black,
fonttitle=\bfseries,
enhanced,
attach boxed title to top left={yshift=-2mm,xshift=5mm},
breakable,
top=0.4cm,
}
}
\tikzset{
overlaystyle/.style={
draw=red!75!black,
thick,
fill=red!75!black,
left,
anchor=east,
text=white,
rounded corners=1mm,
font=\bfseries,
xshift=-5mm,
yshift=1mm,
inner xsep=3mm,
inner ysep=1.5mm
}
}
} }

View File

@@ -2,9 +2,10 @@
% │ Translation │ % │ Translation │
% └ ┘ % └ ┘
\newcommand{\translate}[2]{% \newcommand{\translate}[2]{%
\ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2} \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}%
} }
\newcommand{\tr}[2]{\translate{#1}{#2}} \newcommand{\tr}[2]{\translate{#1}{#2}}
\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionEN{#1}}}
% Translation aids (commonly used) % Translation aids (commonly used)
\newcommand{\trif}{\translate{if }{falls }} \newcommand{\trif}{\translate{if }{falls }}

View File

@@ -1,39 +1,6 @@
% ┌ ┐ % ┌ ┐
% │ STYLE: Globals │ % │ 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
% }
% }
% }
% ── Fonts ─────────────────────────────────────────────────────────── % ── Fonts ───────────────────────────────────────────────────────────
\newcommand{\setFont}[1]{\fontfamily{#1}\selectfont} \newcommand{\setFont}[1]{\fontfamily{#1}\selectfont}
\newcommand{\setFontType}[1]{ \newcommand{\setFontType}[1]{

View File

@@ -1,24 +1,23 @@
% ── Label generator ───────────────────────────────────────────────── % ── Label generator ─────────────────────────────────────────────────
\newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname} \newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname}
\newcommand{\printCounter}[1]{\csname the#1\endcsname} \newcommand{\printCounter}[1]{\refstepcounter{#1}\csname the#1\endcsname}
\newcommand{\printLabel}[1]{% \newcommand{\printLabel}[1]{%
\ifcsdef{#1numbering}{% Extra config present \ifcsdef{#1numbering}{% Extra config present
% TODO: Increment \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{%
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{
\printCounter{#1\subsectionnumbering}% \printCounter{#1\subsectionnumbering}%
}{ }{%
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{ \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{%
\printCounter{#1\subsectionnumbering}% \printCounter{#1\subsectionnumbering}%
}{ }{%
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{ \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{%
\printCounter{combined\subsectionnumbering}% \printCounter{combined\subsectionnumbering}%
}{} }{}%
} }%
} }%
}{% }{%
\labelPrintBackendRoutine{#1}% \labelPrintBackendRoutine{#1}%
} }%
} }
\newcommand{\labelPrintBackendRoutine}[1]{ \newcommand{\labelPrintBackendRoutine}[1]{
\ifthenelse{\equal{\numberingpreset}{combined}}{ \ifthenelse{\equal{\numberingpreset}{combined}}{
@@ -31,9 +30,6 @@
} }
% Inline environments (inline) % Inline environments (inline)
\newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname}
\newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname}
\newcommand{\inline}[2][NONAME]{% \newcommand{\inline}[2][NONAME]{%
\ifthenelse{\equal{NONAME}{#1}}{% \ifthenelse{\equal{NONAME}{#1}}{%
\anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}% \anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}%
@@ -42,8 +38,8 @@
} }
} }
\newcommand{\short}[2][__NONAME__]{% \newcommand{\short}[2][NONAME]{%
\ifthenelse{\equal{__NONAME__}{#1}}{% \ifthenelse{\equal{NONAME}{#1}}{%
\anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}%
}{% }{%
\shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}% \shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}%