Changes

Jump to navigation Jump to search
483 bytes added ,  14:03, 29 May 2009
Improved organization ; enhanced presentation of code vs results
< [[Structurals]]
 
= Overview of commands =
 
== \startitemize ==
The most basic form of using enumerations in ConTeXt is
* <tt>text</tt> (paragraph enumerations, formats the items as a running text).
== \setupitemize == 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 You will find more about <cmd>defineitemgroupsetupitemize</cmd> (which unfortunately seems undocumented). For example, something similar to the LaTeX at <ttcmd>itemizedefineitemgroup</ttcmd> environment can be defined as follows:.
== \defineitemgroup == For finer control, it is advisable to create new types of itemization, using the command <cmd>defineitemgroup</cmd> (which unfortunately seems undocumented). For example: {| ! width="45%"| ! width="10%"| ! width="45%"| |- | <texcode>
\defineitemgroup[ltxitm][levels=5]
%
\stoptext
</texcode>
|gives | <context>
\defineitemgroup[ltxitm][levels=5]
%
\stoptext
</context>
|}
==Changing the Signs=Customization details and examples =
For a enumeration like this:==Labels==
{| ! width="50%"| ! width="50%"| |- |<context>
\starttext
\setupitemize[left=(, right=), margin=4em, stopper=]
\stoptext
</context>
| <texcode>
\setupitemize[left=(, right=), margin=4em, stopper=]
\startitemize[a]
\item one item,
\item next item.
\stopitemize
</texcode>
* <tt>margin</tt> is from left margin to start of item text
* <tt>stopper</tt> is the dot (or whatever) after the "number"
|}
you must fill <cmd>setupitemize</cmd> like this:
* you get parentheses by <tt>left== Spacing =(, right=)</tt>* <tt>margin</tt> This is from left margin to start of item textthe way how you can set spacing before and after itemize when working with* <tttexcode>stopper\setupwhitespace[big]</tttexcode> is the dot (or whatever) after the "number" An option '''nowhite''' comes in handy:
<texcode>
paragraph before \setupitemizestartitemize[left=(, right=)joinedup, margin=4emnowhite, stopper=]\startitemize[aafter]\item one item,first\item next item.second
\stopitemize
 
paragraph after
</texcode>
You find more about <cmd>setupitemize</cmd> at <cmd>defineitemgroup</cmd>.These are all the four possible combinations of whitespace settings that you might want to use: 
<context>
\setuplayout[scale=0.8,width=9cm]
\setupwhitespace[big]
\definesymbol[1][$\triangleright$]
\startcolumns
{\bf joinedup:} \startitemize[joinedup] \item test \item test \stopitemize after \par
{\bf joinedup,nowhite:} \startitemize[joinedup,nowhite] \item test \item test \stopitemize after \column
{\bf joinedup,nowhite,before:} \startitemize[joinedup,nowhite,before] \item test \item test \stopitemize after \par
{\bf joinedup,nowhite,after:} \startitemize[joinedup,nowhite,after] \item test \item test \stopitemize after
\stopcolumns
</context>
 
==Multicolumn==
==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
{| ! width="45%"| ! width="10%"| ! width="45%"| |- | <texcode>
\starttext
\stoptext
</texcode>
||<context>
\starttext
</context>
|}
=Other considerations = Whitespace around itemize == This is the way how you can set spacing before and after itemize when working with<texcode>\setupwhitespace[big]</texcode> An option '''nowhite''' comes in handy: <texcode>paragraph before \startitemize[joinedup,nowhite,after]\item first\item second\stopitemize paragraph after</texcode> These are all the four possible combinations of whitespace settings that you might want to use:  <context>\setuplayout[scale=0.8,width=9cm]\setupwhitespace[big]\definesymbol[1][$\triangleright$]\startcolumns{\bf joinedup:} \startitemize[joinedup] \item test \item test \stopitemize after \par{\bf joinedup,nowhite:} \startitemize[joinedup,nowhite] \item test \item test \stopitemize after \column{\bf joinedup,nowhite,before:} \startitemize[joinedup,nowhite,before] \item test \item test \stopitemize after \par{\bf joinedup,nowhite,after:} \startitemize[joinedup,nowhite,after] \item test \item test \stopitemize after\stopcolumns</context>
== Randomizing items ==
Example:
<context source{| ! width="45%"| ! width="10%"| ! width="yes45%"| |- | <texcode>\nextrandom\startitemize[random]\startitem A \stopitem\startitem B \stopitem\startitem C \stopitem%\startitem F \stopitem\stopitemize</texcode>|| <context>
\nextrandom
\startitemize[random]
\stopitemize
</context>
|}
== Referring to items ==
You can also use a reference to an item, just like a chapter or section. See also [[References]].
<context source{| ! width="45%"| ! width="10%"| ! width="yes45%"| |- | <texcode>\starttext\startitemize[n]\item A\item[foo] B\item C\stopitemize\dotsAs seen in \in{item}[foo] on page \at{page}[foo], B is teh shizzle.\stoptext</texcode> | | <context>
\starttext
\startitemize[n]
\stoptext
</context>
|}

Navigation menu