Changes

Jump to navigation Jump to search
m
no edit summary
== Defining lists ==
Defining {{\itemizecmd|startitemize}} -like *''itemgroups* '' is accomplished through {{\cmd|defineitemgroup}} and the correspoding corresponding setup. For historical reasons these have a non-standard, duplicate interfacerequiring some options to be specified as key-value setups, others as an argument list.For example:
<codetexcode>\defineitemgroup [myitems]\setupitemgroup [myitems] [each] [joinedup]\setupitemgroup [myitems] [each] [itemalign=flushright]<code/texcode>
The second argument determines arguments include the itemization level the settings apply to.:
The third argument comes in two varieties* item group name;* itemization level; and* list of horizontal and vertical whitespace controls.
Parameters that concern whitespace (both vertical and horizontal) belong in the argument list: ``{{code|joinedup``}}, ``{{code|packed``}}, ``{{code|nowhite`` }}, and the likesothers.
Further options are part of the setup. Both kinds , and can be given in a combined version:
<codetexcode>
\setupitemgroup [myitems] [each] [joinedup] [itemalign=flushright]
</codetexcode>
== 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:
<contexttexcode> \definesymbol [instruction_symbol_numbered] [{\framed{\currentitemnumber}}]</contexttexcode>
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=yestexcode>
\unprotect
\stopInstructions
\stoptext
</contexttexcode>
37

edits

Navigation menu