diff --git a/janishutz-helpers.tex b/janishutz-helpers.tex index 25996ca..407db98 100644 --- a/janishutz-helpers.tex +++ b/janishutz-helpers.tex @@ -93,33 +93,6 @@ \colorlet{propertiescolor}{purple} -% ┌ ┐ -% │ General config │ -% └ ┘ -% Configure your author name here -\newcommand{\authorTitle}{Janis Hutz\\\url{https://janishutz.com}} -\newcommand{\authorHeaders}{Janis Hutz} - - -% ┌ ┐ -% │ Rendering │ -% └ ┘ -% 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}[3]{\bg{#1color}{\shortNamingTranslate{#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}[2]{\bg{#1color}{\shortNamingTranslate{#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}{1pt} - - % ┌ ┐ % │ Numbering │ % └ ┘ @@ -159,6 +132,33 @@ \newcommand{\propertiesnumbering}{default} +% ┌ ┐ +% │ General config │ +% └ ┘ +% Configure your author name here +\newcommand{\authorTitle}{Janis Hutz\\\url{https://janishutz.com}} +\newcommand{\authorHeaders}{Janis Hutz} + + +% ┌ ┐ +% │ Rendering │ +% └ ┘ +% 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}[3]{\bg{#1color}{\shortNamingTranslate{#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}[2]{\bg{#1color}{\shortNamingTranslate{#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}{1pt} + + % ┌ ┐ % │ Naming │ % └ ┘ @@ -667,27 +667,218 @@ \newcommand{\hlurl}[1]{\color{MidnightBlue}\fbox{\url{#1}}\color{black}} -% ___ _ _____ _ _ -% ( _ \ _( ) (_ _) ( ) ( ) -% | (_) )_) |_ | | __ \ \/ / -% | _ (| | _ \ | | / __ \ ) ( -% | (_) ) | |_) ) | | ( ___// /\ \ -% (____/(_)_ __/ (_) \____)_) (_) - -% Configs if you want to use BibTeX - -\newcommand{\setupBibtex}[1]{ - \usepackage{biblatex} - \usepackage[nottoc, numbib]{tocbibind} - \addbibresource{#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...} + \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} + \makeatletter + \makeatother + \fancyhead{} + \fancyhead[L]{#1} + \fancyhead[R]{\authorHeaders} + \fancyfoot{} + \fancyfoot[L]{\today} + \fancyfoot[R]{\thepage\ /\ \pageref{LastPage}} + \fancypagestyle{plain}{% + \fancyhead{} + \fancyhead[L]{#1} + \fancyhead[R]{\authorHeaders} + \fancyfoot{} + \fancyfoot[L]{\today} + \fancyfoot[R]{\thepage\ /\ \pageref{LastPage}} + } } -\newcommand{\printbib}{ - \addcontentsline{toc}{section}{\translate{Sources}{Quellen}} - \printbibliography[title=\translate{Sources}{Quellen}] +% Set up the latex document, only configuring the author, title and page size +\newcommand{\setupBarebones}[1]{ + \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} + \title{\Huge \textbf{#1}} + \author{\authorTitle} } +% Set up the latex document for exam summaries (Extra wide body, small margins, no header) +\newcommand{\setupCheatSheet}[2][true]{ + \ifthenelse{\equal{#1}{true}}{ + \usepackage[a4paper,textwidth=28.5cm,textheight=20cm,landscape]{geometry} + \usepackage{flowfram} + \ffvadjustfalse + \setlength{\columnsep}{1cm} + \Ncolumn{3} + }{ + \usepackage[a4paper,textwidth=28.5cm,textheight=20cm]{geometry} + } + \title{\Huge \textbf{#2}} + \author{\authorTitle} +} + + +% ┌ ┐ +% │ Document start │ +% └ ┘ +% 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 + } + } +} + + +% ┌ ┐ +% │ Minted │ +% └ ┘ +\usepackage{minted} +\usepackage{fancyvrb} + +% Args: Language, Code +\newenvironment{code}[1]{ + \VerbatimEnvironment + \begin{minted}[ + autogobble, + breaklines, + breakindentnchars=2, + frame=lines, + framesep=2mm, + mathescape, + baselinestretch=1.1, + linenos + ]{#1}} +{\end{minted}} + +% Args: Language, file relative to root file +\newcommand{\inputcode}[2]{ + \inputminted[ + autogobble, + breaklines, + breakindentnchars=2, + frame=lines, + framesep=2mm, + mathescape, + baselinestretch=1.1, + linenos + ]{#1}{#2} +} + +% Args: Language, Base directory (with trailing slash), file (no slash at start) +\newcommand{\inputcodewithfilename}[3]{ + \begin{figure}[h!] + \texttt{File: \detokenize{#3}} + \rmvspace + \inputcode{#1}{#2#3} + \end{figure} +} + + +% ┌ ┐ +% │ Translation │ +% └ ┘ +\newcommand{\translate}[2]{% + \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}% +} +\newcommand{\tr}[2]{\translate{#1}{#2}} +\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionDE{#1}}} +\newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionDE{#1}}} + +% 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 }} + + +% ┌ ┐ +% │ Index │ +% └ ┘ + +% For using index package +\newcommand{\prepareIndex}{ + \usepackage[T1]{fontenc} + \usepackage{imakeidx} + \makeindex +} + +\newcommand{\addIndexBold}[1]{\textbf{\index{\MakeLowercase{#1}} #1}} +\newcommand{\addIndexBI}[1]{\textbf\textit{{\index{\MakeLowercase{#1}} #1}}} +\newcommand{\addIndexItalic}[1]{\textit{\index{\MakeLowercase{#1}} #1}} +\newcommand{\addIndex}[1]{\index{\MakeLowercase{#1}} #1} + + + + +% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ +% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ +% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ + +% Extra imports +\usepackage{stmaryrd} +\usepackage{algorithm} +\usepackage{algpseudocodex} +\usepackage{setspace} +\usepackage{verbatim} +\usepackage{turnstile} +\usepackage{forloop} + +\newcommand{\Indent}{\hspace{\algorithmicindent}} + +\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}}} + + % ┌ ┐ % │ Math │ % └ ┘ @@ -784,69 +975,6 @@ \DeclareMathOperator\arcsinh{arcsinh} -% ┌ ┐ -% │ Minted │ -% └ ┘ -\usepackage{minted} -\usepackage{fancyvrb} - -% Args: Language, Code -\newenvironment{code}[1]{ - \VerbatimEnvironment - \begin{minted}[ - autogobble, - breaklines, - breakindentnchars=2, - frame=lines, - framesep=2mm, - mathescape, - baselinestretch=1.1, - linenos - ]{#1}} -{\end{minted}} - -% Args: Language, file relative to root file -\newcommand{\inputcode}[2]{ - \inputminted[ - autogobble, - breaklines, - breakindentnchars=2, - frame=lines, - framesep=2mm, - mathescape, - baselinestretch=1.1, - linenos - ]{#1}{#2} -} - -% Args: Language, Base directory (with trailing slash), file (no slash at start) -\newcommand{\inputcodewithfilename}[3]{ - \begin{figure}[h!] - \texttt{File: \detokenize{#3}} - \rmvspace - \inputcode{#1}{#2#3} - \end{figure} -} - - -% ┌ ┐ -% │ Index │ -% └ ┘ - -% For using index package -\newcommand{\prepareIndex}{ - \usepackage[T1]{fontenc} - \usepackage{imakeidx} - \makeindex -} - -\newcommand{\addIndexBold}[1]{\textbf{\index{\MakeLowercase{#1}} #1}} -\newcommand{\addIndexBI}[1]{\textbf\textit{{\index{\MakeLowercase{#1}} #1}}} -\newcommand{\addIndexItalic}[1]{\textit{\index{\MakeLowercase{#1}} #1}} -\newcommand{\addIndex}[1]{\index{\MakeLowercase{#1}} #1} - - - % ┌ ┐ % │ Tables │ % └ ┘ @@ -893,153 +1021,96 @@ } -% ┌ ┐ -% │ Translation │ -% └ ┘ -\newcommand{\translate}[2]{% - \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}% -} -\newcommand{\tr}[2]{\translate{#1}{#2}} -\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionDE{#1}}} -\newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionDE{#1}}} +% ___ _ _____ _ _ +% ( _ \ _( ) (_ _) ( ) ( ) +% | (_) )_) |_ | | __ \ \/ / +% | _ (| | _ \ | | / __ \ ) ( +% | (_) ) | |_) ) | | ( ___// /\ \ +% (____/(_)_ __/ (_) \____)_) (_) -% 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 }} +% Configs if you want to use BibTeX + +\newcommand{\setupBibtex}[1]{ + \usepackage{biblatex} + \usepackage[nottoc, numbib]{tocbibind} + \addbibresource{#1} +} + +\newcommand{\printbib}{ + \addcontentsline{toc}{section}{\translate{Sources}{Quellen}} + \printbibliography[title=\translate{Sources}{Quellen}] +} % ┌ ┐ -% │ Setup │ +% │ Counter numbering │ % └ ┘ -% Set up the latex document, configure author, title (as first argument), as well as headers and footers -\newcommand{\setup}[1]{ - \typeout{[Setup] Setting up...} - \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} - \title{\Huge \textbf{#1}} - \author{\authorTitle} - \makeatletter - \makeatother - \fancyhead{} - \fancyhead[L]{#1} - \fancyhead[R]{\authorHeaders} - \fancyfoot{} - \fancyfoot[L]{\today} - \fancyfoot[R]{\thepage\ /\ \pageref{LastPage}} - \fancypagestyle{plain}{% - \fancyhead{} - \fancyhead[L]{#1} - \fancyhead[R]{\authorHeaders} - \fancyfoot{} - \fancyfoot[L]{\today} - \fancyfoot[R]{\thepage\ /\ \pageref{LastPage}} - } +\newcommand{\preEnvHook}[1]{% + \stepLabelNumber{combined}% + \ifthenelse{\equal{\numberingpreset}{combined}}{% + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{ + \stepLabelNumber{combined}% + }{}% + }{% + \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{% + \stepLabelNumber{combined}% + }{}% + }% } -% Set up the latex document, only configuring the author, title and page size -\newcommand{\setupBarebones}[1]{ - \usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry} - \title{\Huge \textbf{#1}} - \author{\authorTitle} -} - - -% Set up the latex document for exam summaries (Extra wide body, small margins, no header) -\newcommand{\setupCheatSheet}[2][true]{ - \ifthenelse{\equal{#1}{true}}{ - \usepackage[a4paper,textwidth=28.5cm,textheight=20cm,landscape]{geometry} - \usepackage{flowfram} - \ffvadjustfalse - \setlength{\columnsep}{1cm} - \Ncolumn{3} +% Decides on the numbering to use (combined or not) +\newcommand{\loadNumberingConfiguration}{% + \ifthenelse{\boolean{numberingDisabled}}{% + \renewcommand{\thetable}{\arabic{table}} + \renewcommand{\thefigure}{\arabic{figure}} }{ - \usepackage[a4paper,textwidth=28.5cm,textheight=20cm]{geometry} - } - \title{\Huge \textbf{#2}} - \author{\authorTitle} + \ifthenelse{\equal{\numberingpreset}{combined}}{% + \ifthenelse{\equal{\subsectionnumbering}{none}}{ + \renewcommand{\thetable}{\arabic{combinednone}} + \renewcommand{\thefigure}{\arabic{combinednone}} + }{% + \renewcommand{\thetable}{\ssprinter.\arabic{combined\subsectionnumbering}} + \renewcommand{\thefigure}{\ssprinter.\arabic{combined\subsectionnumbering}} + }% + }{% + \ifthenelse{\equal{\numberingpreset}{separate}}{ + \ifthenelse{\equal{\subsectionnumbering}{none}}{}{ + \renewcommand{\thetable}{\ssprinter.\arabic{table}} + \renewcommand{\thefigure}{\ssprinter.\arabic{figure}} + } + }{% + \renewcommand{\thetable}{\arabic{table}} + \renewcommand{\thefigure}{\arabic{figure}} + }% + }% + }% } - -% ┌ ┐ -% │ Document start │ -% └ ┘ -% 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 - } - } +% Prints the preceding subsection numbers +\newcommand{\ssprinter}{\thesection} +\newcommand{\generateSubsection}{% + \ifthenelse{\equal{\subsectionnumbering}{section}}{% + \renewcommand{\ssprinter}{\thesection} + }{% + \ifthenelse{\equal{\subsectionnumbering}{subsection}}{% + \renewcommand{\ssprinter}{\thesubsection} + }{% + \ifthenelse{\equal{\subsectionnumbering}{subsubsection}}{% + \renewcommand{\ssprinter}{\thesubsubsection} + }{% + \ifthenelse{\equal{\subsectionnumbering}{paragraph}}{% + \renewcommand{\ssprinter}{\theparagraph} + }{ + \renewcommand{\ssprinter}{} + }% + }% + }% + }% } +\loadNumberingConfiguration - - -% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ -% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ -% ░▒█▄▄▀░░▀▀░░▀░░▒▀░█░░░░░▀▀▀░░▀░░▀▀▀░▀░▀▀░░░▒█▄▄▄█░▀▀▀░▀▀▀░▀▀▀░▀░░▀░▀▀▀░▀▀▀ - -% Extra imports -\usepackage{stmaryrd} -\usepackage{algorithm} -\usepackage{algpseudocodex} -\usepackage{setspace} -\usepackage{verbatim} -\usepackage{turnstile} -\usepackage{forloop} - -\newcommand{\Indent}{\hspace{\algorithmicindent}} - -\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}}} +\AtBeginEnvironment{table}{\preEnvHook{table}} +\AtBeginEnvironment{figure}{\preEnvHook{figure}} % ── Set the current number of a label ─────────────────────────────── @@ -1149,187 +1220,6 @@ } -% ┌ ┐ -% │ Counter numbering │ -% └ ┘ -\newcommand{\preEnvHook}[1]{% - \stepLabelNumber{combined}% - \ifthenelse{\equal{\numberingpreset}{combined}}{% - \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{ - \stepLabelNumber{combined}% - }{}% - }{% - \ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{% - \stepLabelNumber{combined}% - }{}% - }% -} - -% Decides on the numbering to use (combined or not) -\newcommand{\loadNumberingConfiguration}{% - \ifthenelse{\boolean{numberingDisabled}}{% - \renewcommand{\thetable}{\arabic{table}} - \renewcommand{\thefigure}{\arabic{figure}} - }{ - \ifthenelse{\equal{\numberingpreset}{combined}}{% - \ifthenelse{\equal{\subsectionnumbering}{none}}{ - \renewcommand{\thetable}{\arabic{combinednone}} - \renewcommand{\thefigure}{\arabic{combinednone}} - }{% - \renewcommand{\thetable}{\ssprinter.\arabic{combined\subsectionnumbering}} - \renewcommand{\thefigure}{\ssprinter.\arabic{combined\subsectionnumbering}} - }% - }{% - \ifthenelse{\equal{\numberingpreset}{separate}}{ - \ifthenelse{\equal{\subsectionnumbering}{none}}{}{ - \renewcommand{\thetable}{\ssprinter.\arabic{table}} - \renewcommand{\thefigure}{\ssprinter.\arabic{figure}} - } - }{% - \renewcommand{\thetable}{\arabic{table}} - \renewcommand{\thefigure}{\arabic{figure}} - }% - }% - }% -} - -% Prints the preceding subsection numbers -\newcommand{\ssprinter}{\thesection} -\newcommand{\generateSubsection}{% - \ifthenelse{\equal{\subsectionnumbering}{section}}{% - \renewcommand{\ssprinter}{\thesection} - }{% - \ifthenelse{\equal{\subsectionnumbering}{subsection}}{% - \renewcommand{\ssprinter}{\thesubsection} - }{% - \ifthenelse{\equal{\subsectionnumbering}{subsubsection}}{% - \renewcommand{\ssprinter}{\thesubsubsection} - }{% - \ifthenelse{\equal{\subsectionnumbering}{paragraph}}{% - \renewcommand{\ssprinter}{\theparagraph} - }{ - \renewcommand{\ssprinter}{} - }% - }% - }% - }% -} -\loadNumberingConfiguration - -\AtBeginEnvironment{table}{\preEnvHook{table}} -\AtBeginEnvironment{figure}{\preEnvHook{figure}} - - -% ┌ ┐ -% │ 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$} - - -\newcommand{\noverticalspacing}{ - \abovedisplayskip 1pt plus 2pt minus 1pt - \belowdisplayskip 1pt plus 2pt minus 1pt - \abovedisplayshortskip -10pt - \belowdisplayshortskip 1pt plus 2pt minus 1pt - \floatsep 1pt plus 2pt minus 1pt - \intextsep 1pt plus 2pt minus 1pt - \textfloatsep 1pt plus 2pt minus 1pt - \abovecaptionskip 2pt - \setlist{noitemsep,topsep=1pt,partopsep=0pt} -} -\newcommand{\smallverticalspacing}{ - \abovedisplayskip 4pt plus 3pt minus 2pt - \belowdisplayskip 5pt plus 5pt minus 2pt - \abovedisplayshortskip -5pt - \belowdisplayshortskip 3pt plus 4pt minus 2pt - \floatsep 4pt plus 3pt minus 2pt - \intextsep 4pt plus 3pt minus 2pt - \textfloatsep 4pt plus 3pt minus 2pt - \abovecaptionskip 4pt - \setlist{itemsep=2pt,topsep=2pt,partopsep=1pt} -} -\newcommand{\mediumverticalspacing}{ - \abovedisplayskip 7pt plus 4pt minus 3pt - \belowdisplayskip 9pt plus 6pt minus 3pt - \abovedisplayshortskip 0pt - \belowdisplayshortskip 5pt plus 4pt minus 2pt - \floatsep 7pt plus 4pt minus 3pt - \intextsep 7pt plus 4pt minus 3pt - \textfloatsep 7pt plus 4pt minus 3pt - \abovecaptionskip 7pt - \setlist{itemsep=4pt,topsep=4pt,partopsep=2pt} -} -\newcommand{\largeverticalspacing}{ - \abovedisplayskip 13pt plus 5pt minus 4pt - \belowdisplayskip 15pt plus 9pt minus 6pt - \abovedisplayshortskip 5pt plus 2pt minus 3pt - \belowdisplayshortskip 7pt plus 5pt minus 2pt - \floatsep 12pt plus 5pt minus 4pt - \intextsep 12pt plus 5pt minus 4pt - \textfloatsep 12pt plus 5pt minus 4pt - \abovecaptionskip 10pt - \setlist{itemsep=6pt,topsep=6pt,partopsep=2pt} -} - - -% ── Inline environments ───────────────────────────────────────────── -% TODO: ref label generation -\newcommand{\inline}[2][NONAME]{% - \ifthenelse{\equal{NONAME}{#1}}{% - \anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}% - }{% - \inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}% - }% -} - -\newcommand{\labeledInline}[3][NONAME]{% - \edef{\tempLabel}{#3} - \label{\tempLabel} - \inline[#1]{#2} -} - -\newcommand{\unnumberedInline}[2][NONAME]{% - \ifthenelse{\equal{NONAME}{#1}}{% - \anonymousInlineDescriptorTemplate{#2}{}% - }{% - \inlineDescriptorTemplate{#2}{}{#1}% - }% -} - -\newcommand{\short}[2][NONAME]{% - \ifthenelse{\equal{NONAME}{#1}}{% - \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% - }{% - \shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}% - }% -} - -\newcommand{\labeledShort}[3][NONAME]{% - \edef{\tempLabel}{#3} - \label{\tempLabel} - \short[#1]{#2} -} - -\newcommand{\unnumberedShort}[2][NONAME]{% - \ifthenelse{\equal{NONAME}{#1}}{% - \anonymousShortDescriptorTemplate{#2}{}% - }{% - \shortDescriptorTemplate{#2}{}{#1}% - }% -} - -\newcommand{\inlineproof}[1][NONAME]{\unnumberedInline[#1]{proof}} -\newcommand{\inlineterm}[1][NONAME]{\unnumberedInline[#1]{term}} - -\newcommand{\shortproof}[1][NONAME]{\unnumberedShort[#1]{proof}} -\newcommand{\shortterm}[1][NONAME]{\unnumberedShort[#1]{term}} - - % ┌ ┐ % │ STYLE: Common tcolorboxes │ % └ ┘ @@ -1399,4 +1289,116 @@ } +% ┌ ┐ +% │ 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$} + + +% ── Inline environments ───────────────────────────────────────────── +% TODO: ref label generation +\newcommand{\inline}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% + \anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}% + }{% + \inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}% + }% +} + +\newcommand{\labeledInline}[3][NONAME]{% + \edef{\tempLabel}{#3} + \label{\tempLabel} + \inline[#1]{#2} +} + +\newcommand{\unnumberedInline}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% + \anonymousInlineDescriptorTemplate{#2}{}% + }{% + \inlineDescriptorTemplate{#2}{}{#1}% + }% +} + +\newcommand{\short}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% + \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% + }{% + \shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}% + }% +} + +\newcommand{\labeledShort}[3][NONAME]{% + \edef{\tempLabel}{#3} + \label{\tempLabel} + \short[#1]{#2} +} + +\newcommand{\unnumberedShort}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% + \anonymousShortDescriptorTemplate{#2}{}% + }{% + \shortDescriptorTemplate{#2}{}{#1}% + }% +} + +\newcommand{\inlineproof}[1][NONAME]{\unnumberedInline[#1]{proof}} +\newcommand{\inlineterm}[1][NONAME]{\unnumberedInline[#1]{term}} +\newcommand{\inlinenotation}[1][NONAME]{\unnumberedInline[#1]{notation}} + +\newcommand{\shortproof}[1][NONAME]{\unnumberedShort[#1]{proof}} +\newcommand{\shortterm}[1][NONAME]{\unnumberedShort[#1]{term}} +\newcommand{\shortnotation}[1][NONAME]{\unnumberedShort[#1]{notation}} + + +\newcommand{\noverticalspacing}{ + \abovedisplayskip 1pt plus 2pt minus 1pt + \belowdisplayskip 1pt plus 2pt minus 1pt + \abovedisplayshortskip -10pt + \belowdisplayshortskip 1pt plus 2pt minus 1pt + \floatsep 1pt plus 2pt minus 1pt + \intextsep 1pt plus 2pt minus 1pt + \textfloatsep 1pt plus 2pt minus 1pt + \abovecaptionskip 2pt + \setlist{noitemsep,topsep=1pt,partopsep=0pt} +} +\newcommand{\smallverticalspacing}{ + \abovedisplayskip 4pt plus 3pt minus 2pt + \belowdisplayskip 5pt plus 5pt minus 2pt + \abovedisplayshortskip -5pt + \belowdisplayshortskip 3pt plus 4pt minus 2pt + \floatsep 4pt plus 3pt minus 2pt + \intextsep 4pt plus 3pt minus 2pt + \textfloatsep 4pt plus 3pt minus 2pt + \abovecaptionskip 4pt + \setlist{itemsep=2pt,topsep=2pt,partopsep=1pt} +} +\newcommand{\mediumverticalspacing}{ + \abovedisplayskip 7pt plus 4pt minus 3pt + \belowdisplayskip 9pt plus 6pt minus 3pt + \abovedisplayshortskip 0pt + \belowdisplayshortskip 5pt plus 4pt minus 2pt + \floatsep 7pt plus 4pt minus 3pt + \intextsep 7pt plus 4pt minus 3pt + \textfloatsep 7pt plus 4pt minus 3pt + \abovecaptionskip 7pt + \setlist{itemsep=4pt,topsep=4pt,partopsep=2pt} +} +\newcommand{\largeverticalspacing}{ + \abovedisplayskip 13pt plus 5pt minus 4pt + \belowdisplayskip 15pt plus 9pt minus 6pt + \abovedisplayshortskip 5pt plus 2pt minus 3pt + \belowdisplayshortskip 7pt plus 5pt minus 2pt + \floatsep 12pt plus 5pt minus 4pt + \intextsep 12pt plus 5pt minus 4pt + \textfloatsep 12pt plus 5pt minus 4pt + \abovecaptionskip 10pt + \setlist{itemsep=6pt,topsep=6pt,partopsep=2pt} +} + + \endinput \ No newline at end of file diff --git a/src/style/environments-descriptors.sty b/src/style/environments-descriptors.sty index d6e3bde..24e7b3e 100644 --- a/src/style/environments-descriptors.sty +++ b/src/style/environments-descriptors.sty @@ -46,6 +46,8 @@ \newcommand{\inlineproof}[1][NONAME]{\unnumberedInline[#1]{proof}} \newcommand{\inlineterm}[1][NONAME]{\unnumberedInline[#1]{term}} +\newcommand{\inlinenotation}[1][NONAME]{\unnumberedInline[#1]{notation}} \newcommand{\shortproof}[1][NONAME]{\unnumberedShort[#1]{proof}} \newcommand{\shortterm}[1][NONAME]{\unnumberedShort[#1]{term}} +\newcommand{\shortnotation}[1][NONAME]{\unnumberedShort[#1]{notation}}