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


5.13 Character Translations

A character translation remaps input characters, usually to make input more convenient. GNU troff performs the translation just before formatting the glyph; that is, right before it converts the character’s token to a node.150

Request: .tr abcd
Request: .trin abcd

Translate character a to b, c to d, and so on prior to output. Unusually, spaces are not permitted between the arguments. If number of arguments is odd, the formatter translates the last to a fixed-width space (the same one obtained by the \SPC escape sequence).

The trin request works as does tr, except that asciify (see Diversions) ignores the translation when a diversion is interpolated.

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
.di
.x

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]