Changes

Jump to navigation Jump to search
Add paragraph about footnote numbers in registers; expansion in xml.
<context mode=mkiv source=yes>
\setuppapersize[A10][A7,landscape]
 
\setuppaper[nx=4, ny=2]
\setuplayout[location=middle,marking=on]
\setuparranging [XY]
 
\definefontfeature [textfigures] [onum=yes]
=More Registers=
<{{cmd>|index</cmd> }} is only one special case of <cmd>{{gen|register</cmd>}}. You can define as much different registers as you like:
<{{cmd>|defineregister</cmd>}}<tt>[singular name][plural name]</tt>, e.g.
<texcode>
\defineregister[mouse][mice]
* Uppercase-letter index heads: {{cmd|setupregister}}<tt>[index][n=2,command=\Word,style=normal]</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.!
* If you want to use register commands in xml setups, remember that they need to be enclosed within <tt>\expanded {...}</tt>; for details, see [[System_Macros/Expansion_Control]].
* {{cmd|writetoregister}} (sometimes needed to avoid macro expansion issues, '''MkII only''')
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).
 
== Footnote numbers in registers ==
 
If you want index terms that appear in footnotes (instead of in the main text) to show the footnote number in their index entries, you can use the {{cmd|setregisterentry}} command. Wolfgang gave an example of how to use the optional third argument to achieve this:
 
<texcode>
\def\IndexPageCommand#1%
{#1\doifsomething
{\currentregisterpageuserdata{footnote}}
{\high{\currentregisterpageuserdata{footnote}}}}
 
\setupregister[index][pagecommand=\IndexPageCommand]
</texcode>
 
To mark up terms within footnotes, you would then use:
 
<texcode>
\expanded{\setregisterentry[index][entries={Indexentry}][footnote={\rawcountervalue[footnote]}]
</texcode>
=Sorting=
The details lay in a rather obscure set of methods (see {{src|sort-ini.lua|source}}), for which the following presets are defined:
* {{key|defaultmethod}} <tt>= default</tt> <tt>{{key|"zc,pc,zm,pm,uc"}} (</tt> uppercase like lowercase, diacritics separate)* {{key|beforemethod}} <tt>=before</tt> = {<tt>{key|"mm,mc,uc"}} (</tt> upper before lower, diacritics ignored)* {{key|aftermethod}} <tt>= after</tt> <tt>{{key|"pm,mc,uc}} (</tt> lower before upper, diacritics ignored)* {{key|firstmethod}} <tt>=first</tt> = <tt>{{key|"pc,mm,uc"}} (</tt> lower before upper, diacritics separate)* {{key|lastmethod}} <tt>=last</tt> = {<tt>{key|"mc,mm,uc"}} (</tt> upper before lower, diacritics separate)* If you don’t set the sorting method, the preset "<tt>first" </tt> ist used (and not "<tt>default"</tt>).* There’s no preset for the combination "uppercase like lowercase, diacritics ignored", try use {{key|"method}}<tt>={zm,pm,zc,zm,uc"}}</tt>.
* The sorting is also influenced by the current language or the language setting in {{cmd|setupregister}}.
gardener
112

edits

Navigation menu