From cbc028b75a38364bb62970da1372a773aa55d674 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sat, 18 Oct 2025 13:43:38 +0200 Subject: [PATCH] [Counters] Handle no explicit initialization better --- main/style/counters.tex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main/style/counters.tex b/main/style/counters.tex index 9580741..9536b35 100644 --- a/main/style/counters.tex +++ b/main/style/counters.tex @@ -71,6 +71,10 @@ % └ ┘ \newcommand{\setSubsectionNumbering}[1]{ \setcounter{numberSubsections}{#1} + \applySubsectionNumbering +} + +\newcommand{\applySubsectionNumbering}{ \ifnum\value{numberSubsections}=1 \renewcommand{\sectionNumbering}{\thesubsection} \renewcommand{\suffix}{ss} @@ -120,7 +124,7 @@ \renewcommand{\theremarksss}{\sectionNumbering.\arabic{remarksss}} \renewcommand{\theallsss}{\sectionNumbering.\arabic{allsss}} } - +\applySubsectionNumbering % ── Label generation ──────────────────────────────────────────────── \newcommand{\labelSectionGeneration}{% @@ -168,9 +172,11 @@ % ┌ ┐ % │ Enable or disable numbering │ % └ ┘ +% Initialize with config file \newcounter{numberingConfigStore} \setcounter{numberingConfigStore}{\value{numberingConfig}} +% For later change \newcommand{\setNumberingStyle}[1]{ \typeout{Setting NumberingStyle to #1} \setcounter{numberingConfig}{#1} @@ -178,6 +184,8 @@ \setcounter{numberingConfigStore}{#1} } } + +% Enable / disable numbering \newcommand{\numberingOff}{ \setcounter{numberingConfig}{0} }