Difference between revisions of "Command/replaceword"

From Wiki
Jump to navigation Jump to search
m
(Add discretionary example)
 
(One intermediate revision 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. Define different replacement sets and activate them with \setreplacements.</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


\replaceword

Summary

The command \replaceword can add replacement words to ligature exception dictionaries. Define different replacement sets and activate them with \setreplacements.

Settings

\replaceword[...][...][...]
[...]name
[...]text
[...]text

OptionExplanation
name category
text target
text replacement

Description

Examples

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

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: