Hi,
I’m trying to understand the ordering of list entries and find it really
hard.
Below is the content of "inbetween-01.tex" from the test suite, more or
less the same was in
https://wiki.contextgarden.ne/Command/writebetweenlist; I tried to
enhance it but probably messed it up.
Looking at the examples, I only partly understand what’s going on.
* What’s the difference of \writetolist and \writebetweenlist WRT their
connection to the place where they occur? This seems to be important.
(\writetolist has a section number, \writebetweenlist hasn’t …)
* What’s the difference between location="here", "none" or nothing with
\writetolist?
* In my notes, I found the remark that "between" items should be
anchored to a paragraph (not being their own par) to avoid inserting
whitespace.
* The order of \placelist can be normal, command, all or title. The
latter isn’t mentioned in the file below, but in the interface. I don’t
understand the effect for "normal" or "all" in the example.
- normal: there’s some reordering.
- command: "only the commands": does this mean, sort the "between"
entries by macro name or how?
- all: everything in the order of occurrence (that’s clear)
- title: sorted by title; how does this affect "between" entries?
Hraban
""" % inbetween-01.tex
\definelist[testlist][criterium=all]
\starttext
Regular list entries are bound to a specific location in order to
get the right pagenumber etc.\ associated. When pushing something
inbetween (in mkiv) it ends up directly in the list. This is the
default because otherwise users will wonder why spacing might get
messed up (due to an unseen but present node). It is possible to
force a location by explicitly setting \type {location} to \type
{here}.
Another way to force a certain order is to set the \type {order}
variable when placing a list. The \type {command} option only
pushes commands into the right order, and \type {all} orders all
entries (which might be too much). In this case no specific
location is needed with the inbetween method. Maybe additional
mechanisms show up some day.
\subject{normal} \placelist[testlist]
\subject{command} \placelist[testlist][order=command]
\subject{all} \placelist[testlist][order=all]
\page \input tufte
\writetolist [testlist] {1} {One}
\writebetweenlist[testlist]
{\blackrule[color=red,width=\hsize]}
\writebetweenlist[testlist][location=here]{\blackrule[color=blue,width=\hsize]}
\writetolist [testlist] {2} {Second}
\writetolist [testlist][location=none]{W} {Whatever}
\writebetweenlist[testlist]
{\blackrule[color=green,width=\hsize]}
\stoptext
"""
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl /
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
___________________________________________________________________________________