Hi Hans, there is a problem with sub enumerations and notes in the new construct code. As you can see in the example below there is no difference between \test and \subtest: \starttext \defineenumeration[test][text=Test,title=no] \starttest One \stoptest \startsubtest One \stopsubtest \test Two\par \subtest Two\par \stoptext The problem is here because both \test and \subtest expand to \strc_enumerations_command{test}, changing \currentenumeration to “#1” will fix it. \unexpanded\def\strc_define_commands_enumeration#1#2#3% current level parent {\doifelsenothing{#3} {\defineconstruction[#1][\s!handler=\v!enumeration,\c!level=#2]}% {\defineconstruction[#1][#3][\s!handler=\v!enumeration,\c!level=#2]}% \setuevalue{\e!next #1}{\strc_enumerations_next }% \setuevalue{\c!reset#1}{\strc_enumerations_reset }% %setuevalue{\c!set #1}{\strc_enumerations_set }% \setuevalue {#1}{\strc_enumerations_command{\currentenumeration}}% \setuevalue{\e!start#1}{\strc_enumerations_start {\currentenumeration}}% \setuevalue{\e!stop #1}{\strc_enumerations_stop }} Even though there is another problem because \subtest has the wrong parent setting (parent=\??construction test), a quick fix is this (see the block between % and %): \setvalue{\??constructioninitializer\v!enumeration}% {\let\currentenumeration \currentconstruction \let\constructionparameter \enumerationparameter \let\detokenizedconstructionparameter\detokenizedenumerationparameter \let\letconstructionparameter \letenumerationparameter \let\setconstructionparameter \setenumerationparameter \let\useconstructionstyleandcolor \useenumerationstyleandcolor \let\setupcurrentconstruction \setupcurrentenumeration % \ifx\currentconstructionmain\currentconstruction \letconstructionparameter\s!parent\??enumeration \else \setconstructionparameter\s!parent{\??enumeration\currentconstructionmain}% \fi % \edef\p_number{\constructionparameter\c!number}% \ifx\p_number\v!yes \settrue\c_strc_constructions_number_state \iftrialtypesetting \strc_counters_save\currentconstructionnumber \fi \strc_counters_increment_sub\currentconstructionnumber\currentconstructionlevel \else \setfalse\c_strc_constructions_number_state \fi \edef\p_title{\constructionparameter\c!title}% \ifx\p_title\v!yes \settrue\c_strc_constructions_title_state \else \setfalse\c_strc_constructions_title_state \fi} Wolfgang
On 1-3-2012 16:14, Wolfgang Schuster wrote:
Hi Hans,
there is a problem with sub enumerations and notes in the new construct code. As you can see in the example below there is no difference between \test and \subtest:
\starttext
\defineenumeration[test][text=Test,title=no]
\starttest One \stoptest
\startsubtest One \stopsubtest
\test Two\par
\subtest Two\par
\stoptext
The problem is here because both \test and \subtest expand to \strc_enumerations_command{test}, changing \currentenumeration to “#1” will fix it.
how about % to be considered: % % \let\??construction\??enumeration % % with push/pop (also at definition time) \unexpanded\def\strc_define_commands_enumeration#1#2#3% current level parent {\doifelsenothing{#3} {\normalexpanded{\defineconstruction[#1][\s!handler=\v!enumeration,\c!level=#2]}% \setevalue{\??enumeration#1:\s!parent }{\??enumeration}% }% {\normalexpanded{\defineconstruction[#1][#3][\s!handler=\v!enumeration,\c!level=#2]}% \setevalue{\??enumeration#1:\s!parent }{\??enumeration#3}% }% \setuevalue{\e!next #1}{\strc_enumerations_next }% \setuevalue{\c!reset#1}{\strc_enumerations_reset }% %setuevalue{\c!set #1}{\strc_enumerations_set }% \setuevalue {#1}{\strc_enumerations_command{#1}}% \setuevalue{\e!start#1}{\strc_enumerations_start {#1}}% \setuevalue{\e!stop #1}{\strc_enumerations_stop }} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Wolfgang Schuster