# [NTG-context] Add items to list with arbitrary page number

denis.maier at ub.unibe.ch denis.maier at ub.unibe.ch
Thu Mar 18 10:28:57 CET 2021

```That's neat Hans. Thanks. Especially didn't know about \writedatatolist.

What I want is basically to manually construct a toc entry, but in compliance with the overall styling of the contents list.

So, I was hoping for something like this?

\writetolist[chapter][location=here,pagenumber=4]{5}{It's a test}

Maybe I'm missing an easier way to achieve this?

Denis

P.S.: I don't really understand  what these \installXprocessor commands do. Is that documented somewhere?

-----Ursprüngliche Nachricht-----
Von: Hans Hagen <j.hagen at xs4all.nl>
Gesendet: Donnerstag, 18. März 2021 00:22
An: mailing list for ConTeXt users <ntg-context at ntg.nl>; Maier, Denis Christian (UB) <denis.maier at ub.unibe.ch>
Betreff: Re: [NTG-context] Add items to list with arbitrary page number

On 3/17/2021 6:19 PM, denis.maier at ub.unibe.ch wrote:
> Hi,
>
> I need to add an item to a list with an arbitrary page number. (The
> reason is that I have a multivolume book, and I want to add
> information about the other books to the TOC)
>
>
> \writetolist[section]{}{It's a test}
>
> But how can you add an arbitrary page number ?
It all depends on what you want to do ....

\starttext

\installstructurelistprocessor{chapter:userdata}
{\startlinecorrection[blank]
\hfill \inframed{you really need to look at \structurelistuservariable{pagenumber}}%
\stoplinecorrection}

\placelist[chapter]

\chapter{one}

\writebetweenlist[chapter][location=here]{\blank page 4\blank}

\writedatatolist[chapter][location=here][pagenumber=4]

\writetolist[chapter]{}{It's a test}

\chapter{two}

\stoptext

wikifyable

Hans

-----------------------------------------------------------------