Update some old commands
This commit is contained in:
@@ -35,3 +35,5 @@
|
||||
\newcommand{\usagenumbering}{default}
|
||||
\newcommand{\recallnumbering}{default}
|
||||
\newcommand{\propertiesnumbering}{default}
|
||||
\newcommand{\tablenumbering}{default}
|
||||
\newcommand{\figurenumbering}{default}
|
||||
|
||||
19
src/core/bib.sty
Normal file
19
src/core/bib.sty
Normal file
@@ -0,0 +1,19 @@
|
||||
% ___ _ _____ _ _
|
||||
% ( _ \ _( ) (_ _) ( ) ( )
|
||||
% | (_) )_) |_ | | __ \ \/ /
|
||||
% | _ (| | _ \ | | / __ \ ) (
|
||||
% | (_) ) | |_) ) | | ( ___// /\ \
|
||||
% (____/(_)_ __/ (_) \____)_) (_)
|
||||
|
||||
% Configs if you want to use BibTeX
|
||||
|
||||
\newcommand{\setupBibtex}[1]{
|
||||
\RequirePackage{biblatex}
|
||||
\RequirePackage[nottoc, numbib]{tocbibind}
|
||||
\addbibresource{#1}
|
||||
}
|
||||
|
||||
\newcommand{\printbib}{
|
||||
\addcontentsline{toc}{section}{\translate{Sources}{Quellen}}
|
||||
\printbibliography[title=\translate{Sources}{Quellen}]
|
||||
}
|
||||
148
src/core/counters.sty
Normal file
148
src/core/counters.sty
Normal file
@@ -0,0 +1,148 @@
|
||||
% ── Label generator ─────────────────────────────────────────────────
|
||||
\newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname}
|
||||
\newcommand{\printCounter}[1]{\refstepcounter{#1}\csname the#1\endcsname}
|
||||
|
||||
\newcommand{\printLabel}[1]{%
|
||||
\ifthenelse{\boolean{numberingDisabled}}{}{
|
||||
\ifcsdef{#1numbering}{% Extra config present
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{%
|
||||
\labelPrintBackendRoutine{#1}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{%
|
||||
\printCounter{#1\subsectionnumbering}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{%
|
||||
\printCounter{combined\subsectionnumbering}%
|
||||
}{}%
|
||||
}%
|
||||
}%
|
||||
}{%
|
||||
\labelPrintBackendRoutine{#1}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\labelPrintBackendRoutine}[1]{%
|
||||
\ifthenelse{\equal{\numberingpreset}{combined}}{%
|
||||
\printCounter{combined\subsectionnumbering}%
|
||||
}{
|
||||
\ifthenelse{\equal{\numberingpreset}{separate}}{%
|
||||
\printCounter{#1\subsectionnumbering}%
|
||||
}{}%
|
||||
}%
|
||||
}
|
||||
|
||||
% ── Set the current number of a label ───────────────────────────────
|
||||
\newcommand{\setLabelNumber}[2]{%
|
||||
\setcounter{#1none}{#2}%
|
||||
\addtocounter{#1none}{-1}%
|
||||
\setcounter{#1section}{#2}%
|
||||
\addtocounter{#1section}{-1}%
|
||||
\setcounter{#1subsection}{#2}%
|
||||
\addtocounter{#1subsection}{-1}%
|
||||
\setcounter{#1subsubsection}{#2}%
|
||||
\addtocounter{#1subsubsection}{-1}%
|
||||
\setcounter{#1paragraph}{#2}%
|
||||
\addtocounter{#1paragraph}{-1}%
|
||||
}
|
||||
|
||||
\newcommand{\stepLabelNumber}[1]{%
|
||||
\stepcounter{#1none}%
|
||||
\stepcounter{#1section}%
|
||||
\stepcounter{#1subsection}%
|
||||
\stepcounter{#1subsubsection}%
|
||||
\stepcounter{#1paragraph}%
|
||||
}
|
||||
|
||||
% ┌ ┐
|
||||
% │ Counter numbering │
|
||||
% └ ┘
|
||||
\newcommand{\preEnvHook}[1]{%
|
||||
\ifthenelse{\boolean{numberingDisabled}}{}{
|
||||
\ifthenelse{\equal{\numberingpreset}{combined} \AND \equal{\printNumberingConfigForDescriptor{#1}}{default}}{%
|
||||
\stepLabelNumber{combined}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{%
|
||||
\stepLabelNumber{combined}%
|
||||
}{}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
% Decides on the numbering to use (combined or not)
|
||||
\newcommand{\tableAndFigureNumberingHelper}[1]{%
|
||||
\ifthenelse{\boolean{numberingDisabled}}{}{
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}{default}}}{% Using default
|
||||
\ifthenelse{\equal{\numberingpreset}{combined}}{%
|
||||
\tableAndFigureSubsectionPrinting{\value{combined\subsectionnumbering}}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\numberingpreset}{separate}}{%
|
||||
\tableAndFigureSubsectionPrinting{\value{#1}}%
|
||||
}{}%
|
||||
}%
|
||||
}{% if we get here, default has been changed
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}{combined}}}{%
|
||||
\tableAndFigureSubsectionPrinting{\value{combined\subsectionnumbering}}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}{separate}}}{%
|
||||
\tableAndFigureSubsectionPrinting{\value{#1}}%
|
||||
}{}%
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
% Prints the preceding subsection numbers
|
||||
\newcommand{\tableAndFigureSubsectionPrinting}[1]{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{section}}{%
|
||||
\thesection.#1%
|
||||
}{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{subsection}}{%
|
||||
\thesubsection.#1%
|
||||
}{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{subsubsection}}{%
|
||||
\thesubsubsection.#1%
|
||||
}{%
|
||||
\ifthenelse{\equal{\subsectionnumbering}{paragraph}}{%
|
||||
\theparagraph.#1
|
||||
}{%
|
||||
#1
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
\renewcommand{\thetable}{\tableAndFigureNumberingHelper{table}}
|
||||
\renewcommand{\thefigure}{\tableAndFigureNumberingHelper{figure}}
|
||||
|
||||
\AtBeginEnvironment{table}{\preEnvHook{table}}
|
||||
\AtBeginEnvironment{figure}{\preEnvHook{figure}}
|
||||
|
||||
|
||||
\newcommand{\newsection}{%
|
||||
\newpage
|
||||
\newsectionNoPB
|
||||
}
|
||||
|
||||
\newcommand{\newsectionNoPB}{
|
||||
\ifthenelse{\equal{\numberingpreset}{off}}{}{%
|
||||
\resetNumbering%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\resetTableAndFigureNumbering}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{table}}{combined} \OR \equal{\printNumberingConfigForDescriptor{table}{default}}}{%
|
||||
\setcounter{table}{0}
|
||||
}{}%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{figure}}{combined} \OR \equal{\printNumberingConfigForDescriptor{figure}{default}}}{%
|
||||
\setcounter{figure}{0}
|
||||
}{}%
|
||||
}
|
||||
|
||||
|
||||
% Numbering toggling
|
||||
\newboolean{numberingDisabled}
|
||||
\setboolean{numberingDisabled}{false}
|
||||
\newcommand{\numberingOff}{\setboolean{numberingDisabled}{true}}
|
||||
\newcommand{\numberingOn}{\setboolean{numberingDisabled}{false}}
|
||||
12
src/core/glossary.sty
Normal file
12
src/core/glossary.sty
Normal file
@@ -0,0 +1,12 @@
|
||||
% Add glossaries functionality
|
||||
|
||||
\newcommand{\setupGlossary}{
|
||||
\RequirePackage[nonumberlist, toc]{glossaries}
|
||||
\RequirePackage[nottoc, numbib]{tocbibind}
|
||||
\makenoidxglossaries
|
||||
}
|
||||
|
||||
\newcommand{\printGlossary}{
|
||||
\glsaddall
|
||||
\printnoidxglossaries
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
% ── Label generator ─────────────────────────────────────────────────
|
||||
\newcommand{\printNumberingConfigForDescriptor}[1]{\csname #1numbering\endcsname}
|
||||
\newcommand{\printCounter}[1]{\refstepcounter{#1}\csname the#1\endcsname}
|
||||
|
||||
\newcommand{\printLabel}[1]{%
|
||||
\ifcsdef{#1numbering}{% Extra config present
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{%
|
||||
\printCounter{#1\subsectionnumbering}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{separate}}{%
|
||||
\printCounter{#1\subsectionnumbering}%
|
||||
}{%
|
||||
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{%
|
||||
\printCounter{combined\subsectionnumbering}%
|
||||
}{}%
|
||||
}%
|
||||
}%
|
||||
}{%
|
||||
\labelPrintBackendRoutine{#1}%
|
||||
}%
|
||||
}
|
||||
\newcommand{\labelPrintBackendRoutine}[1]{
|
||||
\ifthenelse{\equal{\numberingpreset}{combined}}{
|
||||
\printCounter{combined\subsectionnumbering}%
|
||||
}{
|
||||
\ifthenelse{\equal{\numberingpreset}{separate}}{
|
||||
\printCounter{#1\subsectionnumbering}%
|
||||
}{}
|
||||
}
|
||||
}
|
||||
|
||||
% Inline environments (inline)
|
||||
\newcommand{\inline}[2][NONAME]{%
|
||||
\ifthenelse{\equal{NONAME}{#1}}{%
|
||||
\anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}%
|
||||
}{%
|
||||
\inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}%
|
||||
}
|
||||
}
|
||||
|
||||
\newcommand{\short}[2][NONAME]{%
|
||||
\ifthenelse{\equal{NONAME}{#1}}{%
|
||||
\anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}%
|
||||
}{%
|
||||
\shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}%
|
||||
}
|
||||
}
|
||||
|
||||
% ── Set the current number of a label ───────────────────────────────
|
||||
\newcommand{\setLabelNumber}[2]{%
|
||||
\setcounter{#1none}{#2}%
|
||||
\addtocounter{#1none}{-1}%
|
||||
\setcounter{#1section}{#2}%
|
||||
\addtocounter{#1section}{-1}%
|
||||
\setcounter{#1subsection}{#2}%
|
||||
\addtocounter{#1subsection}{-1}%
|
||||
\setcounter{#1subsubsection}{#2}%
|
||||
\addtocounter{#1subsubsection}{-1}%
|
||||
\setcounter{#1paragraph}{#2}%
|
||||
\addtocounter{#1paragraph}{-1}%
|
||||
}
|
||||
|
||||
\newcommand{\stepLabelNumber}[1]{%
|
||||
\stepcounter{#1none}%
|
||||
\stepcounter{#1section}%
|
||||
\stepcounter{#1subsection}%
|
||||
\stepcounter{#1subsubsection}%
|
||||
\stepcounter{#1paragraph}%
|
||||
}
|
||||
|
||||
% ┌ ┐
|
||||
% │ Counter numbering │
|
||||
% └ ┘
|
||||
% TODO: Update
|
||||
\newcommand{\preTableAndFigHook}[1]{%
|
||||
\ifnum\value{numberingConfig}>1%
|
||||
\ifnum\value{numberSubsections}=1%
|
||||
\stepcounter{allss}%
|
||||
\else
|
||||
\ifnum\value{numberSubsections}=2%
|
||||
\stepcounter{allsss}%
|
||||
\else%
|
||||
\stepcounter{all}%
|
||||
\fi
|
||||
\fi
|
||||
\fi
|
||||
\renewcommand{\thetable}{\arabic{table}}
|
||||
\renewcommand{\thefigure}{\arabic{figure}}
|
||||
}
|
||||
\AtBeginEnvironment{table}{\preTableAndFigHook{table}}
|
||||
\AtBeginEnvironment{figure}{\preTableAndFigHook{figure}}
|
||||
|
||||
|
||||
\newcommand{\newsection}{
|
||||
\newpage
|
||||
\newsectionNoPB
|
||||
}
|
||||
16
src/style/environments.sty
Normal file
16
src/style/environments.sty
Normal file
@@ -0,0 +1,16 @@
|
||||
% ── Inline environments ─────────────────────────────────────────────
|
||||
\newcommand{\inline}[2][NONAME]{%
|
||||
\ifthenelse{\equal{NONAME}{#1}}{%
|
||||
\anonymousInlineDescriptorTemplate{#2}{\printLabel{#2}}%
|
||||
}{%
|
||||
\inlineDescriptorTemplate{#2}{\printLabel{#2}}{#1}%
|
||||
}
|
||||
}
|
||||
|
||||
\newcommand{\short}[2][NONAME]{%
|
||||
\ifthenelse{\equal{NONAME}{#1}}{%
|
||||
\anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}%
|
||||
}{%
|
||||
\shortDescriptorTemplate{#2}{\printLabel{#2}}{#1}%
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user