Command/writebetweenlist

From ConTeXt wiki
Jump to: navigation, search

\writebetweenlist

Syntax

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


Description

Example

\definelist[Reprints][criterium=all]

\starttext
  \section{Sec 1}
  \writetolist[Reprints]{1.}{List entry A}
  \subsection{Subsec 1}
  \writebetweenlist[Reprints]{\hrule}
  \writetolist[Reprints]{2.}{List entry B}
  \completelist[Reprints]
\stoptext


However, in mkiv the output looks like this:

--rule--
List entry A
List entry B

According to http://archive.contextgarden.net/message/20101213.221208.577b0e51.en.html \writebetweenlist has multiple usage and these are conflicting:

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 directtly 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 show up some day.

The following example shows this:

\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


See also

Help from ConTeXt-Mailinglist/Forum

All issues with:

C O N T E X T G A R D E N

Personal tools
Namespaces
Variants
Actions
Help
External Help
Installation
Navigation
Toolbox