Changes

Jump to navigation Jump to search
348 bytes removed ,  08:59, 27 September 2017
reword collapsing section
== Collapse Page Numbers ==
Often index entries like "mouse 2,3,4,5" aren’t desired, instead ConTeXt should shorten it to "mouse 2–5". This is called collapsing.There are a few two ways to collapse page numbers. The first way is to use the `compress=yes` parameter to the {{cmd|setupregister}} command.:
The second way is to mark several pages for the same entry using # {{cmd|startregistersetupregister}}<tt>[indexcompress=yes][mymouse]{mouse}</tt> ... {{cmd|stopregister}}<tt>[index][mymouse]</tt>. This 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}}<tt>[index][mymouse1]{mouse}</tt> ... {{cmd|stopregister}}<tt>[index][mymouse1]</tt> and then {{cmd|startregister}}<tt>[index][mymouse2]{mouse}</tt> ... {{cmd|stopregister}}<tt>[index][mymouse2]</tt> to get two independent ranges in the list. {{cmd|startregister}} takes four arguments, of which two are mandatory: {{cmd|startregister}}<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}}<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}}<tt>[index][levi]</tt>.
# Enclose several pages in {{cmd|startregister}} … {{cmd|stopregister}}:
 
<texcode>
\startregister[index][Keycode1]{Keyword}
% lots of text
\stopregister[index][Keycode1]
</texcode>
 
The first parameter of {{cmd|startregister}} is the name of the index – "index" is the default index, but you might use your self defined registers as well.
 
The second parameter is a keyword to distinguish several overlapping range-entries.
 
It’s also possible to use the sorting parameter:
 
<texcode>
\startregister[index][levi][Levi-Strauss]{Lévi|-|Strauss}
% lots of text
\stopregister[index][levi]
</texcode>
 
This will create 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."
== Rename Register Heading ==
gardener
1,182

edits

Navigation menu