References and \dostructurecountercomponent
Hi Hans, I try to set and access a reference in the example below but both \in and \at result in a fatal error. What’s missing in my code, I looked in the float and math code but I can’t find a solution. \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=]% []% \laststructurecountersynchronize \attribute\destinationattribute\laststructurecounterattribute\emptyhbox \endgroup} \appendtoks \setuevalue\currenttest{\test_cmd[\currenttest]}% \to \everydefinetest \appendtoks \definenumber[\currenttest]% \definelist [\currenttest]% \to \everydefinetest \stoptexcode \definetest[test] \setupnumber[test][prefix=yes] \starttext \placelist[test] \blank \test{test:1}{This is the title!} Test 1: \getnumber[test] \test{test:2}{This is the next title!} Test 2: \getnumber[test] \blank \in{test}[test:2] \at{page}[test:2] \stoptext Wolfgang
On 21-10-2011 07:07, Wolfgang Schuster wrote:
Hi Hans,
I try to set and access a reference in the example below but both \in and \at result in a fatal error. What’s missing in my code, I looked in the float and math code but I can’t find a solution.
you need to set a resolver for the internal reference as it can come from anywhere references.resolvers.test = references.resolvers.section -- take from list but anyhow, I made that the fallback resolver now so your problem should go away Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Am 24.10.2011 um 14:18 schrieb Hans Hagen:
On 21-10-2011 07:07, Wolfgang Schuster wrote:
Hi Hans,
I try to set and access a reference in the example below but both \in and \at result in a fatal error. What’s missing in my code, I looked in the float and math code but I can’t find a solution.
you need to set a resolver for the internal reference as it can come from anywhere
references.resolvers.test = references.resolvers.section -- take from list
but anyhow, I made that the fallback resolver now so your problem should go away
Thanks, the error message is now gone but I don’t get a number from the \in reference unless I add \startluacode structures.references.filters.test = { default = structures.references.filters.generic.number } \stopluacode to my code. Can the reference code take care of this itself or do I really need the line? Wolfgang
On 24-10-2011 23:24, Wolfgang Schuster wrote:
Am 24.10.2011 um 14:18 schrieb Hans Hagen:
On 21-10-2011 07:07, Wolfgang Schuster wrote:
Hi Hans,
I try to set and access a reference in the example below but both \in and \at result in a fatal error. What’s missing in my code, I looked in the float and math code but I can’t find a solution.
you need to set a resolver for the internal reference as it can come from anywhere
references.resolvers.test = references.resolvers.section -- take from list
but anyhow, I made that the fallback resolver now so your problem should go away
Thanks, the error message is now gone but I don’t get a number from the \in reference unless I add
\startluacode structures.references.filters.test = { default = structures.references.filters.generic.number } \stopluacode
to my code. Can the reference code take care of this itself or do I really need the line?
I'll add a default ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Am 25.10.2011 um 10:34 schrieb Hans Hagen:
On 24-10-2011 23:24, Wolfgang Schuster wrote:
Am 24.10.2011 um 14:18 schrieb Hans Hagen:
On 21-10-2011 07:07, Wolfgang Schuster wrote:
Hi Hans,
I try to set and access a reference in the example below but both \in and \at result in a fatal error. What’s missing in my code, I looked in the float and math code but I can’t find a solution.
you need to set a resolver for the internal reference as it can come from anywhere
references.resolvers.test = references.resolvers.section -- take from list
but anyhow, I made that the fallback resolver now so your problem should go away
Thanks, the error message is now gone but I don’t get a number from the \in reference unless I add
\startluacode structures.references.filters.test = { default = structures.references.filters.generic.number } \stopluacode
to my code. Can the reference code take care of this itself or do I really need the line?
I'll add a default
Thank you. Wolfgang
participants (2)
-
Hans Hagen
-
Wolfgang Schuster