Changes

Jump to navigation Jump to search
m
Processing on Lua end
<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 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 <tt>\index</tt> command. With it's more complex and robust structure it is suitable 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> paramaters by enclosing them in inside <tt>["..."]</tt>, see example bellow.
</cd:description>
<cd:examples><cd:example title="Basic example (3 Three levels), different 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({ "MyIndex" }, { ["keys:1"]="sorting key", ["entries:1"]="displayed entry"})\stopluacode</texcode></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
138

edits

Navigation menu