Next: , Previous: , Up: GNU troff Reference   [Contents][Index]

5.13 Character Translations

A translation is a mapping of an input character to an output glyph. The mapping occurs at output time, i.e., the input character gets assigned the metric information of the mapped output character right before input tokens are converted to nodes (see Gtroff Internals, for more on this process).

Request: .tr abcd
Request: .trin abcd

Translate character a to glyph b, character c to glyph d, and so on. If there is an odd number of characters in the argument, the last one is translated to a fixed-width space (the same one obtained by the \SP escape sequence).

The trin request is identical to tr, but when you unformat a diversion with asciify it ignores the translation. See Diversions, for details about the asciify request.

Some notes:

Request: .trnt abcd

trnt is the same as the tr request except that the translations do not apply to text that is transparently throughput into a diversion with \!. See Diversions.

For example,

.tr ab
.di x
\!.tm a

prints ‘b’ to the standard error stream; if trnt is used instead of tr it prints ‘a’.

Next: , Previous: , Up: GNU troff Reference   [Contents][Index]