Changes

Jump to navigation Jump to search
69 bytes removed ,  03:09, 25 September 2013
m
no edit summary
=Tricks=
* <{{cmd>|startregister</cmd>}}<tt>[index][mymouse]{mouse}</tt> ... <{{cmd>|stopregister</cmd>}}<tt>[index][mymouse]</tt>: to mark several pages for the same entry; becomes e.g. "mouse 12--16". Note that if you have two or more of these ranges, you need them to have different <tt>[key]</tt> values to stop the system treating them as part of a great big range. So, use <{{cmd>|startregister</cmd>}}<tt>[index][mymouse1]{mouse}</tt> ... <{{cmd>|stopregister</cmd>}}<tt>[index][mymouse1]</tt> and then <{{cmd>|startregister</cmd>}}<tt>[index][mymouse2]{mouse}</tt> ... <{{cmd>|stopregister</cmd>}}<tt>[index][mymouse2]</tt> to get two independent ranges in the list. <{{cmd>|startregister</cmd> }} takes four arguments, of which two are mandatory: <{{cmd>|startregister</cmd>}}<tt>[NAME_OF_REGISTER]{ENTRY_NAME}</tt>. The other arguments are <tt>[KEY_FOR_RANGE]</tt> and <tt>[KEY_FOR_SORTING]</tt>. To give an example: <{{cmd>|startregister</cmd>}}<tt>[index][levi][Levi-Strauss]{Lévi|-|Strauss}</tt>. This will start a range with the key <tt>levi</tt> which will put the entry "Lévi-Strauss" in the register "index" (the "normal" register) and sort it under "Levi-Strauss." To mark the end of the range, you write <{{cmd>|stopregister</cmd>}}<tt>[index][levi]</tt>.* Automatically collapse page ranges: <{{cmd>|placeindex[compress=yes]</cmd>}}* <{{cmd>|writetoregister</cmd> }} (sometimes needed to avoid macro expansion issues)* A register per chapter: <{{cmd>|placeregister</cmd>}}<tt>[index][criterium=chapter]</tt>
* Place a word in text ''and'' index: <tt>\def\Tindex#1{\index{#1}#1}</tt> -- Please someone enhance this to get space correction, [] sorting etc.!
* The name that you will get in the head of \completeregister can be set with: \setupheadtext[register=My new index]
* Get uppercase-letter heads: <{{cmd>|setupregister</cmd>}}<tt>[index][n=2,command=\Word,style=normal]</tt>* The headers in the registers (subsequent letters of the alphabet) can be disabled by <{{cmd>|setupregister</cmd>}}<tt>[register][indicator=no]</tt>; the vertical spaces between the entry groups for subsequent letters is governed by the parameter <tt>before</tt> in the same command (default: <tt>\blank</tt>, change to <tt>before={}</tt> to get no additional space).
=Coupled Registers=
This is a special feature for documents that are only used on screen: Make a word clickable to jump to the index, the first or last occurrence.
Enable it with <{{cmd>|setupregister</cmd>}}<tt>[index][coupling=yes]</tt>.Substitute <{{cmd>|index</cmd> }} with <{{cmd>|coupledindex</cmd> }} and enjoy!
=Impact on vertical spacing=
In some situations, placing an <{{cmd>|index</cmd> }} (or related command) might affect vertical spacing and the page-breaking mechanism. In those situations it is advisable to wrap the command in a <{{cmd>|doflushatpar</cmd> }} as shown below (needs a ConTeXt version dated after 14th Dec 2005):
<texcode>
</texcode>
Note the two possible definitions, and the pitfalls with each one. If you are still having trouble with specific <{{cmd>|index</cmd> }} commands, try using the alternative definition. When they are used in the right context, these three possible ways of placing an index term (the plain <{{cmd>|index</cmd>}}, or it wrapped in one of the two possible <{{cmd>|doflushatpar</cmd>}}s, should solve any problem.
419

edits

Navigation menu