summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-lab.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/strc-lab.mkiv')
-rw-r--r--tex/context/base/strc-lab.mkiv42
1 files changed, 26 insertions, 16 deletions
diff --git a/tex/context/base/strc-lab.mkiv b/tex/context/base/strc-lab.mkiv
index 0039a68fd..28a5020ed 100644
--- a/tex/context/base/strc-lab.mkiv
+++ b/tex/context/base/strc-lab.mkiv
@@ -23,6 +23,8 @@
\installcommandhandler \??labels {label} \??labels % plural hash, else clash with label (or rename that one)
+\installcounterassociation{label}
+
\let\setuplabels\setuplabel
\setuplabel
@@ -90,7 +92,7 @@
\fi
\doifcounterelse\p_counter\donothing{\strc_labels_define_counter\p_counter}%
\letlabelparameter\s!counter\p_counter
- \strc_labels_setup_counter\currentlabel
+ %\strc_labels_setup_counter\currentlabel
\to \everydefinelabel
\let\p_strc_constructions_title \empty
@@ -137,26 +139,34 @@
% similar to enumerations
-\newtoks\everysetuplabelcounter
-
-\let\v_strc_labels_counter_name\empty
-
-\def\strc_labels_setup_counter#1%
- {\edef\v_strc_labels_counter_name{#1}%
- \the\everysetuplabelcounter}
+% \newtoks\everysetuplabelcounter
+%
+% \let\v_strc_labels_counter_name\empty
+%
+% \def\strc_labels_setup_counter#1%
+% {\edef\v_strc_labels_counter_name{#1}%
+% \the\everysetuplabelcounter}
+%
+% \def\strc_labels_define_counter#1%
+% {\definecounter[#1]%
+% \strc_labels_setup_counter{#1}}
+%
+% \appendtoks
+% \strc_counter_setup_using_parameter\v_strc_labels_counter_name\labelparameter
+% \to \everysetuplabelcounter
+%
+% \appendtoks
+% \ifx\currentlabel\empty \else
+% \strc_labels_setup_counter\currentlabel
+% \fi
+% \to \everysetuplabel
\def\strc_labels_define_counter#1%
{\definecounter[#1]%
- \strc_labels_setup_counter{#1}}
-
-\appendtoks
- \strc_counter_setup_using_parameter\v_strc_labels_counter_name\labelparameter
-\to \everysetuplabelcounter
+ \registerlabelcounter{#1}}
\appendtoks
- \ifx\currentlabel\empty \else
- \strc_labels_setup_counter\currentlabel
- \fi
+ \synchronizelabelcounters
\to \everysetuplabel
% no start stop here