Changes

Jump to navigation Jump to search
3,224 bytes added ,  11:38, 21 August 2020
Created page with "Documentation for \setinjector"
<?xml version='1.0'?>
<!-- this file was generated on 2020-08-20T09:05 -->
<cd:commandgroup name="setinjector" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>
<!-- a short command summary goes here -->
The command <tt>\setinjector</tt> is used for injecting actions on a TOC or register during the final stage of a document production: empty lines, page breaks etc.
</cd:shortdesc>
<cd:variants>
<cd:command file="typo-inj.mkiv" interfacedate="2020-06-19T13:41" interfacefile="i-injector.xml" level="document" name="setinjector" variantnumber="1">
<cd:arguments>
<cd:keywords ordinal="1">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:name">list,register</cd:constant>
</cd:keywords>
<cd:keywords list="yes" ordinal="2">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:number">entry number where the action must take place</cd:constant>
</cd:keywords>
<cd:keywords ordinal="3">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:command">\blank, \page</cd:constant>
</cd:keywords>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>
<!-- the long description of the command goes here -->
The command is only used in the final stage of the deocument development. It is providing a possibility to tweak the automatically assembled list.

The command <tt>\setinjector</tt> has three arguments. It works on automatically generated lists e.g. TOC, registers.
The first argument gives the name of the list to which the injector applies.
The second argument is a number denoting the number of the section to which the third argument applies. All section numbers are sequentially numbered throughout all section levels.
The third argument contains a command which is injected at the point given in the second argument.

Before setting up <tt>\setinjector</tt> one needs to run the document with <tt>\showinjector</tt> enabled. This command will show the number of the different entries in the different lists in the left margin.

This mechanism allows the user to tweak the list e.g. when a page break must occur after a certain entry or one needs to insert white space after an entry.
One needs to be aware of the fact, that the mechanism only works when no <tt>\setuplist[][alternative=command,command=...]</tt> is used for the respective list.
</cd:description>
<cd:examples>
<!-- command example(s) -->
<cd:example title="Example">
\setinjector[list][10][\page]
</cd:example>
<cd:example title="Example">
\setinjector[list] [1][{\blank[6*big]}]
</cd:example>
<cd:example title="Example">
\setinjector[register][3][\column]
</cd:example>
<!-->
</cd:examples>
<cd:notes>
<!-- this is for special remarks that do not fit elsewhere, like discovered bugs in specific context versions
<cd:note author="..." date="...">
</cd:note>
-->
</cd:notes>
<cd:seealso>
<!-- one or more of these:-->
<cd:commandref name="showinjector"></cd:commandref>
<!--
<cd:wikipage page="xx"></cd:wikipage>
<cd:url url="https://xx"></cd:url>
<cd:manual pdf="xx"></cd:manual>
<cd:source file="xx"></cd:source>
-->
<cd:source file="typo-inj.mkiv" originator="system"></cd:source>
</cd:seealso>
</cd:commandgroup>
48

edits

Navigation menu