diff --git a/build/build.py b/build/build.py index 676089f..2ba7ec9 100644 --- a/build/build.py +++ b/build/build.py @@ -29,7 +29,7 @@ def load_all_files_of_array(dirname: str, files: List[str]): data = "" for filename in files: with open(dirname + "/" + filename, "r") as file: - data += file.read() + "\n\n" + data += (file.read() + "\n\n").replace( 'RequirePackage', 'usepackage' ) return data @@ -39,13 +39,12 @@ if build_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/")) -output += load_all_files_of_array("../src/style/", os.listdir("../src/style/")) - l = labels.generate_labels() output += l[0] + "\n\n" 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" diff --git a/build/labels.py b/build/labels.py index 810ebb6..9978e55 100644 --- a/build/labels.py +++ b/build/labels.py @@ -23,15 +23,15 @@ def generate_labels(): reset_func += f" \\setcounter{{{label}section}}{{0}}\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" 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" 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" # Generate tcolorboxes @@ -52,7 +52,8 @@ def generate_labels(): }}; }}, #1 }}\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 += " \\setcounter{figure}{0}\n" diff --git a/janishutz-helpers.sty b/janishutz-helpers.sty index 7f655c2..4eb3aae 100644 --- a/janishutz-helpers.sty +++ b/janishutz-helpers.sty @@ -211,37 +211,37 @@ % │ 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} @@ -1077,4 +1077,4 @@ \setcounter{table}{0} \setcounter{figure}{0} } -\endinput \ No newline at end of file +\endinput diff --git a/janishutz-helpers.tex b/janishutz-helpers.tex index 8c40f78..ce02df0 100644 --- a/janishutz-helpers.tex +++ b/janishutz-helpers.tex @@ -13,33 +13,33 @@ % Package imports -\RequirePackage[table, dvipsnames]{xcolor} -\RequirePackage{amsmath} -\RequirePackage{graphicx} -\RequirePackage{subcaption} -\RequirePackage[export]{adjustbox} -\RequirePackage[most]{tcolorbox} -\RequirePackage{cancel} -\RequirePackage{dsfont} -\RequirePackage{amssymb} -\RequirePackage{mathrsfs} -\RequirePackage{lipsum} -\RequirePackage{ulem} -\RequirePackage{soul} -\RequirePackage{parskip} -\RequirePackage{fancyhdr} -\RequirePackage{lastpage} -\RequirePackage{tocloft} -\RequirePackage{wasysym} -\RequirePackage{wrapfig} -\RequirePackage{multicol} -\RequirePackage{ifthen} -\RequirePackage[hidelinks]{hyperref} -\RequirePackage{enumitem} -\RequirePackage{gensymb} -\RequirePackage{pifont} -\RequirePackage{xstring} -\RequirePackage{etoolbox} +\usepackage[table, dvipsnames]{xcolor} +\usepackage{amsmath} +\usepackage{graphicx} +\usepackage{subcaption} +\usepackage[export]{adjustbox} +\usepackage[most]{tcolorbox} +\usepackage{cancel} +\usepackage{dsfont} +\usepackage{amssymb} +\usepackage{mathrsfs} +\usepackage{lipsum} +\usepackage{ulem} +\usepackage{soul} +\usepackage{parskip} +\usepackage{fancyhdr} +\usepackage{lastpage} +\usepackage{tocloft} +\usepackage{wasysym} +\usepackage{wrapfig} +\usepackage{multicol} +\usepackage{ifthen} +\usepackage[hidelinks]{hyperref} +\usepackage{enumitem} +\usepackage{gensymb} +\usepackage{pifont} +\usepackage{xstring} +\usepackage{etoolbox} \newcounter{descriptorShadeStrength} \newcounter{shadeStrength} @@ -47,6 +47,9 @@ \setcounter{secnumdepth}{4} +\newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname} +\newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname} + % ┌ ┐ % │ General config │ @@ -72,24 +75,20 @@ % 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)}\ } +\newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#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 -\newcommand{\anonymousShortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{#1}#2}\ } -\newcommand{\anonymousInlineDescriptorTemplate}[3]{\bg{#3color}{#1#2}\ } +\newcommand{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#1}} #2}} +\newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}} % background command config (draws a small box around the content) \newcommand{\backgroundPadding}{2pt} -\newcommand{\backgroundRounding}{0.1pt} +\newcommand{\backgroundRounding}{1pt} % ┌ ┐ @@ -205,42 +204,318 @@ \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 │ % └ ┘ -% 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 ─────────────────────────────────────────────────────────── \newcommand{\setFont}[1]{\fontfamily{#1}\selectfont} \newcommand{\setFontType}[1]{ @@ -423,8 +698,8 @@ % For using index package \newcommand{\prepareIndex}{ - \RequirePackage[T1]{fontenc} - \RequirePackage{imakeidx} + \usepackage[T1]{fontenc} + \usepackage{imakeidx} \makeindex } @@ -438,8 +713,8 @@ % │ Tables │ % └ ┘ -\RequirePackage{booktabs} -\RequirePackage{tabulary} +\usepackage{booktabs} +\usepackage{tabulary} % Create new table. #1 Layout, #2 title row \newenvironment{tables}[2]{ @@ -470,9 +745,10 @@ % │ Translation │ % └ ┘ \newcommand{\translate}[2]{% - \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2} + \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}% } \newcommand{\tr}[2]{\translate{#1}{#2}} +\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionEN{#1}}} % Translation aids (commonly used) \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 \newcommand{\setup}[1]{ \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}} \author{\authorTitle} \makeatletter @@ -517,7 +793,7 @@ % Set up the latex document, only configuring the author, title and page size \newcommand{\setupBarebones}[1]{ - \RequirePackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} + \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} \title{\Huge \textbf{#1}} \author{\authorTitle} } @@ -526,7 +802,7 @@ % 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]{ - \RequirePackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} + \usepackage[a4paper,textwidth=20cm,textheight=28.5cm]{geometry} \title{\Huge \textbf{#1}} \author{\authorTitle} } @@ -537,9 +813,40 @@ % └ ┘ % Start document command (required) \newcommand{\startDocument}{ + % TODO: Cheat sheet needs different setup \maketitle \pagestyle{fancy} \thispagestyle{fancy} + + \tcbset{ + mainboxstyle/.style={ + arc=3mm, + colback=red!5!white, + colframe=red!75!black, + colbacktitle=red!75!black, + fonttitle=\bfseries, + enhanced, + attach boxed title to top left={yshift=-2mm,xshift=5mm}, + breakable, + top=0.4cm, + } + } + \tikzset{ + overlaystyle/.style={ + draw=red!75!black, + thick, + fill=red!75!black, + left, + anchor=east, + text=white, + rounded corners=1mm, + font=\bfseries, + xshift=-5mm, + yshift=1mm, + inner xsep=3mm, + inner ysep=1.5mm + } + } } @@ -549,13 +856,13 @@ % ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ % Extra imports -\RequirePackage{stmaryrd} -\RequirePackage{algorithm} -\RequirePackage{algpseudocodex} -\RequirePackage{setspace} -\RequirePackage{verbatim} -\RequirePackage{turnstile} -\RequirePackage{forloop} +\usepackage{stmaryrd} +\usepackage{algorithm} +\usepackage{algpseudocodex} +\usepackage{setspace} +\usepackage{verbatim} +\usepackage{turnstile} +\usepackage{forloop} \newcommand{\Indent}{\hspace{\algorithmicindent}} @@ -647,25 +954,24 @@ % ── Label generator ───────────────────────────────────────────────── \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]{% \ifcsdef{#1numbering}{% Extra config present - % TODO: Increment - \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{ + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{% \printCounter{#1\subsectionnumbering}% - }{ - \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{ + }{% + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{% \printCounter{#1\subsectionnumbering}% - }{ - \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{ + }{% + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{% \printCounter{combined\subsectionnumbering}% - }{} - } - } + }{}% + }% + }% }{% \labelPrintBackendRoutine{#1}% - } + }% } \newcommand{\labelPrintBackendRoutine}[1]{ \ifthenelse{\equal{\numberingpreset}{combined}}{ @@ -678,22 +984,16 @@ } % 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}}% - \anonymousInlineDescriptorTemplate{#2}{Test} - \printLabel{#2} + \anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}% }{% - % \inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}% - #2 + \inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}% } } -\newcommand{\short}[2][__NONAME__]{% - \ifthenelse{\equal{__NONAME__}{#1}}{% +\newcommand{\short}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% }{% \shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}% @@ -754,7 +1054,7 @@ % ┌ ┐ % │ STYLE: Computer Science │ % └ ┘ -\RequirePackage{forest} +\usepackage{forest} \tikzset{algpxIndentLine/.style={draw=lightgray}} \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 \ No newline at end of file diff --git a/src/config/00_main.sty b/src/config/00_main.sty index 4fbe26f..fd99a2c 100644 --- a/src/config/00_main.sty +++ b/src/config/00_main.sty @@ -22,21 +22,17 @@ % 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)}\ } +\newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#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 -\newcommand{\anonymousShortDescriptorTemplate}[3]{\bg{#1color}{\shortDescriptorNameTemplate{#1}#2}\ } -\newcommand{\anonymousInlineDescriptorTemplate}[3]{\bg{#3color}{#1#2}\ } +\newcommand{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortDescriptorNameTemplate{\namingTranslate{#1}} #2}} +\newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}} % background command config (draws a small box around the content) \newcommand{\backgroundPadding}{2pt} -\newcommand{\backgroundRounding}{0.1pt} +\newcommand{\backgroundRounding}{1pt} diff --git a/src/core.sty b/src/core.sty index ecd4898..038814a 100644 --- a/src/core.sty +++ b/src/core.sty @@ -32,3 +32,6 @@ \newcommand{\currentLanguage}{en} \setcounter{secnumdepth}{4} + +\newcommand{\printTranslationOptionEN}[1]{\csname #1NamingEN\endcsname} +\newcommand{\printTranslationOptionDE}[1]{\csname #1NamingDE\endcsname} diff --git a/src/core/setup.sty b/src/core/setup.sty index d29dc8e..7707e7e 100644 --- a/src/core/setup.sty +++ b/src/core/setup.sty @@ -47,7 +47,38 @@ % └ ┘ % Start document command (required) \newcommand{\startDocument}{ + % TODO: Cheat sheet needs different setup \maketitle \pagestyle{fancy} \thispagestyle{fancy} + + \tcbset{ + mainboxstyle/.style={ + arc=3mm, + colback=red!5!white, + colframe=red!75!black, + colbacktitle=red!75!black, + fonttitle=\bfseries, + enhanced, + attach boxed title to top left={yshift=-2mm,xshift=5mm}, + breakable, + top=0.4cm, + } + } + \tikzset{ + overlaystyle/.style={ + draw=red!75!black, + thick, + fill=red!75!black, + left, + anchor=east, + text=white, + rounded corners=1mm, + font=\bfseries, + xshift=-5mm, + yshift=1mm, + inner xsep=3mm, + inner ysep=1.5mm + } + } } diff --git a/src/core/translation.sty b/src/core/translation.sty index 1108eb4..48bf535 100644 --- a/src/core/translation.sty +++ b/src/core/translation.sty @@ -2,9 +2,10 @@ % │ Translation │ % └ ┘ \newcommand{\translate}[2]{% - \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2} + \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}% } \newcommand{\tr}[2]{\translate{#1}{#2}} +\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionEN{#1}}} % Translation aids (commonly used) \newcommand{\trif}{\translate{if }{falls }} diff --git a/src/style.sty b/src/style.sty index fe3ae85..1b99ce4 100644 --- a/src/style.sty +++ b/src/style.sty @@ -1,39 +1,6 @@ % ┌ ┐ % │ 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 ─────────────────────────────────────────────────────────── \newcommand{\setFont}[1]{\fontfamily{#1}\selectfont} \newcommand{\setFontType}[1]{ diff --git a/src/style/counters.sty b/src/style/counters.sty index 585c894..2f31b03 100644 --- a/src/style/counters.sty +++ b/src/style/counters.sty @@ -1,24 +1,23 @@ % ── Label generator ───────────────────────────────────────────────── \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]{% \ifcsdef{#1numbering}{% Extra config present - % TODO: Increment - \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{ + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{% \printCounter{#1\subsectionnumbering}% - }{ - \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{ + }{% + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{% \printCounter{#1\subsectionnumbering}% - }{ - \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{ + }{% + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{% \printCounter{combined\subsectionnumbering}% - }{} - } - } + }{}% + }% + }% }{% \labelPrintBackendRoutine{#1}% - } + }% } \newcommand{\labelPrintBackendRoutine}[1]{ \ifthenelse{\equal{\numberingpreset}{combined}}{ @@ -31,9 +30,6 @@ } % 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}}% @@ -42,8 +38,8 @@ } } -\newcommand{\short}[2][__NONAME__]{% - \ifthenelse{\equal{__NONAME__}{#1}}{% +\newcommand{\short}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% }{% \shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}%