\currentlistentrynumber and \currentlistlocation

Dear list, I’m struggling with an alternative list setup: \showframe \setupinteraction [state=start, style=, focus=standard] \enabledirectives[references.border=red] \definelistalternative [pmcols] [renderingsetup=pmcol] \startsetups [pmcol] \ifnum\modulonumber{3}{\currentlistentrylocation} = 1 \dontleavehmode% \rlap{\[\currentlistentrynumber\]\nbsp\nbsp\nbsp% \currentlistentrypagenumber\narrownobreakspace·% \narrownobreakspace\the\numexpr1+\currentlistentrypagenumber\relax} \orelse\ifnum\modulonumber{3}{\currentlistentrylocation} = 2 \hfill\[\currentlistentrynumber\]\nbsp\nbsp\nbsp% \currentlistentrypagenumber\narrownobreakspace·% \narrownobreakspace\the\numexpr1+\currentlistentrypagenumber\relax \else \hfill\llap{\[\currentlistentrynumber\]\nbsp\nbsp\nbsp% \currentlistentrypagenumber\narrownobreakspace·\narrownobreakspace% \the\numexpr1+\currentlistentrypagenumber\relax}\crlf \fi \stopsetups \definestructureconversionset[rom][n,R] \setuphead[title] [page=yes] \setuphead[chapter] [page=even, sectionconversionset=rom] \starttext \placelist [chapter] [alternative=pmcols, criterium=all, interaction=all] \dorecurse{100} {\startchapter \samplefile{zapf} \stopchapter} \stoptext The sample above works only here, not in my real world document. The main reason is that \currentlistentrylocation doesn’t give the same number as \currentlistentrynumber. Is there any way (considering the sample above, where chapter has to be in Roman capital numbers) to get the pure number value of \currentlistentrynumber? BTW, I wonder also how could I get a link to the corresponding chapter (as standard lists always have with interaction enabled). Many thanks for your help, Pablo

On 3/1/25 13:26, Pablo Rodriguez via ntg-context wrote:
Is there any way (considering the sample above, where chapter has to be in Roman capital numbers) to get the pure number value of \currentlistentrynumber?
Partly replying to myself, I found it in strc-lst.mkxl: \structurelistrawnumber{chapter}
BTW, I wonder also how could I get a link to the corresponding chapter (as standard lists always have with interaction enabled).
But this is something yet to be discovered. Pablo

On 3/1/2025 2:17 PM, Pablo Rodriguez via ntg-context wrote:
On 3/1/25 13:26, Pablo Rodriguez via ntg-context wrote:
Is there any way (considering the sample above, where chapter has to be in Roman capital numbers) to get the pure number value of \currentlistentrynumber?
Partly replying to myself, I found it in strc-lst.mkxl:
\structurelistrawnumber{chapter}
BTW, I wonder also how could I get a link to the corresponding chapter (as standard lists always have with interaction enabled).
But this is something yet to be discovered.
\definelistalternative [pmcols] [renderingsetup=list:pmcol] \startsetups [list:pmcol:common] \relax % prevent lookahead [\currentlistentrynumber] \nbsp\nbsp\nbsp \startcurrentlistentrywrapper \currentlistentrypagenumber \narrownobreakspace · \narrownobreakspace \the\numexpr\currentlistentrypagenumber + 1\relax \stopcurrentlistentrywrapper \stopsetups \startsetups [list:pmcol] \ifnum{\structurelistrawnumber{\currentlist} ; 3} = 1\relax \dontleavehmode \rlap { \directsetup{list:pmcol:common} } \orelse\ifnum{\structurelistrawnumber{\currentlist} ; 3} = 2\relax \hfill \directsetup{list:pmcol:common} \else \hfill \llap { \directsetup{list:pmcol:common} } \crlf \fi \stopsetups it's wikifyable I guess (and made into a test suite example) 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 -----------------------------------------------------------------

On 3/2/2025 12:33 PM, Hans Hagen wrote:
On 3/1/2025 2:17 PM, Pablo Rodriguez via ntg-context wrote:
On 3/1/25 13:26, Pablo Rodriguez via ntg-context wrote:
Is there any way (considering the sample above, where chapter has to be in Roman capital numbers) to get the pure number value of \currentlistentrynumber?
Partly replying to myself, I found it in strc-lst.mkxl:
\structurelistrawnumber{chapter}
BTW, I wonder also how could I get a link to the corresponding chapter (as standard lists always have with interaction enabled).
But this is something yet to be discovered.
\definelistalternative [pmcols] [renderingsetup=list:pmcol]
\startsetups [list:pmcol:common] \relax % prevent lookahead [\currentlistentrynumber] \nbsp\nbsp\nbsp \startcurrentlistentrywrapper \currentlistentrypagenumber \narrownobreakspace · \narrownobreakspace \the\numexpr\currentlistentrypagenumber + 1\relax \stopcurrentlistentrywrapper \stopsetups
\startsetups [list:pmcol] \ifnum{\structurelistrawnumber{\currentlist} ; 3} = 1\relax \dontleavehmode \rlap { \directsetup{list:pmcol:common} } \orelse\ifnum{\structurelistrawnumber{\currentlist} ; 3} = 2\relax \hfill \directsetup{list:pmcol:common} \else \hfill \llap { \directsetup{list:pmcol:common} } \crlf \fi \stopsetups
it's wikifyable I guess (and made into a test suite example)
You still need soem acessor for the raw page number because you cannot just increment something that gets formatted. So I added an extra helper (and made the other more consistent, basically they were just internal helpers). So then we get this: \setupinteraction [state=start] \definelistalternative [pmcols] [renderingsetup=list:pmcol] \startsetups [list:pmcol:common] \relax % prevent lookahead [\currentlistentrynumber] \nbsp\nbsp\nbsp \startcurrentlistentrywrapper \currentlistentrypagenumber \narrownobreakspace · \narrownobreakspace \the\numexpr\structurelistuserpagenumber + 1\relax \stopcurrentlistentrywrapper \stopsetups \startsetups [list:pmcol] \ifnum{\structurelistnumber ; 3} = 1\relax \dontleavehmode \rlap { \directsetup{list:pmcol:common} } \orelse\ifnum{\structurelistnumber ; 3} = 2\relax \hfill \directsetup{list:pmcol:common} \else \hfill \llap { \directsetup{list:pmcol:common} } \crlf \fi \stopsetups \definestructureconversionset[rom][n,R] \setuphead [title] [page=yes] \setuphead [chapter] [page=even, sectionconversionset=rom] \starttext \placelist [chapter] [alternative=pmcols,criterium=all,interaction=all] \page \dorecurse {10} { \startchapter[title={Zapf #1}] \samplefile{zapf} \stopchapter } \stoptext You need a newer strc-lst which i'll send you (and wolfgang) off list. There will be no upload till after the te xlive release (end of the week) so any bug fix / feature is pending till then. 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 -----------------------------------------------------------------

On 3/2/25 13:42, Hans Hagen via ntg-context wrote:
On 3/2/2025 12:33 PM, Hans Hagen wrote: [...] You need a newer strc-lst which i'll send you (and wolfgang) off list. There will be no upload till after the tex live release (end of the week) so any bug fix / feature is pending till then.
Ok, I will test the new files this week. Many thanks for your help again, Pablo

On 3/2/25 13:42, Hans Hagen via ntg-context wrote:
[...] There will be no upload till after the te xlive release (end of the week) so any bug fix / feature is pending till then.
If it were possible, it would be great to update https://www.context-on-web.eu/ to that version (so we could confirm any issues that version might have). Many thanks for your help, Pablo

On 3/2/25 12:33, Hans Hagen wrote:
On 3/1/2025 2:17 PM, Pablo Rodriguez via ntg-context wrote: [...] it's wikifyable I guess (and made into a test suite example)
Many thanks for your reply, Hans. https://wiki.contextgarden.net/Document_structure_and_headlines/Table_of_con.... Pablo
participants (3)
-
Hans Hagen
-
Hans Hagen
-
Pablo Rodriguez