Changes

Jump to navigation Jump to search
5,214 bytes added ,  19:59, 18 March 2006
m
Reverted edit of !!!!!!!!!!!!TROLL!!!!!!!!!!!!!!!!!!!!!, changed back to last version by Taco
< [[Structurals]]

The most basic form of using enumerations in ConTeXt is

<texcode>
\startitemize
\item here we list the points,
\item one after the other.
\stopitemize
</texcode>

The <cmd>startitemize</cmd> command takes optional parameters (see the documentation of <cmd>startitemgroup</cmd> for a complete list), for example a number conversion may be given, with the following predefined types:

<table>
<tr><td><tt>n</tt> or <tt>N</tt></td><td>Usually the default: a numbered list</td></tr>
<tr><td><tt>m</tt></td><td>A numbered list, with lowercase (&ldquo;medieval&rdquo;, aka &ldquo;oldstyle&rdquo;) numbers.</td></tr>
<tr><td><tt>1</tt> &hellip; <tt>8</tt></td><td>Different kinds of bullets. All items get the same symbol.</td></tr>
<tr><td><tt>a</tt></td><td>Items are numbered a., b., c., &hellip;</td></tr>
<tr><td><tt>A</tt></td><td>Items are numbered A., B., C., &hellip;</td></tr>
<tr><td><tt>AK</tt></td><td>Items are numbered A., B., C., &hellip;, in small caps.</td></tr>
<tr><td><tt>r</tt></td><td>Items are numbered in lowercase Roman numerals.</td></tr>
<tr><td><tt>R</tt></td><td>Items are numbered in uppercase Roman numerals.</td></tr>
<tr><td><tt>KR</tt></td><td>Items are numbered in uppercase Roman numerals, small caps style.</td></tr>
</table>

It is also possible to define your own number conversions; see [[User-Defined Enumerations]]. If you have loaded the [[Chinese]] module, you can also use <tt>c</tt> (and some more) for Chinese numbers.

Additional parameters include
* <tt>continue</tt> (start where the previous itemization was finished, to allow text injections),
* <tt>packed</tt> (less vertical space between items),
* <tt>inmargin</tt> (place enumeration symbols into the margin), and
* <tt>text</tt> (paragraph enumerations, formats the items as a running text).

To change the general layout of enumerations, there is <cmd>setupitemize</cmd>. It accepts an integer as its first parameter to denote for which level of itemization the subsequent settings should apply. There is an example below.

For finer control, it is advisable to create new types of itemization, using the command <cmd>defineitemgroup</cmd> (which unfortunately seems undocumented). For example, something similar to the LaTeX <tt>itemize</tt> environment can be defined as follows:

<texcode>
\defineitemgroup[ltxitm][levels=5]
%
\setupitemgroup[ltxitm][1][1]
\setupitemgroup[ltxitm][2][2]
\setupitemgroup[ltxitm][3][3,packed]
\setupitemgroup[ltxitm][4][4,packed]
\setupitemgroup[ltxitm][5][5,packed]
%
\starttext
%
\startltxitm
\item Consider
\startltxitm
\item this part
\item and also these subpoints:
\startltxitm
\item one
\item two
\item three
\startltxitm
\item threeandahalf
\stopltxitm
\item four
\stopltxitm
\stopltxitm
\stopltxitm
%
\stoptext
</texcode>

gives

<context>
\defineitemgroup[ltxitm][levels=5]
%
\setupitemgroup[ltxitm][1][1]
\setupitemgroup[ltxitm][2][2]
\setupitemgroup[ltxitm][3][3,packed]
\setupitemgroup[ltxitm][4][4,packed]
\setupitemgroup[ltxitm][5][5,packed]
%
\starttext
%
\startltxitm
\item Consider
\startltxitm
\item this part
\item and also these subpoints:
\startltxitm
\item one
\item two
\item three
\startltxitm
\item threeandahalf
\stopltxitm
\item four
\stopltxitm
\stopltxitm
\stopltxitm
%
\stoptext
</context>

==Changing the Signs==

For a enumeration like this:

<context>
\starttext
\setupitemize[left=(, right=), margin=4em, stopper=]
\startitemize[a, packed]
\item one item,
\item next item.
\stopitemize
\stoptext
</context>

you must fill <cmd>setupitemize</cmd> like this:

* you get parentheses by <tt>left=(, right=)</tt>
* <tt>margin</tt> is from left margin to start of item text
* <tt>stopper</tt> is the dot (or whatever) after the "number"

<texcode>
\setupitemize[left=(, right=), margin=4em, stopper=]
\startitemize[a]
\item one item,
\item next item.
\stopitemize
</texcode>

You find more about <cmd>setupitemize</cmd> at <cmd>defineitemgroup</cmd>.


==Alternate Multicolumn Format==
Hans posted a solution to the list for a multicolumn enumeration that counts across then down, instead of down then across. When he posted it (Dec 21, 2005), he said the joinedup option does not work, but he would fix that. This is a version without the tufte and zapf text

<texcode>
\starttext

Some previous sentence before the list

\startitemize[columns,n,joinedup]
\item one
\item two
\stopitemize
\startitemize[continue,columns,joinedup]
\item one
\item two
\stopitemize
\startitemize[continue,columns,joinedup]
\item one
\item two
\stopitemize

And the text continues after the list

\stoptext
</texcode>

<context>
\starttext

Some previous sentence before the list

\startitemize[columns,n,joinedup]
\item one
\item two
\stopitemize
\startitemize[continue,columns,joinedup]
\item one
\item two
\stopitemize
\startitemize[continue,columns,joinedup]
\item one
\item two
\stopitemize

And the text continues after the list

\stoptext

</context>

Navigation menu