Hi Hans, how can i use the \dostructurecountercomponent command for my own macros? I tried it with the following code but nothing appear in the tuc file. \starttexcode \installnamespace {test} \installcommandhandler \????test {test} \????test \installstructurelistprocessor{test}{\usestructurelistprocessor{number+title}} \unexpanded\def\test_cmd[#1]#2#3% {\begingroup \edef\currenttest{#1}% \dostructurecountercomponent {test}% \setupcurrenttest \testparameter \detokenizedtestparameter \relax \relax \relax [\c!name=\currenttest,% \s!counter=\currenttest,% \s!hascaption=\v!yes,% \s!hasnumber=\v!yes,% \s!hastitle=\v!yes,% \c!reference=#2,% \c!title=#3, \c!bookmark=]% []% \endgroup} \appendtoks \setuevalue\currenttest{\test_cmd[\currenttest]}% \to \everydefinetest \appendtoks \definenumber[\currenttest]% % \definelist [\currenttest]% \to \everydefinetest \stoptexcode \definetest[test] \starttext \test{test:1}{This is the title!} \getnumber[test] \test{test:2}{This is the next title!} \getnumber[test] \stoptext Wolfgang
Hans, can you give me a top what’t missing in the code below. Wolfgang Am 14.10.2011 um 12:59 schrieb Wolfgang Schuster:
Hi Hans,
how can i use the \dostructurecountercomponent command for my own macros?
I tried it with the following code but nothing appear in the tuc file.
\starttexcode
\installnamespace {test} \installcommandhandler \????test {test} \????test
\installstructurelistprocessor{test}{\usestructurelistprocessor{number+title}}
\unexpanded\def\test_cmd[#1]#2#3% {\begingroup \edef\currenttest{#1}% \dostructurecountercomponent {test}% \setupcurrenttest \testparameter \detokenizedtestparameter \relax \relax \relax [\c!name=\currenttest,% \s!counter=\currenttest,% \s!hascaption=\v!yes,% \s!hasnumber=\v!yes,% \s!hastitle=\v!yes,% \c!reference=#2,% \c!title=#3, \c!bookmark=]% []% \endgroup}
\appendtoks \setuevalue\currenttest{\test_cmd[\currenttest]}% \to \everydefinetest
\appendtoks \definenumber[\currenttest]% % \definelist [\currenttest]% \to \everydefinetest
\stoptexcode
\definetest[test]
\starttext
\test{test:1}{This is the title!}
\getnumber[test]
\test{test:2}{This is the next title!}
\getnumber[test]
\stoptext
Wolfgang
Am 14.10.2011 um 12:59 schrieb Wolfgang Schuster:
Hi Hans,
how can i use the \dostructurecountercomponent command for my own macros?
I tried it with the following code but nothing appear in the tuc file.
\starttexcode
\installnamespace {test} \installcommandhandler \????test {test} \????test
\installstructurelistprocessor{test}{\usestructurelistprocessor{number+title}}
\unexpanded\def\test_cmd[#1]#2#3% {\begingroup \edef\currenttest{#1}% \dostructurecountercomponent {test}% \setupcurrenttest \testparameter \detokenizedtestparameter \relax \relax \relax [\c!name=\currenttest,% \s!counter=\currenttest,% \s!hascaption=\v!yes,% \s!hasnumber=\v!yes,% \s!hastitle=\v!yes,% \c!reference=#2,% \c!title=#3, \c!bookmark=]% []% \endgroup}
I found now the reason why the code don’t work, there is \laststructurecountersynchronize after I set the value, when I add it I have the information in the tuc file and when I uncomment \definelist I can also use \placelist to get a list with all entries :) Wolfgang
participants (1)
-
Wolfgang Schuster