GROFF_DIFF(7) | Miscellaneous Information Manual | GROFF_DIFF(7) |
The section SEE ALSO gives pointers to both the classical roff and the modern groff documentation.
For example, suppose sizescale is 1000; then a scaled point will be equivalent to a millipoint; the call .ps 10.25 is equivalent to .ps 10.25z and so sets the pointsize to 10250 scaled points, which is equal to 10.25 points.
The number register \n[.s] returns the pointsize in points as decimal fraction. There is also a new number register \n[.ps] that returns the pointsize in scaled points.
It would make no sense to use the z scale indicator in a numeric expression whose default scale indicator was neither u nor z, and so troff disallows this. Similarly it would make no sense to use a scaling indicator other than z or u in a numeric expression whose default scale indicator was z, and so troff disallows this as well.
There is also new scale indicator s which multiplies by the number of units in a scaled point. So, for example, \n[.ps]s is equal to 1m. Be sure not to confuse the s and z scale indicators.
M indicates a scale of 100ths of an em. f indicates a scale of 65536 units, providing fractions for color definitions with the defcolor request. For example, 0.5f = 32768u.
The use of \E ensures that these definitions will work even if \*{ gets interpreted in copy-mode (for example, by being used in a macro argument).
would have the same effect as
except that it would work even if compatibility mode had been enabled. Note that the previous compatibility mode is restored before any files sourced by xxx are interpreted.
will set tabs every half an inch.
The following read/write registers are set by the \w escape sequence:
Other available read/write number registers are:
Fonts not listed in the DESC file are automatically mounted on the next available font position when they are referenced. If a font is to be mounted explicitly with the fp request on an unused font position, it should be mounted on the first unused font position, which can be found in the \n[.fp] register; although troff does not enforce this strictly, it will not allow a font to be mounted at a position whose number is much greater than that of any currently used position.
Interpolating a string does not hide existing macro arguments. Thus in a macro, a more efficient way of doing
is
If the font description file contains pairwise kerning information, glyphs from that font will be kerned. Kerning between two glyphs can be inhibited by placing a \& between them.
In a string comparison in a condition, characters that appear at different input levels to the first delimiter character will not be recognised as the second or third delimiters. This applies also to the tl request. In a \w escape sequence, a character that appears at a different input level to the starting delimiter character will not be recognised as the closing delimiter character. The same is true for \A, \b, \B, \C, \l, \L, \o, \X, and \Z. When decoding a macro or string argument that is delimited by double quotes, a character that appears at a different input level to the starting delimiter character will not be recognised as the closing delimiter character. The implementation of \$@ ensures that the double quotes surrounding an argument will appear the same input level, which will be different to the input level of the argument itself. In a long escape name ] will not be recognized as a closing delimiter except when it occurs at the same input level as the opening ]. In compatibility mode, no attention is paid to the input-level.
There are some new types of condition:
The tr request can now map characters onto \~.
It is now possible to have whitespace between the first and second dot (or the name of the ending macro) to end a macro definition. Example:
If the tcommand line is present in the DESC file, troff will use the following two commands.
Note that single characters can have the eighth bit set, as can the names of fonts and special characters.
The names of glyphs and fonts can be of arbitrary length; drivers should not assume that they will be only two characters long.
When a glyph is to be printed, that glyph will always be in the current font. Unlike device-independent troff, it is not necessary for drivers to search special fonts to find a glyph.
For color support, some new commands have been added:
The x device control command has been extended.
A difficulty arises in how the current position should be changed after the execution of these commands. This is not of great importance since the code generated by GNU pic does not depend on this. Given a drawing command of the form
where c is not one of c, e, l, a, or ~, Unix troff will treat each of the $x sub i$ as a horizontal quantity, and each of the $y sub i$ as a vertical quantity and will assume that the width of the drawn object is $sum from i=1 to n x sub i$, and that the height is $sum from i=1 to n y sub i$. (The assumption about the height can be seen by examining the st and sb registers after using such a D command in a \w escape sequence). This rule also holds for all the original drawing commands with the exception of De. For the sake of compatibility GNU troff also follows this rule, even though it produces an ugly result in the case of the Dt and Df, and, to a lesser extent, DE commands. Thus after executing a D command of the form
the current position should be increased by $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
Another set of extensions is
The current position isn't changed by those colour commands (contrary to Df).
The first three output commands are guaranteed to be:
Compatibility mode can be turned on with the command line option, and turned on or off with the $* request. The number register $* is 1 if compatibility mode is on, 0 otherwise.
This became necessary because the GNU concept for long names causes some incompatibilities. Classical troff interprets
as defining a string ab with contents cd. In groff mode, this will be considered as a call of a macro named $*
Also classical troff interprets $* or $* as references to a string or number register called $* while groff takes this as the start of a long name.
In compatibility mode, groff interprets these things in the traditional way; so long names are not recognized.
On the other hand, groff in GNU native mode does not allow to use the single-character escapes $* (backslash), $* (vertical bar), $* (caret), $* (ampersand), $* (opening brace), $* (closing brace), $* (space), $* (single quote), $* (backquote), $* (minus), $* (underline), $* (bang), $* (percent), and $* (character c) in names of strings, macros, diversions, number registers, fonts or environments, whereas classical troff does.
The $* escape sequence can be helpful in avoiding these escape sequences in names.
Fractional pointsizes cause one noteworthy incompatibility. In classical troff, the $* request ignores scale indicators and so
.ps 10u
will set the pointsize to 10 points, whereas in groff native mode the pointsize will be set to 10 scaled points.
In groff, there is a fundamental difference between unformatted input characters, and formatted output characters (glyphs). Everything that affects how a glyph will be output is stored with the glyph; once a glyph has been constructed it is unaffected by any subsequent requests that are executed, including the $* $* $* $* or $* requests.
Normally glyphs are constructed from input characters at the moment immediately before the glyph is added to the current output line. Macros, diversions and strings are all, in fact, the same type of object; they contain lists of input characters and glyphs in any combination.
Special characters can be both; before being added to the output, they act as input entities, afterwards they denote glyphs.
A glyph does not behave like an input character for the purposes of macro processing; it does not inherit any of the special properties that the input character from which it was constructed might have had. The following example will make things clearer.
With GNU troff this will be printed as $* So each pair of input backslashes $* is turned into a single output backslash glyph $* and the resulting output backslashes are not interpreted as escape characters when they are reread.
Classical troff would interpret them as escape characters when they were reread and would end up printing a single backslash $*
In GNU, the correct way to get a printable version of the backslash character $* is the $* escape sequence, but classical troff does not provide a clean feature for getting a non-syntactical backslash. A close method is the printable version of the current escape character using the $* escape sequence; this works if the current escape character is not redefined. It works in both GNU mode and compatibility mode, while dirty tricks like specifying a sequence of multiple backslashes do not work reliably; for the different handling in diversions, macro definitions, or text mode quickly leads to a confusion about the necessary number of backslashes.
To store an escape sequence in a diversion that will be interpreted when the diversion is reread, either the traditional $* transparent output facility or the new $* escape sequence can be used.
This document is distributed under the terms of the FDL (GNU Free Documentation License) version 1.1 or later. You should have received a copy of the FDL on your system, it is also available on-line at the This document was written by James Clark, with modifications by and
This document is part of groff, the GNU roff distribution. Formerly, the contents of this document was kept in the manual page troff(1). Only the parts dealing with the language aspects of the different roff systems were carried over into this document. The troff command line options and warnings are still documented in troff(1).
February 6, 2006 | Groff Version 1.19.2 |