Hi Jim,

Well ... it seem that the wiki example is uncompletely written.  What's the problem?

 * The second argument of |\writetolist[Reprints]{1.}{...}| (the “1.”)
   is indeed *stored* in the list, but the default formatting of
   the| Reprints list**|*does not display* this field.
 * So this is neither a ConTeXt bug nor “your fault”: the wiki example
   is simply incomplete/misleading because it does not show how to
   configure |\setuplist| to use the first argument. You have to tell
   ConTeXt how to display the list items, via

|\setuplist[Reprints][command=...]|.

Then, try this MWE :

\definelist[Reprints][criterium=all]

% #1 = "numéro" (1., 2., …) passé à \writetolist

% #2 = texte de l'entrée

% #3 = numéro de page

\define[3]\ReprintsEntry{%

\hbox to 2em{#1\hss} % a little column to the number

#2%

\hfill

#3%

\par

}


\setuplist

[Reprints]

[alternative=command,

command=\ReprintsEntry]


\starttext


\section{Sec 1}

\writetolist[Reprints]{1.}{List entry A}

\writetolist[Reprints]{}{With no number}

\subsection{Subsec 1}

\writetolist[Reprints]{2.}{List entry B}


\blank[2*big]

\title{Reprints}

\completelist[Reprints]


\stoptext


2. "bonus" questions :

Answer A :

\getnumber[chapter]
\getnumber[section]
\getnumber[subsection]
% etc.


Answer B : see this little MWE :

\starttext
  \chapter{Un chapitre}
  Le numéro de ce chapitre est \getnumber[chapter].

  \section{Une section}
  Le numéro de cette section est \getnumber[section].
\stoptext

Note : Can you correct the wiki in the right way with a functional MWE of your choice? Thanks!

Hope this helps,

JP

Le 25/11/2025 à 15:30, Jim a écrit :
Hi all,

athttps://wiki.contextgarden.net/Command/writetolist we see the example

%%%%
\definelist[Reprints][criterium=all]

\starttext
   \section{Sec 1}
   \writetolist[Reprints]{1.}{List entry A}%
   \writetolist[Reprints]{}{With no number}%
   \subsection{Subsec 1}
   \writetolist[Reprints]{2.}{List entry B}%
   \completelist[Reprints]
\stoptext
%%%%

and the TOC entries cause me to speculate that the intention of this
example is that, in the TOC, "List Entry A" will be annotated with "1."
(and "List Entry B" will have "2.").

But when I run that example, neither of those entries have numbers.

Can someone tell me whether
(a) it's somehow a "me" problem, or
(b) it's a ConTeXt problem?

Thanks.

Bonus question: is there a macro or counter or token list or ... which has
the number of the current chapter (and section and subsection and ...)?

Thanks ^ 2.

                                 Jim
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to