From 05a83ce931821be77947a811e5f433c4f1dfa29c Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 26 Nov 2021 11:03:54 +0100 Subject: 2021-11-26 10:43:00 --- tex/context/base/mkiv/strc-flt.mkvi | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'tex/context/base/mkiv/strc-flt.mkvi') diff --git a/tex/context/base/mkiv/strc-flt.mkvi b/tex/context/base/mkiv/strc-flt.mkvi index d9fd359c6..464b6ab52 100644 --- a/tex/context/base/mkiv/strc-flt.mkvi +++ b/tex/context/base/mkiv/strc-flt.mkvi @@ -1111,6 +1111,35 @@ \def\strc_floats_group_index {\numexpr\clf_listgroupindex{\currentfloat}{\currentfloatgroup}\relax} +%D A lightweight subnumber feature: +%D +%D \starttyping +%D \startplacefigure [location=none] +%D \startsubfloatnumbering +%D \startfloatcombination [nx=3] +%D \startplacefigure [title=Left] \externalfigure \stopplacefigure +%D \startplacefigure [title=Middle] \externalfigure \stopplacefigure +%D \startplacefigure [title=Right] \externalfigure \stopplacefigure +%D \stopfloatcombination +%D \stopsubfloatnumbering +%D \stopplacefigure +%D \stoptyping + +\glet\currentsubfloatcounter\empty + +\unexpanded\def\startsubfloatnumbering + {\glet\currentsubfloatcounter\s!unknown} + +\unexpanded\def\stopsubfloatnumbering + {\strc_counters_reset_sub\currentsubfloatcounter\plustwo + \glet\currentsubfloatcounter\empty} + +\defineconversionset[subfloats][number,characters] + +\setupcaptions + %[figure] + [\c!numberconversionset=subfloats] + \def\strc_floats_place_packaged_boxes {\expandafter\strc_floats_place_packaged_boxes_indeed\expandafter{\m_strc_floats_saved_userdata}} @@ -1127,7 +1156,17 @@ \ifx\currentfloatgroup\empty % independent \iftrialtypesetting\strc_counters_save\currentfloatcounter\fi - \strc_counters_increment\currentfloatcounter + \ifx\empty\currentsubfloatcounter + \strc_counters_increment\currentfloatcounter + \strc_counters_reset_sub\currentfloatcounter\plustwo + \else + \ifcase\strc_counters_raw_sub\currentfloatcounter\plustwo\relax + \strc_counters_increment\currentfloatcounter + \strc_counters_reset_sub\currentfloatcounter\plustwo + \fi + \strc_counters_increment_sub\currentfloatcounter\plustwo + \glet\currentsubfloatcounter\currentfloatcounter + \fi \else\ifcase\strc_floats_group_index % first in group \iftrialtypesetting\strc_counters_save\currentfloatcounter\fi -- cgit v1.2.3