Open main menu

Changes

m
Link to \index command
<cd:commandgroup name="setregisterentry" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc><!-- a short command summary goes here -->
The command <tt>\setregisterentry</tt> is used for putting the writes entry to the register. Contrary to <tt>\index</tt> command it allows user to specify sorting keys of up to three levels.
</cd:shortdesc>
<cd:variants>
</cd:variants>
<cd:description><!-- the long description of the command goes here -->
<tt>\setregisterentry</tt> is more structured form of the regular {{cmd|index}} command. With its more complex and robust structure it is suitable for automatic workflows.
 
When processing the command on Lua end, one has to take care of colons in the <tt>key:1</tt> and <tt>entry:1</tt> parameters by enclosing them inside <tt>["..."]</tt>, which is more robust form of putting key in Lua table, see example bellow.
</cd:description>
<cd:examples><cd:example title="Basic example (3 Three levels), changes in the sorting, comma in the entry"><texcode>\setupregister[index][balance=no]
\starttext
\chapter{Alfred Hitchcock}
 
The Skin Game (1931) \setregisterentry[index]
keys:3=Rich and Strange,
entries:3=Rich and Strange]
 
Number Seventeen (1932) \setregisterentry[index]
\blank
\placeregister[index] % without title
\stoptext
</texcode></cd:example><cd:example title="Processing on Lua end"><texcode>\startluacodecontext.setregisterentry({ "index" }, { ["keys:1"]="sorting key", ["entries:1"]="displayed entry"})\stopluacode</texcode></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:source file="strc-reg.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Structure"></cd:wikipage><cd:wikipage page="Registers"></cd:wikipage></cd:seealso>
</cd:commandgroup>
138

edits