Difference between revisions of "Command/replaceword"
m |
Max Chernoff (talk | contribs) (Add discretionary example) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<cd:commandgroup name="replaceword" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807"> | <cd:commandgroup name="replaceword" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807"> | ||
<cd:shortdesc><!-- a short command summary goes here --> | <cd:shortdesc><!-- a short command summary goes here --> | ||
− | The command <tt>\replaceword</tt> can add replacement words to ligature exception dictionaries.</cd:shortdesc> | + | The command <tt>\replaceword</tt> can add replacement words to ligature exception dictionaries. Define different replacement sets and activate them with {{cmd|setreplacements}}.</cd:shortdesc> |
<cd:variants> | <cd:variants> | ||
<cd:command category="language" file="lang-rep.mkiv" interfacedate="2021-03-02T11:08" interfacefile="i-replacement.xml" level="style" name="replaceword" variantnumber="1"> | <cd:command category="language" file="lang-rep.mkiv" interfacedate="2021-03-02T11:08" interfacefile="i-replacement.xml" level="style" name="replaceword" variantnumber="1"> | ||
Line 7: | Line 7: | ||
<cd:keywords ordinal="1"> | <cd:keywords ordinal="1"> | ||
<cd:keywordsdoc></cd:keywordsdoc> | <cd:keywordsdoc></cd:keywordsdoc> | ||
− | <cd:constant type="cd:name"></cd:constant> | + | <cd:constant type="cd:name">category</cd:constant> |
</cd:keywords> | </cd:keywords> | ||
<cd:keywords optional="yes" ordinal="2"> | <cd:keywords optional="yes" ordinal="2"> | ||
<cd:keywordsdoc></cd:keywordsdoc> | <cd:keywordsdoc></cd:keywordsdoc> | ||
− | <cd:constant type="cd:text"></cd:constant> | + | <cd:constant type="cd:text">target</cd:constant> |
</cd:keywords> | </cd:keywords> | ||
<cd:keywords ordinal="3"> | <cd:keywords ordinal="3"> | ||
<cd:keywordsdoc></cd:keywordsdoc> | <cd:keywordsdoc></cd:keywordsdoc> | ||
− | <cd:constant type="cd:text"></cd:constant> | + | <cd:constant type="cd:text">replacement</cd:constant> |
</cd:keywords> | </cd:keywords> | ||
</cd:arguments> | </cd:arguments> | ||
Line 22: | Line 22: | ||
<cd:description><!-- the long description of the command goes here --> | <cd:description><!-- the long description of the command goes here --> | ||
</cd:description> | </cd:description> | ||
− | <cd:examples></cd:examples> | + | <cd:examples><cd:example title="Discretionaries">You can insert discretionaries in the replacement text like this: |
+ | |||
+ | <context source="yes" > | ||
+ | \setuppapersize[A6][A6] | ||
+ | |||
+ | \replaceword[category][ABCDEFGHIJ][ABCDE{1}{2}{3}FGHIJ] | ||
+ | \setreplacements[category] | ||
+ | |||
+ | \starttext | ||
+ | |||
+ | ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ | ||
+ | |||
+ | \stoptext | ||
+ | </context></cd:example></cd:examples> | ||
<cd:notes></cd:notes> | <cd:notes></cd:notes> | ||
<cd:seealso> | <cd:seealso> |
Latest revision as of 07:05, 14 September 2022
<cd:commandgroup name="replaceword" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807"> <cd:shortdesc> The command \replaceword can add replacement words to ligature exception dictionaries. Define different replacement sets and activate them with \setreplacements.</cd:shortdesc> <cd:variants> <cd:command category="language" file="lang-rep.mkiv" interfacedate="2021-03-02T11:08" interfacefile="i-replacement.xml" level="style" name="replaceword" variantnumber="1">
<cd:arguments> <cd:keywords ordinal="1"> <cd:keywordsdoc></cd:keywordsdoc> <cd:constant type="cd:name">category</cd:constant> </cd:keywords> <cd:keywords optional="yes" ordinal="2"> <cd:keywordsdoc></cd:keywordsdoc> <cd:constant type="cd:text">target</cd:constant> </cd:keywords> <cd:keywords ordinal="3"> <cd:keywordsdoc></cd:keywordsdoc> <cd:constant type="cd:text">replacement</cd:constant> </cd:keywords> </cd:arguments> </cd:command>
</cd:variants> <cd:description> </cd:description> <cd:examples><cd:example title="Discretionaries">You can insert discretionaries in the replacement text like this:
\setuppapersize[A6][A6] \replaceword[category][ABCDEFGHIJ][ABCDE{1}{2}{3}FGHIJ] \setreplacements[category] \starttext ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ \stoptext
</cd:example></cd:examples>
<cd:notes></cd:notes> <cd:seealso> <cd:source file="lang-rep.mkiv" originator="system"></cd:source> <cd:wikipage originator="system" page="Category:Language"></cd:wikipage></cd:seealso> </cd:commandgroup>