On 13 Dec 2024, at 20:52, Henning Hraban Ramm
Hi, I’m trying to understand the ordering of list entries and find it really hard.
There might be a bug. With no order option specified the first \writebetweenlist is positioned after the following item. It appears correctly when order=command or order=all is specified.
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 …)
As far as I can tell the only difference is that \writebetweenlist has no number. Otherwise it appears in the list in the order it appears in the document source.
* What’s the difference between location="here", "none" or nothing with \writetolist?
From the comments in source of strc-lst.mkxl (line 105) it looks like it was something introduced to deal with an issue in mkiv that no longer applies? Hard to tell without comparing both versions in detail. I can't create a test example that shows a difference.
* 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.
Ditto re the source comments.
* 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?
I'm guessing that the text of between entries counts as the title for sorting purposes. Perhaps "here" was meant to attach to the previous \writetolist for sorting purposes? I can't get sorting to work at all as per this example: \definelist[testlist][criterium=all] \starttext \subject{normal} \placelist[testlist] \subject{order=command} \placelist[testlist][order=command] \subject{order=all} \placelist[testlist][order=all] \page \writetolist[testlist]{2}{Second} \writebetweenlist[testlist]{betweenlist entry after second} The text of the second list item starts here. \page \writetolist[testlist]{1}{First} \writebetweenlist[testlist]{betweenlist entry after first} The text of the first list item starts here. \stoptext — Bruce Horrocks Hampshire, UK