Changes

Jump to navigation Jump to search
2,686 bytes added ,  20:20, 25 September 2020
Created page with "Documentation for \writetolist"
<cd:commandgroup name="writetolist" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>The command <tt>\writetolist</tt> is used to write entries to a defined list.
</cd:shortdesc>
<cd:variants>
<cd:command category="structure" file="strc-lst.mkvi" interfacedate="2020-07-14T09:24" interfacefile="i-list.xml" level="document" name="writetolist" variantnumber="1">
<cd:arguments>
<cd:keywords ordinal="1">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:list">The name of a list defined with {{cmd|definelist}}</cd:constant>
</cd:keywords>
<cd:assignments list="yes" optional="yes" ordinal="2">
<cd:assignmentsdoc></cd:assignmentsdoc>
<cd:inherit name="setuplist"></cd:inherit>
</cd:assignments>
<cd:keywords delimiters="braces" ordinal="3">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:number">The "item number"</cd:constant>
</cd:keywords>
<cd:keywords delimiters="braces" ordinal="4">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:text">Actual text</cd:constant>
</cd:keywords>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>If you use this command after an unnumbered section commands beware that it will become a candidate for a page break. A workaround is:

<texcode>
\subject{\bf My title!}
\dontleavehmode
\writetolist[myrandompart]{}{It's a test}
</texcode>

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.

</cd:description>
<cd:examples><cd:example title=""><texcode>
\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
</texcode></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:commandref name="definelist" originator="system"></cd:commandref>
<cd:commandref name="setuplist" originator="system"></cd:commandref>
<cd:source file="strc-lst.mkvi" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Structure"></cd:wikipage>
<cd:commandref name="writebetweenlist"></cd:commandref></cd:seealso>
</cd:commandgroup>

Navigation menu