From 1ee5651d25f0efc8a1d536cc945975f94c5521bc Mon Sep 17 00:00:00 2001
From: Malin Freeborn <malinfreeborn@posteo.net>
Date: Sun, 5 Feb 2023 20:58:39 +0100
Subject: [PATCH] number the sq parts in minitoc

---
 layout.sty | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/layout.sty b/layout.sty
index fb186c22..88034cbb 100644
--- a/layout.sty
+++ b/layout.sty
@@ -924,6 +924,7 @@ Roll & Result \\
   \end{figure*}
 }
 
+\newcounter{sqNo}
 \newcommand{\sqName}{}
 
 \newcommand{\sidequest}[1]{%
@@ -932,9 +933,19 @@ Roll & Result \\
   \subsection{\sqName}
   \stopcontents[\sqarea]
   \settoggle{firstsq}{true}
+  \setcounter{sqNo}{0}
 }
 
-\newcommand{\sqpart}[3]{\resumecontents[#1]\subsubsection[\iftoggle{firstsq}{\sqr}{\sqn} #2 -- #3]{(#1) #2}\stopcontents[#1]\settoggle{firstsq}{false}}
+\newcommand{\sqpart}[3]{
+  \refstepcounter{sqNo}
+  \resumecontents[#1]
+  \subsubsection[%
+    \arabic{sqNo} -- %
+    \iftoggle{firstsq}{\sqr}{\sqn}%
+    #2 -- #3]%
+    {(#1) #2}
+  \stopcontents[#1]\settoggle{firstsq}{false}
+}
 
 %%%%% Character Sheet Commands
 
-- 
GitLab