From Wiki
Jump to navigation Jump to search


Syntax (autogenerated)

...=...,...inherits from \setuplist


[...] section name
{...} text


Insert something in that is not a list element in the middle of a list. Most often a command such as \hrule, or a header.


Further notes

According to \writebetweenlist has multiple usage and these are conflicting:

  • in order to get the right page info associated it needs to be anchored in the text stream
  • in that case a node can interfere with spacing and can come unexpected
  • sometimes direct flushing is needed, sometimes delayed

An option has been added to (1) the flushers and (2) the list placers. (as december 14, 2010).

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 location to here.

Another way to force a certain order is to set the order variable when placing a list. The command option only pushes commands into the right order, and all orders all entries (which might be too much). In this case no specific location is needed with the inbetween method. Maybe additional mechanisms will show up some day.

The following example shows this:

% mode=mkiv
\definepapersize[scroll][width=12cm, height=20cm]



    (Ordering all entries, whether created with \tex{writetolist} or \tex{writebetweenlist})

    (Ordering the \tex{writebetweenlist} items, retaining the order of the entries)
    (Placing all entries in order of appearance)

    % --- and now we put write the entries to the list ---

    \writetolist     [testlist]               {1} 
        {1/3 -- 1/6 -- (location=here)}

        \framed[width=\hsize, frame=off, 
                background=color, backgroundcolor=red,
        {\blackrule[width=2.5em, height=0em] 
         1/3 -- 2/6 -- (location=...)}}

        \framed[width=\hsize, frame=off, 
                background=color, backgroundcolor=cyan,
        {\blackrule[width=2.5em, height=0em] 
         2/3 -- 3/6 -- location=here}}

    \writetolist     [testlist]               {2} 
        {2/3 -- 4/6 -- (location=here)}

    \writetolist     [testlist][location=none]{W} 
        {3/3 -- 5/6 -- location=none}

        \framed[width=\hsize, frame=off, 
                background=color, backgroundcolor=yellow,
        {\blackrule[width=2.5em, height=0em] 
         3/3 -- 6/6 -- (location=...)}}


See also

Help from ConTeXt-Mailinglist/Forum

All issues with: