Changes

Jump to navigation Jump to search
m
no edit summary
== Defining lists ==
Defining {{\cmd|itemize}} like *itemgroups* is accomplished through {{\cmd|defineitemgroup}} and the correspoding setup. For historical reasons these have a non-standard, duplicate interface
requiring some options to be specified as key-value setups, others as an argument list.
<code>
\defineitemgroup [myitems]\setupitemgroup [myitems] [each] [joinedup]\setupitemgroup [myitems] [each] [itemalign=flushright]</code>
The second argument determines the itemization level the settings apply to.
The third argument comes in two varieties.
Parameters that concern whitespace (both vertical and horizontal) belong in the argument list: ``joinedup``, ``packed``, ``nowhite`` , and the likesothers.
Further options are part of the setup. Both kinds can be given in a combined version:
== Custom bullets ==
Bullets are very flexible. They hook into the {{\cmd|symbol}} mechanism.
The macro generator here is {{\cmd|definesymbol}}. Basically it allows for all valid Context code to appear inside the definition, including the list item counter. This counter can be accessed via {{\cmd|currentitemnumber}}. To achieve the “item number in a box” effect we have to draw this
number as the contents of the box like so:
<contextcode> \definesymbol [instruction_symbol_numbered] [{\framed{\currentitemnumber}}]</contextcode>
The {{\cmd|framed}} must be adapted to the specific requirements.
== Putting it together ==
Below listing combines all the above into one working example.
<context source=yescode>
\unprotect
\stopInstructions
\stoptext
</contextcode>
419

edits

Navigation menu