Command/writetolist

From Wiki
Jump to navigation Jump to search


\writetolist

Summary

The command \writetolist is used to write entries to a defined list.

Settings

\writetolist[...][...=...,...]{...}{...}
[...]list
...=...,...inherits from \setuplist
{...}number
{...}text

OptionExplanation
list The name of a list defined with \definelist
number The "item number"
text Actual text

Description

If you use this command after an unnumbered section command beware that it will become a candidate for a page break. A workaround is:
\subject{\bf My title!}
\dontleavehmode
\writetolist[myrandompart]{}{It's a test}

However, according to mailing list messages (from 2010), keep in mind that it introduces 'something' in the text stream, so when whitespace is setup, in some cases you can get some extra. Also, this box can end up on the current page or the next one, depending on the circumstances. In practice it's no real problem as one will do explicit writes inside boxes or so. I.e., just bind the write to some text.

In addition you might get spurious spaces after this command. So it is best to add a % sign after it.

The default table of contents is a combined list. To write to it one has to choose the level to which it should be inserted: \writetolist[chapter]{1.}{Chapter list entry A}, \writetolist[section]{1.1}{Section list entry A}, etc.

Examples

Example 1

\definelist[Reprints][criterium=all]

\starttext
  \section{Sec 1}
  \writetolist[Reprints]{1.}{List entry A}%
  \writetolist[Reprints]{}{With no number}%
  \subsection{Subsec 1}
  \writetolist[Reprints]{2.}{List entry B}%
  \completelist[Reprints]
\stoptext

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: