From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/116962 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yaroslav Beltukov via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Wrong prefix in cross references to formulas in external document Date: Tue, 31 Jan 2023 11:11:45 +0300 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6366497010705531341==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4543"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yaroslav Beltukov To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jan 31 09:12:35 2023 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pMlko-0000zE-3z for gctc-ntg-context-518@m.gmane-mx.org; Tue, 31 Jan 2023 09:12:34 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B77E938090A; Tue, 31 Jan 2023 09:12:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 57iiJHclqna6; Tue, 31 Jan 2023 09:12:02 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 083FC3807ED; Tue, 31 Jan 2023 09:12:02 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9D19C10F4 for ; Tue, 31 Jan 2023 09:11:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hCU9RVFQHyfV for ; Tue, 31 Jan 2023 09:11:58 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.47; helo=mail-wm1-f47.google.com; envelope-from=ybeltukov@gmail.com; receiver= Original-Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 435EB10D1 for ; Tue, 31 Jan 2023 09:11:57 +0100 (CET) Original-Received: by mail-wm1-f47.google.com with SMTP id f47-20020a05600c492f00b003dc584a7b7eso3784056wmp.3 for ; Tue, 31 Jan 2023 00:11:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=g8PII4TD/Un913xtNKDXU4K77Tu+4XCCQ2uqlJcR9c4=; b=qugaQyisx3DKolg6OuyntlEti8COb/vWkBMZAebisgaTFABpv8t9rYPq/ddpHWOv4Z 920BocSonR2BueXH1fS20XpzBHugvzYIqHeeh+l8YS3eEqolWYm1e1SEFfFTjJPzrz2j ro8HxJqif3Zd+Q+/8LC9JyHpCXPGQfaq/eGeKQx4jvLKb6vAOgxujUc8tt7fYC+IMOoK sffCili18Ew9NkYtSXObNyeZrgkDBLZMCIZ3ko4XSS4m9Iy7IJ4NFfqLggXTVeQcNPCd syA4jKmhvvJ/w8COUx5BnvojWklfE4Ys/tu8MB3rIFshLBFoCXdH7xJmCFUwD2CD5Kx9 GA8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=g8PII4TD/Un913xtNKDXU4K77Tu+4XCCQ2uqlJcR9c4=; b=JracQ8o8yP2itFyOI2MAEno6pZuAbTVLjkpE3v3N29jgZfWbtmFBNR6uqRMYqntD3q qCtuCdLTJpIRS1Eqh45bsj1a2dpLDrK9vQo+X3nu5xDw3J9Zrw6QyaSsB9kFL9EKjTY5 xTZNffh94dVIL1UyIew3h858dO2Ek2DtGvIoKPcXgd9/HpIWcWqGiiy7tTtMrZq+U2H/ T0W2GWDm2dObVqZ94c0dcp/I1/bYB0UQ2ugw5DXva3RwQW+DxlKZ+Inf6OtNRsOC19Nv VBQbkJ4hchFVBeJXRBSnCMWNnPY36sJw6YrGyp2ZikSpJjptKVKhxJyLaoRu+PMi9Zmf 13rQ== X-Gm-Message-State: AO0yUKWrAilrBH4eTLjq3hx/qG6dpBp0TNpqsPpCyXljakXjhLAWwzVm 8ZoMSHBJNqRCGTCxJzxXo7HcCtfqvgmgaxFlQE/9a00F X-Google-Smtp-Source: AK7set9utGGqu250W3BUtmjlPmooGhcQ+SuYXw71N0vTXLfs3SXkzHOA7by6VWHCLrBSdezdxdQEMmIsCigh7V48/vo= X-Received: by 2002:a1c:5458:0:b0:3dc:40b4:2920 with SMTP id p24-20020a1c5458000000b003dc40b42920mr911031wmi.197.1675152716881; Tue, 31 Jan 2023 00:11:56 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:116962 Archived-At: --===============6366497010705531341== Content-Type: multipart/alternative; boundary="000000000000a265cb05f38ae2de" --000000000000a265cb05f38ae2de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Hans, Thank you for the nice and straightforward solution. I have tested it locally and it works. I hope it will be in the next release (should I do anything?). By the way, I have a couple of other small issues. I will describe them in detail in other threads of this mailing list if it is the right place to do so. Best regards, Yaroslav =D0=BF=D0=BD, 30 =D1=8F=D0=BD=D0=B2. 2023 =D0=B3. =D0=B2 12:52, Hans Hagen = via ntg-context : > On 1/29/2023 5:03 PM, Yaroslav Beltukov via ntg-context wrote: > > Dear Hans and all contributors, > > > > I really appreciate ConTeXt for the right way to obtain high quality > > documents. I'm a theoretical physicist and I'm going to write a book. I > > think ConTeXt is the right choice to work with a number of formulas, > > figures and cross-references. The visual quality of formulas is better > > than in regular LaTeX. The new feature with formula autosplitting looks > > also very promising. For me it is important to obtain the high quality > > without a lot of manual tweaks of each formula for each given document > > format and figure placement. > > > > However, I have found a problem with references if I compile one > > component only. The references to formulas in other components have > > wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the right > > formula references are very important. > > > > I started looking into this issue. The references to other components > > are taken from the whole product as from an external document. It turne= d > > out that this is a general problem with references with prefixes to > > external documents. The prefix is stored in a tuc file as a reference t= o > > a section as a sequential number of the header in the document. As a > > result, the prefix from the external document is calculated using the > > structure of the current document. > > > > Here is the MWE, which consists of two files: > > foo.tex: > > > > \defineenumeration[remark][prefix=3Dyes, prefixsegments=3Dchapter:secti= on] > > > > \starttext > > > > Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4] > > > > Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4] > > > > Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4] > > > > Remarks: \in[remark1], \in[remark2] > > > > \startbodymatter > > > > \chapter[chap1]{Chapter} > > \placeformula[eq1]\startformula x =3D y\stopformula > > \chapter[chap2]{Chapter} > > \section[sec1]{Section} > > \section[sec2]{Section} > > \placeformula[eq1]\startformula x =3D y\stopformula > > \placeformula[eq2]\startformula x =3D y\stopformula > > > > \stopbodymatter > > > > \startappendices > > > > \chapter[chap3]{Chapter} > > \section[sec3]{Section} > > \placeformula[eq3]\startformula x =3D y\stopformula > > \section[sec4]{Section} > > \startremark[remark1]\stopremark > > \placeformula[eq4]\startformula x =3D y\stopformula > > \startremark[remark2]\stopremark > > \chapter[chap4]{Chapter} > > > > \stopappendices > > > > \stoptext > > > > > > bar.tex: > > > > \starttext > > > > Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4] > > > > Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec4= ] > > > > Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], > \in[foo::chap4] > > > > Remarks: \in[foo::remark1], \in[foo::remark2] > > > > % any chapters and sections here > > > > \stoptext > > > > It is expected to have the same first page on these documents: > > > > Equations: 1.1, 2.2, A.1, A.2 > > Sections: 2.1, 2.2, A.1, A.2 > > Chapters: 1, 2, A, B > > Remarks: A.2.1, A.2.2 > > > > However, the bar.tex produces wrong prefixes to formulas and remarks. > > The output depends on the document structure of bar.tex, not foo.tex. > > > > I started looking into the source code. Thanks to lua, it is not a big > > deal to track the problem. The prefixdata is complemented by the > > sectiondata after the loading the tuc file. So, the question is: is it > > possible to store the full prefixdata with all necessary prefix numbers > > in the tuc file? Here is my proposal to change the source code: > > > > --- strc-lst-old.lmt 2023-01-29 11:30:15.610309948 +0300 > > +++ strc-lst.lmt 2023-01-29 12:10:08.864228923 +0300 > > @@ -266,6 +266,16 @@ > > if r and not r.section then > > r.section =3D structures.sections.currentid() > > end > > + -- store sectiondata in prefixdata (necessary for external files) > > + if t.prefixdata and r.section then > > + local sectiondata =3D structures.sections.collected[r.section] > > + if sectiondata then > > + for k, v in next, sectiondata do > > + t.prefixdata[k] =3D v > > + end > > + end > > + end > > + -- > > local b =3D r and t.block > > if r and not b then > > local s =3D r.section > > > > --- strc-ref-old.lmt 2023-01-29 11:30:15.823643904 +0300 > > +++ strc-ref.lmt 2023-01-29 12:07:45.697109862 +0300 > > @@ -2318,7 +2318,17 @@ > > if data then > > numberdata =3D lists.reordered(data) -- data.numberdata > > if numberdata then > > - helpers.prefix(data,prefixspec) > > + -- helpers.prefix(data,prefixspec) > > + -- use the actual numbers from prefixdata > > + local prefixdata =3D data.prefixdata > > + if prefixdata then > > + -- adapted from helpers.prefix (not sure) > > + if (prefixspec and prefixspec =3D=3D no) or > > prefixdata.prefix =3D=3D no then > > + prefixdata =3D false > > + end > > + sections.typesetnumber(prefixdata,"prefix", prefixspec > > or false, prefixdata) > > + end > > + -- > > > > sections.typesetnumber(numberdata,"number",numberspec,numberdata) > > else > > local useddata =3D data.useddata > > > > After this small change, all the references are correct. However, I'm > > quite new to ConTeXt, so maybe here are some caveats. It would be great > > to fix the references to formulas, especially for the forthcoming > > document about maths. > that will bloat the already large tuc file, so here is an alternative (i > bet you can find where to patch): > > strc-ref > > local external =3D struc.references.collected -- direct referenc= es > local lists =3D struc.lists.collected -- indirect > references (derived) > local pages =3D struc.pages.collected -- pagenumber data > local sections =3D struc.sections.collected > > and > > if prefix =3D=3D "" then > prefix =3D name -- this can clash! > end > local section =3D references.section > if section then > if sections then > references.sectiondata =3D sections[section] > else > -- warning > end > end > > strc-pag: > > local sectiondata =3D references.sectiondata or > sections.collected[references.section] > if not sectiondata then > return entry, false, "no section data" > end > > there might be a few more such places where we can bind to the loaded dat= a > > Hans > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- > > > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > > _________________________________________________________________________= __________ > --000000000000a265cb05f38ae2de Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Hans,

Thank you for the= nice and straightforward solution. I have tested it locally and it works. = I hope it will be in the next release (should I do anything?).

By the way, I have a couple of other small issues. I will= describe them in detail in other threads of this mailing list if it is the= right place to do so.

Best regards,
Yar= oslav


=D0=BF=D0=BD, 30 =D1=8F=D0=BD=D0=B2. 2023 =D0=B3. = =D0=B2 12:52, Hans Hagen via ntg-context <ntg-context@ntg.nl>:
On 1/29/2023 5:03 PM, Yaroslav Beltuk= ov via ntg-context wrote:
> Dear Hans and all contributors,
>
> I really appreciate ConTeXt for the right way to obtain high quality <= br> > documents. I'm a theoretical physicist and I'm going to write = a book. I
> think ConTeXt is the right choice to work with a number of formulas, <= br> > figures and cross-references. The visual quality of formulas is better=
> than in regular LaTeX. The new feature with formula autosplitting look= s
> also very promising. For me it is important to obtain the high quality=
> without a lot of manual tweaks of each formula for each given document=
> format and figure placement.
>
> However, I have found a problem with references if I compile one
> component only. The references to formulas in other components have > wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the righ= t
> formula references are very important.
>
> I started looking into this issue. The references to other components =
> are taken from the whole product as from an external document. It turn= ed
> out that this is a general problem with references with prefixes to > external documents. The prefix is stored in a tuc file as a reference = to
> a section as a sequential number of the header in the document. As a <= br> > result, the prefix from the external document is calculated using the =
> structure of the current document.
>
> Here is the MWE, which consists of two files:
> foo.tex:
>
> \defineenumeration[remark][prefix=3Dyes, prefixsegments=3Dchapter:sect= ion]
>
> \starttext
>
> Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4]
>
> Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4]
>
> Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4]
>
> Remarks: \in[remark1], \in[remark2]
>
> \startbodymatter
>
> \chapter[chap1]{Chapter}
> \placeformula[eq1]\startformula x =3D y\stopformula
> \chapter[chap2]{Chapter}
> \section[sec1]{Section}
> \section[sec2]{Section}
> \placeformula[eq1]\startformula x =3D y\stopformula
> \placeformula[eq2]\startformula x =3D y\stopformula
>
> \stopbodymatter
>
> \startappendices
>
> \chapter[chap3]{Chapter}
> \section[sec3]{Section}
> \placeformula[eq3]\startformula x =3D y\stopformula
> \section[sec4]{Section}
> \startremark[remark1]\stopremark
> \placeformula[eq4]\startformula x =3D y\stopformula
> \startremark[remark2]\stopremark
> \chapter[chap4]{Chapter}
>
> \stopappendices
>
> \stoptext
>
>
> bar.tex:
>
> \starttext
>
> Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4]<= br> >
> Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec= 4]
>
> Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], \in[foo::= chap4]
>
> Remarks: \in[foo::remark1], \in[foo::remark2]
>
> % any chapters and sections here
>
> \stoptext
>
> It is expected to have the same first page on these documents:
>
> Equations: 1.1, 2.2, A.1, A.2
> Sections: 2.1, 2.2, A.1, A.2
> Chapters: 1, 2, A, B
> Remarks: A.2.1, A.2.2
>
> However, the bar.tex produces wrong prefixes to formulas and remarks. =
> The output depends on the document structure of bar.tex, not foo.tex.<= br> >
> I started looking into the source code. Thanks to lua, it is not a big=
> deal to track the problem. The prefixdata is complemented by the
> sectiondata after the loading the tuc file. So, the question is: is it=
> possible to store the full prefixdata with all necessary prefix number= s
> in the tuc file? Here is my proposal to change the source code:
>
> --- strc-lst-old.lmt =C2=A0 =C2=A02023-01-29 11:30:15.610309948 +0300<= br> > +++ strc-lst.lmt =C2=A0 =C2=A0 =C2=A0 =C2=A02023-01-29 12:10:08.864228= 923 +0300
> @@ -266,6 +266,16 @@
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if r and not r.section then
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0r.section =3D structures.secti= ons.currentid()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0end
> + =C2=A0 =C2=A0-- store sectiondata in prefixdata (necessary for exter= nal files)
> + =C2=A0 =C2=A0if t.prefixdata and r.section then
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0local sectiondata =3D structures.sections= .collected[r.section]
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if sectiondata then
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for k, v in next, sectionda= ta do
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0t.prefixdata[= k] =3D v
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0end
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0end
> + =C2=A0 =C2=A0end
> + =C2=A0 =C2=A0--
>=C2=A0 =C2=A0 =C2=A0 =C2=A0local b =3D r and t.block
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if r and not b then
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0local s =3D r.section
>
> --- strc-ref-old.lmt =C2=A0 =C2=A02023-01-29 11:30:15.823643904 +0300<= br> > +++ strc-ref.lmt =C2=A0 =C2=A0 =C2=A0 =C2=A02023-01-29 12:07:45.697109= 862 +0300
> @@ -2318,7 +2318,17 @@
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if data then
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0numberdata =3D lists.reordered= (data) -- data.numberdata
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if numberdata then
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0helpers.prefix(data,prefixs= pec)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- helpers.prefix(data,pref= ixspec)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- use the actual numbers f= rom prefixdata
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0local prefixdata =3D data.p= refixdata
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if prefixdata then
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- adapted fr= om helpers.prefix (not sure)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (prefixspe= c and prefixspec =3D=3D no) or
> prefixdata.prefix =3D=3D no then
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0prefixdata =3D false
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0end
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sections.type= setnumber(prefixdata,"prefix", prefixspec
> or false, prefixdata)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0end
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0sections.typesetnumber(numberdata,"number",numbe= rspec,numberdata)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0local useddata = =3D data.useddata
>
> After this small change, all the references are correct. However, I= 9;m
> quite new to ConTeXt, so maybe here are some caveats. It would be grea= t
> to fix the references to formulas, especially for the forthcoming
> document about maths.
that will bloat the already large tuc file, so here is an alternative (i bet you can find where to patch):

strc-ref

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0local external =3D struc.references.colle= cted -- direct references
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0local lists=C2=A0 =C2=A0 =3D struc.lists.= collected=C2=A0 =C2=A0 =C2=A0 -- indirect
references (derived)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0local pages=C2=A0 =C2=A0 =3D struc.pages.= collected=C2=A0 =C2=A0 =C2=A0 -- pagenumber data
local sections =3D struc.sections.collected

and

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if prefix =3D=3D "" then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0prefix =3D name -- this can clash!
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0end
local section =3D references.section
if section then
=C2=A0 =C2=A0 =C2=A0if sections then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0references.sectiondata =3D sections[secti= on]
=C2=A0 =C2=A0 =C2=A0else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- warning
=C2=A0 =C2=A0 =C2=A0end
end

strc-pag:

=C2=A0 =C2=A0 =C2=A0local sectiondata =3D references.sectiondata or
sections.collected[references.section]
=C2=A0 =C2=A0 =C2=A0if not sectiondata then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return entry, false, "no section dat= a"
=C2=A0 =C2=A0 =C2=A0end

there might be a few more such places where we can bind to the loaded data<= br>
Hans

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Hans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ridderstraat 27 | 80= 61 GH Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tel: 038 477 53 69 | www.pragma-ade.nl | www.= pragma-pod.nl
-----------------------------------------------------------------

___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / https://www.ntg.nl/mailman/listinfo/= ntg-context
webpage=C2=A0 : https://www.pragma-ade.nl / http://context.aanhet.net
archive=C2=A0 :
https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: https://contextgarden.net
___________________________________________________________________________= ________
--000000000000a265cb05f38ae2de-- --===============6366497010705531341== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cHM6Ly93d3cubnRnLm5sL21haWxtYW4v bGlzdGluZm8vbnRnLWNvbnRleHQKd2VicGFnZSAgOiBodHRwczovL3d3dy5wcmFnbWEtYWRlLm5s IC8gaHR0cDovL2NvbnRleHQuYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHBzOi8vYml0YnVja2V0 Lm9yZy9waGcvY29udGV4dC1taXJyb3IvY29tbWl0cy8Kd2lraSAgICAgOiBodHRwczovL2NvbnRl eHRnYXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============6366497010705531341==--