Command/writetolist

From ConTeXt wiki
Jump to navigationJump to search

\writetolist

Syntax (autogenerated)

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


Syntax

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


Description

The command writes an entry in the defined list (the first argument}, the second is the numbered part (like "1."), the third the actual text.

1. = List name

2. = Number

3. = Text to be written to the list

If you use this command after an unnumbered section commands 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 http://archive.contextgarden.net/message/20101215.114056.3e6896f2.en.html and http://archive.contextgarden.net/message/20101215.114240.750c88d7.en.html, 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.

Example

\definelist[Reprints][criterium=all]

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

See also

\writebetweenlist

Help from ConTeXt-Mailinglist/Forum

All issues with: