Compare commits

13 Commits

Author SHA1 Message Date
8d1638eeef [Spacing] Title spacing
All checks were successful
Update helpers / build_helpers (push) Successful in 24s
2026-03-02 11:49:09 +01:00
Helpers compiler [bot]
2ca478cf27 [skip ci] Build helpers on push 2026-03-01 14:53:47 +00:00
03ee657e1f [Core] Add better translation command
All checks were successful
Update docs / build_docs (push) Successful in 29s
Update helpers / build_helpers (push) Successful in 21s
2026-03-01 15:52:53 +01:00
Helpers compiler [bot]
96a8806ba1 [skip ci] Build helpers on push 2026-02-28 13:23:48 +00:00
591ee520fa [Style] Make paragraph insert newline
All checks were successful
Update helpers / build_helpers (push) Successful in 21s
2026-02-28 14:23:23 +01:00
39dac1bdc3 [CI] Update 2026-02-28 12:02:17 +01:00
5870830fb4 [Config] Fix issue 2026-02-28 12:00:51 +01:00
Helpers compiler [bot]
c1fc735c52 [skip ci] Build helpers on push 2026-02-28 10:32:18 +00:00
52b4b2916a [Spacing] Fixes
All checks were successful
Update helpers / build_helpers (push) Successful in 40s
2026-02-28 11:31:11 +01:00
Helpers compiler [bot]
7a7c744344 [skip ci] Build helpers on push 2026-02-25 18:46:02 +00:00
4edab93a9f [General] Add more aliases
All checks were successful
Update helpers / build_helpers (push) Successful in 23s
2026-02-25 18:23:03 +01:00
449ad7d31f [Snippets] Improve 2026-02-24 12:20:26 +01:00
add7e1d934 [Snippets] Fix bad snippet 2026-02-24 12:19:06 +01:00
11 changed files with 371 additions and 299 deletions

View File

@@ -3,6 +3,7 @@ on:
push: push:
paths: paths:
- 'src/**' - 'src/**'
- 'config/**'
jobs: jobs:
build_helpers: build_helpers:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -14,7 +14,7 @@
% - #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}[3]{\bg{#1color}{\shortNamingTranslate{#1} #2} \textit{(#3)}} \newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortNamingTranslate{#1} #2} \textit{(#3)}}
\newcommand{\inlineDescriptorTemplate}[3]{\bg{#1color}{\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 % 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{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortNamingTranslate{#1} #2}\ }

View File

@@ -51,6 +51,7 @@
\item \verb|\startDocument| Initialize the document. Has to be called after \verb|\begin{document}| \item \verb|\startDocument| Initialize the document. Has to be called after \verb|\begin{document}|
\item \verb|\translate|\{\textit{string}\}\{\textit{string}\} First \textit{string} is English, second \textit{string} is German. Switches automatically based on language selected \item \verb|\translate|\{\textit{string}\}\{\textit{string}\} First \textit{string} is English, second \textit{string} is German. Switches automatically based on language selected
\item \verb|\tr|\{\textit{string}\}\{\textit{string}\} Shorthand for \verb|\translate| \item \verb|\tr|\{\textit{string}\}\{\textit{string}\} Shorthand for \verb|\translate|
\item \verb|\safetr|\{\textit{string}\}\{\textit{string}\} Shorthand for \verb|\translate|, safe to use in section titles
\item \verb|\numberingOn| Turn on the numbering (if previously turned off using \verb|\numberingOff| or set in the config) \item \verb|\numberingOn| Turn on the numbering (if previously turned off using \verb|\numberingOff| or set in the config)
\item \verb|\numberingOff| Turn off the numbering (useful to temporarily turn off numbering) \item \verb|\numberingOff| Turn off the numbering (useful to temporarily turn off numbering)
\end{itemize} \end{itemize}

View File

@@ -20,5 +20,11 @@ You have set the \textit{scope} to \texttt{full}, which loads the \texttt{minted
\subsubsection{You must have pygmentize installed} \subsubsection{You must have pygmentize installed}
Your host system is lacking the \texttt{pygmentize} package or you have not added the \texttt{pip} path to your \$PATH. This is also the reason as to why the \texttt{-shell-escape} flag has to be set, as minted needs to access external libraries (namely \texttt{pygmentize}) to do the syntax highlighting. Your host system is lacking the \texttt{pygmentize} package or you have not added the \texttt{pip} path to your \$PATH. This is also the reason as to why the \texttt{-shell-escape} flag has to be set, as minted needs to access external libraries (namely \texttt{pygmentize}) to do the syntax highlighting.
\subsection{Undefined command equal}
If you see an error like this, you likely are using either \verb|\translate| or \verb|\tr| in a \verb|\section| or similar command.
Due to the way \LaTeX\ code is evaluated, you should prefer using \verb|\safetr| instead,
which uses \texttt{etoolbox}'s \verb|\protecting| command to stop this issue from occurring
\subsection{Any other error} \subsection{Any other error}
Ensure that you are not missing any closing brackets or a math environment is still open. If nothing helps, contact support at \url{https://support.janishutz.com} Ensure that you are not missing any closing brackets or a math environment is still open. If nothing helps, contact support at \url{https://support.janishutz.com}

View File

@@ -41,6 +41,7 @@
\usepackage{etoolbox} \usepackage{etoolbox}
\usepackage{makecell} \usepackage{makecell}
\usepackage{parskip} \usepackage{parskip}
\usepackage{titlesec}
\newcounter{descriptorShadeStrength} \newcounter{descriptorShadeStrength}
\newcounter{shadeStrength} \newcounter{shadeStrength}
@@ -93,72 +94,6 @@
\colorlet{propertiescolor}{purple} \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 │
% └ ┘
% Set a preset, can be combined, separate or off.
% If set to custom, all type specific commands need to be set below.
\newcommand{\numberingpreset}{combined}
% Specify how elements are to be numbered. Can be (X is the current number of the element):
% - none (X)
% - section (section.X)
% - subsection (section.subsection.X)
% - subsubsection (section.subsection.subsubsection.X)
% - paragraph (section.subsection.subsubsection.paragraph.X)
\newcommand{\subsectionnumbering}{subsection}
% Set for a specific type. Can each be combined, separate, default or off:
% If set to anything but 'default', it will override the overarching style
% set by \numberingpreset
\newcommand{\definitionnumbering}{default}
\newcommand{\theoremnumbering}{default}
\newcommand{\lemmanumbering}{default}
\newcommand{\corollarynumbering}{default}
\newcommand{\axiomnumbering}{default}
\newcommand{\factnumbering}{default}
\newcommand{\propositionnumbering}{default}
\newcommand{\examplenumbering}{default}
\newcommand{\formulanumbering}{default}
\newcommand{\remarknumbering}{default}
\newcommand{\proofnumbering}{default}
\newcommand{\intuitionnumbering}{default}
\newcommand{\termnumbering}{default}
\newcommand{\notationnumbering}{default}
\newcommand{\tasknumbering}{default}
\newcommand{\usagenumbering}{default}
\newcommand{\recallnumbering}{default}
\newcommand{\propertiesnumbering}{default}
% ┌ ┐ % ┌ ┐
% │ Naming │ % │ Naming │
% └ ┘ % └ ┘
@@ -242,6 +177,72 @@
\newcommand{\propertiesShortNamingDE}{E} \newcommand{\propertiesShortNamingDE}{E}
% ┌ ┐
% │ Numbering │
% └ ┘
% Set a preset, can be combined, separate or off.
% If set to custom, all type specific commands need to be set below.
\newcommand{\numberingpreset}{combined}
% Specify how elements are to be numbered. Can be (X is the current number of the element):
% - none (X)
% - section (section.X)
% - subsection (section.subsection.X)
% - subsubsection (section.subsection.subsubsection.X)
% - paragraph (section.subsection.subsubsection.paragraph.X)
\newcommand{\subsectionnumbering}{subsection}
% Set for a specific type. Can each be combined, separate, default or off:
% If set to anything but 'default', it will override the overarching style
% set by \numberingpreset
\newcommand{\definitionnumbering}{default}
\newcommand{\theoremnumbering}{default}
\newcommand{\lemmanumbering}{default}
\newcommand{\corollarynumbering}{default}
\newcommand{\axiomnumbering}{default}
\newcommand{\factnumbering}{default}
\newcommand{\propositionnumbering}{default}
\newcommand{\examplenumbering}{default}
\newcommand{\formulanumbering}{default}
\newcommand{\remarknumbering}{default}
\newcommand{\proofnumbering}{default}
\newcommand{\intuitionnumbering}{default}
\newcommand{\termnumbering}{default}
\newcommand{\notationnumbering}{default}
\newcommand{\tasknumbering}{default}
\newcommand{\usagenumbering}{default}
\newcommand{\recallnumbering}{default}
\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}
\newcounter{definitionnone} \newcounter{definitionnone}
\newcounter{definitionsection}[section] \newcounter{definitionsection}[section]
\renewcommand{\thedefinitionsection}{\thesection.\arabic{definitionsection}} \renewcommand{\thedefinitionsection}{\thesection.\arabic{definitionsection}}
@@ -666,6 +667,14 @@
% Same for urls (just one arg tho) % Same for urls (just one arg tho)
\newcommand{\hlurl}[1]{\color{MidnightBlue}\fbox{\url{#1}}\color{black}} \newcommand{\hlurl}[1]{\color{MidnightBlue}\fbox{\url{#1}}\color{black}}
\makeatletter
\renewcommand\paragraph{%
\@startsection{paragraph}{4}{0mm}%
{-\baselineskip}%
{.5\baselineskip}%
{\normalfont\normalsize\bfseries}}
\makeatother
% ___ _ _____ _ _ % ___ _ _____ _ _
% ( _ \ _( ) (_ _) ( ) ( ) % ( _ \ _( ) (_ _) ( ) ( )
@@ -688,6 +697,20 @@
} }
% Add glossaries functionality
\newcommand{\setupGlossary}{
\usepackage[nonumberlist, toc]{glossaries}
\usepackage[nottoc, numbib]{tocbibind}
\makenoidxglossaries
}
\newcommand{\printGlossary}{
\glsaddall
\printnoidxglossaries
}
% ┌ ┐ % ┌ ┐
% │ Math │ % │ Math │
% └ ┘ % └ ┘
@@ -829,94 +852,6 @@
} }
% ┌ ┐
% │ 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 │
% └ ┘
\usepackage{booktabs}
\usepackage{tabulary}
% Create new table. #1 Layout, #2 title row
\newenvironment{tables}[2]{
\begin{center}
\begin{tabular}{#1}
\toprule
#2 \\
\midrule
}{
\bottomrule
\end{tabular}
\end{center}
}
% Create new table in table env. #1 layout, #2 title row, #3 caption
\newenvironment{fullTable}[3]{
\edef\tableCaption{#3}
\begin{table}[h!]
\begin{tables}{#1}{#2}
}{
\end{tables}
\caption{\tableCaption}
\end{table}
}
% Add glossaries functionality
\newcommand{\setupGlossary}{
\usepackage[nonumberlist, toc]{glossaries}
\usepackage[nottoc, numbib]{tocbibind}
\makenoidxglossaries
}
\newcommand{\printGlossary}{
\glsaddall
\printnoidxglossaries
}
% ┌ ┐
% │ 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 }}
% ┌ ┐ % ┌ ┐
% │ Setup │ % │ Setup │
% └ ┘ % └ ┘
@@ -1010,6 +945,49 @@
} }
% ┌ ┐
% │ Translation │
% └ ┘
\newcommand{\translate}[2]{%
\ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}%
}
\newcommand{\tr}[2]{\translate{#1}{#2}}
\newcommand{\safetr}[2]{\protecting{\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}
% ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀ % ░▒█▀▀▄░▄▀▀▄░█▀▄▀█░▄▀▀▄░█░▒█░▀█▀░█▀▀░█▀▀▄░░░▒█▀▀▀█░█▀▄░░▀░░█▀▀░█▀▀▄░█▀▄░█▀▀
% ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀ % ░▒█░░░░█░░█░█░▀░█░█▄▄█░█░▒█░░█░░█▀▀░█▄▄▀░░░░▀▀▀▄▄░█░░░░█▀░█▀▀░█░▒█░█░░░█▀▀
@@ -1042,6 +1020,109 @@
\newcommand{\class}{\text{\tr{Cl}{Kl}}} \newcommand{\class}{\text{\tr{Cl}{Kl}}}
% ┌ ┐
% │ Tables │
% └ ┘
\usepackage{booktabs}
\usepackage{tabulary}
% Create new table. #1 Layout, #2 title row
\newenvironment{tables}[2]{
\begin{center}
\begin{tabular}{#1}
\toprule
#2 \\
\midrule
}{
\bottomrule
\end{tabular}
\end{center}
}
% Create new table in table env. #1 layout, #2 title row, #3 caption
\newenvironment{fullTable}[3]{
\edef\tableCaption{#3}
\begin{table}[h!]
\begin{tables}{#1}{#2}
}{
\end{tables}
\caption{\tableCaption}
\end{table}
}
% ┌ ┐
% │ 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}}
% ── Set the current number of a label ─────────────────────────────── % ── Set the current number of a label ───────────────────────────────
\newcommand{\setLabelNumber}[2]{% \newcommand{\setLabelNumber}[2]{%
\setcounter{#1none}{#2}% \setcounter{#1none}{#2}%
@@ -1149,89 +1230,11 @@
} }
% ┌ ┐
% │ 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}{ \newcommand{\noverticalspacing}{
\titlespacing*{\section}{0pt}{2pt plus 2pt minus 1pt}{2pt plus 2pt minus 2pt}
\titlespacing*{\subsection}{0pt}{1pt plus 2pt minus 1pt}{1pt plus 2pt minus 1pt}
\titlespacing*{\subsubsection}{0pt}{1pt plus 1pt minus 1pt}{1pt plus 1pt minus 1pt}
\titlespacing*{\paragraph}{0pt}{0pt plus 1pt minus 0pt}{1pt plus 0pt minus 1pt}
\abovedisplayskip 1pt plus 2pt minus 1pt \abovedisplayskip 1pt plus 2pt minus 1pt
\belowdisplayskip 1pt plus 2pt minus 1pt \belowdisplayskip 1pt plus 2pt minus 1pt
\abovedisplayshortskip -10pt \abovedisplayshortskip -10pt
@@ -1239,10 +1242,15 @@
\floatsep 1pt plus 2pt minus 1pt \floatsep 1pt plus 2pt minus 1pt
\intextsep 1pt plus 2pt minus 1pt \intextsep 1pt plus 2pt minus 1pt
\textfloatsep 1pt plus 2pt minus 1pt \textfloatsep 1pt plus 2pt minus 1pt
\multicolsep 1pt plus 2pt minus 1pt
\abovecaptionskip 2pt \abovecaptionskip 2pt
\setlist{noitemsep,topsep=1pt,partopsep=0pt} \setlist{noitemsep,topsep=1pt,partopsep=0pt}
} }
\newcommand{\smallverticalspacing}{ \newcommand{\smallverticalspacing}{
\titlespacing*{\section}{0pt}{4pt plus 3pt minus 2pt}{3pt plus 2pt minus 1pt}
\titlespacing*{\subsection}{0pt}{3pt plus 2pt minus 1pt}{2pt plus 2pt minus 0pt}
\titlespacing*{\subsubsection}{0pt}{2pt plus 2pt minus 1pt}{2pt plus 1pt minus 0pt}
\titlespacing*{\paragraph}{0pt}{1pt plus 1pt minus 1pt}{1pt plus 0pt minus 0pt}
\abovedisplayskip 4pt plus 3pt minus 2pt \abovedisplayskip 4pt plus 3pt minus 2pt
\belowdisplayskip 5pt plus 5pt minus 2pt \belowdisplayskip 5pt plus 5pt minus 2pt
\abovedisplayshortskip -5pt \abovedisplayshortskip -5pt
@@ -1250,10 +1258,15 @@
\floatsep 4pt plus 3pt minus 2pt \floatsep 4pt plus 3pt minus 2pt
\intextsep 4pt plus 3pt minus 2pt \intextsep 4pt plus 3pt minus 2pt
\textfloatsep 4pt plus 3pt minus 2pt \textfloatsep 4pt plus 3pt minus 2pt
\multicolsep 4pt plus 3pt minus 2pt
\abovecaptionskip 4pt \abovecaptionskip 4pt
\setlist{itemsep=2pt,topsep=2pt,partopsep=1pt} \setlist{itemsep=2pt,topsep=2pt,partopsep=1pt}
} }
\newcommand{\mediumverticalspacing}{ \newcommand{\mediumverticalspacing}{
\titlespacing*{\section}{0pt}{6pt plus 2pt minus 2pt}{4pt plus 2pt minus 2pt}
\titlespacing*{\subsection}{0pt}{4pt plus 2pt minus 2pt}{3pt plus 2pt minus 1pt}
\titlespacing*{\subsubsection}{0pt}{3pt plus 1pt minus 1pt}{2pt plus 1pt minus 0pt}
\titlespacing*{\paragraph}{0pt}{2pt plus 1pt minus 1pt}{1pt plus 0pt minus 0pt}
\abovedisplayskip 7pt plus 4pt minus 3pt \abovedisplayskip 7pt plus 4pt minus 3pt
\belowdisplayskip 9pt plus 6pt minus 3pt \belowdisplayskip 9pt plus 6pt minus 3pt
\abovedisplayshortskip 0pt \abovedisplayshortskip 0pt
@@ -1261,10 +1274,15 @@
\floatsep 7pt plus 4pt minus 3pt \floatsep 7pt plus 4pt minus 3pt
\intextsep 7pt plus 4pt minus 3pt \intextsep 7pt plus 4pt minus 3pt
\textfloatsep 7pt plus 4pt minus 3pt \textfloatsep 7pt plus 4pt minus 3pt
\multicolsep 7pt plus 4pt minus 3pt
\abovecaptionskip 7pt \abovecaptionskip 7pt
\setlist{itemsep=4pt,topsep=4pt,partopsep=2pt} \setlist{itemsep=4pt,topsep=4pt,partopsep=2pt}
} }
\newcommand{\largeverticalspacing}{ \newcommand{\largeverticalspacing}{
\titlespacing*{\section}{0pt}{8pt plus 2pt minus 4pt}{5pt plus 2pt minus 3pt}
\titlespacing*{\subsection}{0pt}{6pt plus 2pt minus 3pt}{4pt plus 2pt minus 2pt}
\titlespacing*{\subsubsection}{0pt}{4pt plus 1pt minus 2pt}{3pt plus 1pt minus 1pt}
\titlespacing*{\paragraph}{0pt}{3pt plus 1pt minus 1pt}{2pt plus 1pt minus 1pt}
\abovedisplayskip 13pt plus 5pt minus 4pt \abovedisplayskip 13pt plus 5pt minus 4pt
\belowdisplayskip 15pt plus 9pt minus 6pt \belowdisplayskip 15pt plus 9pt minus 6pt
\abovedisplayshortskip 5pt plus 2pt minus 3pt \abovedisplayshortskip 5pt plus 2pt minus 3pt
@@ -1272,64 +1290,12 @@
\floatsep 12pt plus 5pt minus 4pt \floatsep 12pt plus 5pt minus 4pt
\intextsep 12pt plus 5pt minus 4pt \intextsep 12pt plus 5pt minus 4pt
\textfloatsep 12pt plus 5pt minus 4pt \textfloatsep 12pt plus 5pt minus 4pt
\multicolsep 12pt plus 5pt minus 4pt
\abovecaptionskip 10pt \abovecaptionskip 10pt
\setlist{itemsep=6pt,topsep=6pt,partopsep=2pt} \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 │ % │ STYLE: Common tcolorboxes │
% └ ┘ % └ ┘
@@ -1380,6 +1346,72 @@
\newtcolorbox{simplebox}[2][]{colback=#2!5!white,colframe=#2!75!black,#1} \newtcolorbox{simplebox}[2][]{colback=#2!5!white,colframe=#2!75!black,#1}
% ┌ ┐
% │ 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}}
% ┌ ┐ % ┌ ┐
% │ STYLE: Computer Science │ % │ STYLE: Computer Science │
% └ ┘ % └ ┘

View File

@@ -27,6 +27,7 @@
\RequirePackage{etoolbox} \RequirePackage{etoolbox}
\RequirePackage{makecell} \RequirePackage{makecell}
\RequirePackage{parskip} \RequirePackage{parskip}
\RequirePackage{titlesec}
\newcounter{descriptorShadeStrength} \newcounter{descriptorShadeStrength}
\newcounter{shadeStrength} \newcounter{shadeStrength}

View File

@@ -5,6 +5,7 @@
\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{\safetr}[2]{\protecting{\translate{#1}{#2}}}
\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionDE{#1}}} \newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionDE{#1}}}
\newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionDE{#1}}} \newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionDE{#1}}}

View File

@@ -80,3 +80,11 @@
% Same for urls (just one arg tho) % Same for urls (just one arg tho)
\newcommand{\hlurl}[1]{\color{MidnightBlue}\fbox{\url{#1}}\color{black}} \newcommand{\hlurl}[1]{\color{MidnightBlue}\fbox{\url{#1}}\color{black}}
\makeatletter
\renewcommand\paragraph{%
\@startsection{paragraph}{4}{0mm}%
{-\baselineskip}%
{.5\baselineskip}%
{\normalfont\normalsize\bfseries}}
\makeatother

View File

@@ -46,6 +46,8 @@
\newcommand{\inlineproof}[1][NONAME]{\unnumberedInline[#1]{proof}} \newcommand{\inlineproof}[1][NONAME]{\unnumberedInline[#1]{proof}}
\newcommand{\inlineterm}[1][NONAME]{\unnumberedInline[#1]{term}} \newcommand{\inlineterm}[1][NONAME]{\unnumberedInline[#1]{term}}
\newcommand{\inlinenotation}[1][NONAME]{\unnumberedInline[#1]{notation}}
\newcommand{\shortproof}[1][NONAME]{\unnumberedShort[#1]{proof}} \newcommand{\shortproof}[1][NONAME]{\unnumberedShort[#1]{proof}}
\newcommand{\shortterm}[1][NONAME]{\unnumberedShort[#1]{term}} \newcommand{\shortterm}[1][NONAME]{\unnumberedShort[#1]{term}}
\newcommand{\shortnotation}[1][NONAME]{\unnumberedShort[#1]{notation}}

View File

@@ -1,4 +1,8 @@
\newcommand{\noverticalspacing}{ \newcommand{\noverticalspacing}{
\titlespacing*{\section}{0pt}{2pt plus 2pt minus 1pt}{2pt plus 2pt minus 2pt}
\titlespacing*{\subsection}{0pt}{1pt plus 2pt minus 1pt}{1pt plus 2pt minus 1pt}
\titlespacing*{\subsubsection}{0pt}{1pt plus 1pt minus 1pt}{1pt plus 1pt minus 1pt}
\titlespacing*{\paragraph}{0pt}{0pt plus 1pt minus 0pt}{1pt plus 0pt minus 1pt}
\abovedisplayskip 1pt plus 2pt minus 1pt \abovedisplayskip 1pt plus 2pt minus 1pt
\belowdisplayskip 1pt plus 2pt minus 1pt \belowdisplayskip 1pt plus 2pt minus 1pt
\abovedisplayshortskip -10pt \abovedisplayshortskip -10pt
@@ -6,10 +10,15 @@
\floatsep 1pt plus 2pt minus 1pt \floatsep 1pt plus 2pt minus 1pt
\intextsep 1pt plus 2pt minus 1pt \intextsep 1pt plus 2pt minus 1pt
\textfloatsep 1pt plus 2pt minus 1pt \textfloatsep 1pt plus 2pt minus 1pt
\multicolsep 1pt plus 2pt minus 1pt
\abovecaptionskip 2pt \abovecaptionskip 2pt
\setlist{noitemsep,topsep=1pt,partopsep=0pt} \setlist{noitemsep,topsep=1pt,partopsep=0pt}
} }
\newcommand{\smallverticalspacing}{ \newcommand{\smallverticalspacing}{
\titlespacing*{\section}{0pt}{4pt plus 3pt minus 2pt}{3pt plus 2pt minus 1pt}
\titlespacing*{\subsection}{0pt}{3pt plus 2pt minus 1pt}{2pt plus 2pt minus 0pt}
\titlespacing*{\subsubsection}{0pt}{2pt plus 2pt minus 1pt}{2pt plus 1pt minus 0pt}
\titlespacing*{\paragraph}{0pt}{1pt plus 1pt minus 1pt}{1pt plus 0pt minus 0pt}
\abovedisplayskip 4pt plus 3pt minus 2pt \abovedisplayskip 4pt plus 3pt minus 2pt
\belowdisplayskip 5pt plus 5pt minus 2pt \belowdisplayskip 5pt plus 5pt minus 2pt
\abovedisplayshortskip -5pt \abovedisplayshortskip -5pt
@@ -17,10 +26,15 @@
\floatsep 4pt plus 3pt minus 2pt \floatsep 4pt plus 3pt minus 2pt
\intextsep 4pt plus 3pt minus 2pt \intextsep 4pt plus 3pt minus 2pt
\textfloatsep 4pt plus 3pt minus 2pt \textfloatsep 4pt plus 3pt minus 2pt
\multicolsep 4pt plus 3pt minus 2pt
\abovecaptionskip 4pt \abovecaptionskip 4pt
\setlist{itemsep=2pt,topsep=2pt,partopsep=1pt} \setlist{itemsep=2pt,topsep=2pt,partopsep=1pt}
} }
\newcommand{\mediumverticalspacing}{ \newcommand{\mediumverticalspacing}{
\titlespacing*{\section}{0pt}{6pt plus 2pt minus 2pt}{4pt plus 2pt minus 2pt}
\titlespacing*{\subsection}{0pt}{4pt plus 2pt minus 2pt}{3pt plus 2pt minus 1pt}
\titlespacing*{\subsubsection}{0pt}{3pt plus 1pt minus 1pt}{2pt plus 1pt minus 0pt}
\titlespacing*{\paragraph}{0pt}{2pt plus 1pt minus 1pt}{1pt plus 0pt minus 0pt}
\abovedisplayskip 7pt plus 4pt minus 3pt \abovedisplayskip 7pt plus 4pt minus 3pt
\belowdisplayskip 9pt plus 6pt minus 3pt \belowdisplayskip 9pt plus 6pt minus 3pt
\abovedisplayshortskip 0pt \abovedisplayshortskip 0pt
@@ -28,10 +42,15 @@
\floatsep 7pt plus 4pt minus 3pt \floatsep 7pt plus 4pt minus 3pt
\intextsep 7pt plus 4pt minus 3pt \intextsep 7pt plus 4pt minus 3pt
\textfloatsep 7pt plus 4pt minus 3pt \textfloatsep 7pt plus 4pt minus 3pt
\multicolsep 7pt plus 4pt minus 3pt
\abovecaptionskip 7pt \abovecaptionskip 7pt
\setlist{itemsep=4pt,topsep=4pt,partopsep=2pt} \setlist{itemsep=4pt,topsep=4pt,partopsep=2pt}
} }
\newcommand{\largeverticalspacing}{ \newcommand{\largeverticalspacing}{
\titlespacing*{\section}{0pt}{8pt plus 2pt minus 4pt}{5pt plus 2pt minus 3pt}
\titlespacing*{\subsection}{0pt}{6pt plus 2pt minus 3pt}{4pt plus 2pt minus 2pt}
\titlespacing*{\subsubsection}{0pt}{4pt plus 1pt minus 2pt}{3pt plus 1pt minus 1pt}
\titlespacing*{\paragraph}{0pt}{3pt plus 1pt minus 1pt}{2pt plus 1pt minus 1pt}
\abovedisplayskip 13pt plus 5pt minus 4pt \abovedisplayskip 13pt plus 5pt minus 4pt
\belowdisplayskip 15pt plus 9pt minus 6pt \belowdisplayskip 15pt plus 9pt minus 6pt
\abovedisplayshortskip 5pt plus 2pt minus 3pt \abovedisplayshortskip 5pt plus 2pt minus 3pt
@@ -39,6 +58,7 @@
\floatsep 12pt plus 5pt minus 4pt \floatsep 12pt plus 5pt minus 4pt
\intextsep 12pt plus 5pt minus 4pt \intextsep 12pt plus 5pt minus 4pt
\textfloatsep 12pt plus 5pt minus 4pt \textfloatsep 12pt plus 5pt minus 4pt
\multicolsep 12pt plus 5pt minus 4pt
\abovecaptionskip 10pt \abovecaptionskip 10pt
\setlist{itemsep=6pt,topsep=6pt,partopsep=2pt} \setlist{itemsep=6pt,topsep=6pt,partopsep=2pt}
} }

View File

@@ -38,24 +38,24 @@
"\\setFontType{sans}\n", "\\setFontType{sans}\n",
"\\setup{$1}\n", "\\setup{$1}\n",
"\\begin{document}", "\\begin{document}",
"\\startDocument\n\n", "\\startDocument\n",
"\\vspace{2cm}", "\\vspace{1cm}",
"\\begin{center}", "\\begin{center}",
"\t\\includegraphics[width=0.6\\linewidth]{~/projects/latex/assets/logo.jpg}", "\t\\includegraphics[width=0.5\\linewidth]{~/projects/latex/assets/logo.jpg}",
"\\end{center}\n\n", "\\end{center}\n\n",
"\\vspace{3cm}", "\\vspace{2cm}",
"\\begin{center}", "\\begin{center}",
"\t\\begin{Large}", "\t\\begin{Large}",
"\t\t\\quote{A funny quote by a professor}", "\t\t\\quote{A funny quote by a professor}",
"\t\\end{Large}", "\t\\end{Large}\n",
"\\hspace{3cm} - Prof. Dr. Professor Name, YEAR", "\t\\hspace{3cm} - Prof. Dr. Professor Name, YEAR",
"\\end{center}\n", "\\end{center}\n",
"\\vspace{2cm}", "\\vspace{1.5cm}",
"\\begin{center}", "\\begin{center}",
"\tSEMESTER, ETHZ\\\\[0.2cm]", "\tSEMESTER, ETHZ\n",
"\t\\begin{Large}", "\t\\begin{Large}",
"\t\tSummary of the Script and Lectures", "\t\tSummary of the Script and Lectures",
"\t\\end{Large}\\\\[0.2cm]", "\t\\end{Large}",
"\\end{center}\n\n", "\\end{center}\n\n",
"\\newpage", "\\newpage",
"\\printtoc{Aquamarine}\n\n", "\\printtoc{Aquamarine}\n\n",