Update some old commands

This commit is contained in:
2026-02-21 11:32:53 +01:00
parent 2c37a724ee
commit 2a592753bf
9 changed files with 404 additions and 198 deletions

View File

@@ -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
}

View 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}%
}
}