www.delorie.com/gnu/docs/groff/groff_diff.man.html   search  
Buy GNU books!





Long names

Fractional pointsizes

Numeric expressions

New escape sequences

Change font family. This is the same as the fam request. [rs]F[] switches back to the previous color (note that [rs]FP won't work; it selects font family `P' instead).
Set drawing color. [rs]m[] switches back to the previous color.
Set background color for filled objects drawn with the [rs]D'...' commands. [rs]M[] switches back to the previous color.
Typeset the character with code n in the current font. n can be any integer. Most devices only have characters with codes between 0 and 255. If the current font does not contain a character with that code, special fonts will not be searched. The [rs]N escape sequence can be conveniently used in conjunction with the char request, for example
The code of each character is given in the fourth column in the font description file after the charset command. It is possible to include unnamed characters in the font description file by using a name of ---; the [rs]N escape sequence is the only way to use these.
Suppressing troff output. The escapes [rs]02, [rs]O3, [rs]O4, and [rs]O5 are intended for internal use by grohtml.
[rs]R'name [+-]n'
This has the same effect as
Set the point size to nn points; nn must be exactly two digits.
Set the point size to n scaled points; n is a numeric expression with a default scale indicator of z.
Interpolate the contents of the environment variable xxx, as returned by getenv(3). [rs]V is interpreted in copy-mode.
This is approximately equivalent to [rs]X'[rs]*[xxx]'R]. However the contents of the string or macro xxx are not interpreted; also it is permitted for xxx to have been defined as a macro and thus contain newlines (it is not permitted for the argument to [rs]X to contain newlines). The inclusion of newlines requires an extension to the UNIX troff output format, and will confuse drivers that do not know about this extension.
Print anything and then restore the horizontal and vertical position; anything may not contain tabs or leaders.
The name by which the current macro was invoked. The als request can make a macro have more than one name.
In a macro or string, the concatenation of all the arguments separated by spaces.
In a macro or string, the concatenation of all the arguments with each surrounded by double quotes, and separated by spaces.
In a macro or string, this gives the nn-th or nnn-th argument. Macros and strings can have an unlimited number of arguments.
When used in a diversion, this will transparently embed anything in the diversion. anything is read in copy mode. When the diversion is reread, anything will be interpreted. anything may not contain newlines; use [rs]! if you want to embed newlines in a diversion. The escape sequence [rs]? is also recognised in copy mode and turned into a single internal code; it is this code that terminates anything. Thus
will print 4.
This increases the width of the preceding character so that the spacing between that character and the following character will be correct if the following character is a roman character. It is a good idea to use this escape sequence whenever an italic character is immediately followed by a roman character without any intervening space.
This modifies the spacing of the following character so that the spacing between that character and the preceding character will correct if the preceding character is a roman character. It is a good idea to use this escape sequence whenever a roman character is immediately followed by an italic character without any intervening space.
Like [rs]& except that it behaves like a character declared with the cflags request to be transparent for the purposes of end-of-sentence recognition.
This produces an unbreakable space that stretches like a normal inter-word space when a line is adjusted.
This causes the insertion of a zero-width break point. It is equal to [rs]% within a word but without insertion of a soft hyphen character.
Everything up to and including the next newline is ignored. This is interpreted in copy mode. It is like [rs] except that [rs] does not ignore the terminating newline.

New requests

Note that f is the default scaling indicator for the defcolor request, thus the above statement is equivalent to

The color named default (which is device-specific) can't be redefined. It is possible that the default color for and is not the same.
.dei xx yy
Define macro indirectly. The following example
is equivalent to

.de1 xx yy
Similar to .de, but compatibility mode is switched off during execution. On entry, the current compatibility mode is saved and restored at exit.
.do xxx
Interpret .xxx with compatibility mode disabled. For example,

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.

.ds1 xx yy
Similar to .ds, but compatibility mode is switched off during expansion. To be more precise, a `compatibility save' token is inserted at the beginning of the string, and a `compatibility restore' token at the end.
Save current escape character.
Restore escape character saved with ecs. Without a previous call to ecs, `[rs]' will be the new escape character.
.evc xx
Copy the contents of environment xx to the current environment. No pushing or popping of environments will be done.
.fam xx
Set the current font family to xx. The current font family is part of the current environment. If xx is missing, switch back to previous font family. The value at start-up is `T'. See the description of the sty request for more information on font families.
.fchar c string
Define fallback character c to be string. The syntax of this request is the same as the char request; the only difference is that a character defined with char hides the glyph with the same name in the current font, whereas a character defined with fchar is checked only if the particular glyph isn't found in the current font. This test happens before checking special fonts.
.fspecial f s1 s2...
When the current font is f, fonts s1, s2,... will be special, that is, they will searched for characters not in the current font. Any fonts specified in the special request will be searched after fonts specified in the fspecial request.
.ftr f g
Translate font f to g. Whenever a font named f is referred to in an [rs]f escape sequence, or in the ft, ul, bd, cs, tkf, special, fspecial, fp, or sty requests, font g will be used. If g is missing, or equal to f then font f will not be translated.
.hcode c1 code1 c2 code2...
Set the hyphenation code of character c1 to code1 and that of c2 to code2. A hyphenation code must be a single input character (not a special character) other than a digit or a space. Initially each lower-case letter a-z has a hyphenation code, which is itself, and each upper-case letter A-Z has a hyphenation code which is the lower-case version of itself. See also the hpf request.
.hla lang
Set the current hyphenation language to lang. Hyphenation exceptions specified with the hw request and hyphenation patterns specified with the hpf request are both associated with the current hyphenation language. The hla request is usually invoked by the troffrc file.
.hlm n
Set the maximum number of consecutive hyphenated lines to n. If n is negative, there is no maximum. The default value is -1. This value is associated with the current environment. Only lines output from an environment count towards the maximum associated with that environment. Hyphens resulting from [rs]% are counted; explicit hyphens are not.
.hpf file
Read hyphenation patterns from file; this will be searched for in the same way that name.tmac is searched for when the -mname option is specified. It should have the same format as (simple) [[][tx] patterns files. More specifically, the following scanning rules are implemented.
    A percent sign starts a comment (up to the end of the line) even if preceded by a backslash.
    No support for `digraphs' like [rs]$.
    ^^xx (x is 0-9 or a-f) and ^^x (character code of x in the range 0-127) are recognized; other use of ^ causes an error.
    No macro expansion.
    hpf checks for the expression [rs]patterns{...} (possibly with whitespace before and after the braces). Everything between the braces is taken as hyphenation patterns. Consequently, { and } are not allowed in patterns.
    Similarly, [rs]hyphenation{...} gives a list of hyphenation exceptions.
    [rs]endinput is recognized also.
    For backwards compatibility, if [rs]patterns is missing, the whole file is treated as a list of hyphenation patterns (only recognizing the % character as the start of a comment).
Use the hpfcode request to map the encoding used in hyphenation patterns files to groff's input encoding.
The set of hyphenation patterns is associated with the current language set by the hla request. The hpf request is usually invoked by the troffrc file; a second call replaces the old patterns with the new ones.
.hpfa file
The same as hpf except that the hyphenation patterns from file are appended to the patterns already loaded in the current language.
.hpfcode a b c d ...
After reading a hyphenation patterns file with the hpf or hpfa request, convert all characters with character code a in the recently read patterns to character code b, character code c to d, etc. Initially, all character codes map to themselves. The arguments of hpfcode must be integers in the range 0 to 255. Note that it is even possible to use character codes which are invalid in groff otherwise.
.hym n
Set the hyphenation margin to n: when the current adjustment mode is not b, the line will not be hyphenated if the line is no more than n short. The default hyphenation margin is 0. The default scaling indicator for this request is m. The hyphenation margin is associated with the current environment. The current hyphenation margin is available in the [rs]n[.hym] register.
.hys n
Set the hyphenation space to n: when the current adjustment mode is b don't hyphenate the line if the line can be justified by adding no more than n extra space to each word space. The default hyphenation space is 0. The default scaling indicator for this request is m. The hyphenation space is associated with the current environment. The current hyphenation space is available in the [rs]n[.hys] register.
.itc n macro
Variant of .it for which a line interrupted with [rs]c counts as one input line.
.kern n
If n is non-zero or missing, enable pairwise kerning, otherwise disable it.
.length xx string
Compute the length of string and return it in the number register xx (which is not necessarily defined before).
.linetabs n
If n is non-zero or missing, enable line-tabs mode, otherwise disable it (which is the default). In line-tabs mode, tab distances are computed relative to the (current) output line. Otherwise they are taken relative to the input line. For example, the following
    a b c
In line-tabs mode, the same code gives
    a b c
Line-tabs mode is associated with the current environment; the read-only number register \[rs]n[.linetabs] is set to 1 if in line-tabs mode, and 0 otherwise.
.mso file
The same as the so request except that file is searched for in the same directories as macro files for the the -m command line option. If the file name to be included has the form name.tmac and it isn't found, mso tries to include tmac.name instead and vice versa.
.nop anything
Execute anything. This is similar to `.if 1'.
Make the n built-in condition true and the t built-in condition false. This can be reversed using the troff request.
.open stream filename
Open filename for writing and associate the stream named stream with it. See also the close and write requests.
.opena stream filename
Like open, but if filename exists, append to it instead of truncating it.
.output string
Emit string directly to the intermediate output (subject to copy-mode interpretation); this is similar to [rs]! used at the top level. An initial double quote in string is stripped off to allow initial blanks.
Print the names and contents of all currently defined number registers on stderr.
.psbb filename
Get the bounding box of a PostScript image filename. This file must conform to Adobe's Document Structuring Conventions; the command looks for a %%BoundingBox comment to extract the bounding box values. After a successful call, the coordinates (in PostScript units) of the lower left and upper right corner can be found in the registers [rs]n[llx], [rs]n[lly], [rs]n[urx], and [rs]n[ury], respectively. If some error has occurred, the four registers are set to zero.
.pso command
This behaves like the so request except that input comes from the standard output of command.
Print the names and positions of all traps (not including input line traps and diversion traps) on stderr. Empty slots in the page trap list are printed as well, because they can affect the priority of subsequently planted traps.
.pvs [+-]n
Set the post-vertical line space to n; default scale indicator is p. This value will be added to each line after it has been output. With no argument, the post-vertical line space is set to its previous value.
The total vertical line spacing consists of four components: .vs and [rs]x with a negative value which are applied before the line is output, and .pvs and [rs]x with a positive value which are applied after the line is output.
.rchar c1 c2...
Remove the definitions of characters c1, c2,... This undoes the effect of a char request.
Within a macro, return immediately. No effect otherwise.
.rj n
Right justify the next n input lines. Without an argument right justify the next input line. The number of lines to be right justified is available in the [rs]n[.rj] register. This implicitly does .ce 0. The ce request implicitly does .rj 0.
.rnn xx yy
Rename number register xx to yy.
.shc c
Set the soft hyphen character to c. If c is omitted, the soft hyphen character will be set to the default [rs](hy. The soft hyphen character is the character which will be inserted when a word is hyphenated at a line break. If the soft hyphen character does not exist in the font of the character immediately preceding a potential break point, then the line will not be broken at that point. Neither definitions (specified with the char request) nor translations (specified with the tr request) are considered when finding the soft hyphen character.
.shift n
In a macro, shift the arguments by n positions: argument i becomes argument i-n; arguments 1 to n will no longer be available. If n is missing, arguments will be shifted by 1. Shifting by negative amounts is currently undefined.
.sizes s1 s2...sn [0]
This command is similar to the sizes command of a DESC file. It sets the available font sizes for the current font to s1, s2,..., sn scaled points. The list of sizes can be terminated by an optional 0. Each si can also be a range of sizes m-n. Contrary to the font file command, the list can't extend over more than a single line.
.special s1 s2...
Fonts s1, s2, are special and will be searched for characters not in the current font.
.spreadwarn limit
Make troff emit a warning if the additional space inserted for each space between words in an output line is larger or equal to limit. A negative value is changed to zero; no argument toggles the warning on and off without changing limit. The default scaling indicator is m. At startup, spreadwarn is deactivated, and limit is set to 3m. For example, .spreadwarn 0.2m will cause a warning if troff must add 0.2m or more for each interword space in a line. This request is active only if text is justified to both margins (using .ad b).
.sty n f
Associate style f with font position n. A font position can be associated either with a font or with a style. The current font is the index of a font position and so is also either a font or a style. When it is a style, the font that is actually used is the font the name of which is the concatenation of the name of the current family and the name of the current style. For example, if the current font is 1 and font position 1 is associated with style R and the current font family is T, then font TR will be used. If the current font is not a style, then the current family is ignored. When the requests cs, bd, tkf, uf, or fspecial are applied to a style, then they will instead be applied to the member of the current family corresponding to that style. The default family can be set with the -f option. The styles command in the DESC file controls which font positions (if any) are initially associated with styles rather than fonts.
.substring xx n1 [n2]
Replace the string named xx with the substring defined by the indices n1 and n2. The first character in the string has index 0. If n2 is omitted, it is taken to be equal to the string's length. If the index value n1 or n2 is negative, it will be counted from the end of the string, going backwards: The last character has index -1, the character before the last character has index -2, etc.
.tkf f s1 n1 s2 n2
Enable track kerning for font f. When the current font is f the width of every character will be increased by an amount between n1 and n2; when the current point size is less than or equal to s1 the width will be increased by n1; when it is greater than or equal to s2 the width will be increased by n2; when the point size is greater than or equal to s1 and less than or equal to s2 the increase in width is a linear function of the point size.
.tm1 string
Similar to the tm request, string is read in copy mode and written on the standard error, but an initial double quote in string is stripped off to allow initial blanks.
.tmc string
Similar to tm1 but without writing a final newline.
.trf filename
Transparently output the contents of file filename. Each line is output as if preceded by [rs]!; however, the lines are not subject to copy-mode interpretation. If the file does not end with a newline, then a newline will be added. For example, you can define a macro x containing the contents of file f, using
Unlike with the cf request, the file cannot contain characters such as NUL that are not legal troff input characters.
.trin abcd
This is the same as the tr request except that the asciify request will use the character code (if any) before the character translation. Example:
The result is x a. Using tr, the result would be x x.
.trnt abcd
This is the same as the tr request except that the translations do not apply to text that is transparently throughput into a diversion with [rs]!. For example,
will print b; if trnt is used instead of tr it will print a.
Make the n built-in condition false, and the t built-in condition true. This undoes the effect of the nroff request.
.unformat xx
This request `unformats' the diversion xx. Contrary to the .asciify request, which tries to convert formatted elements of the diversion back to input tokens as much as possible, .unformat will only handle tabs and spaces between words (usually caused by spaces or newlines in the input) specially. The former are treated as if they were input tokens, and the latter are stretchable again. Note that the vertical size of lines is not preserved. Glyph information (font, font size, space width, etc.) is retained. Useful in conjunction with the .box and .boxa requests.
.vpt n
Enable vertical position traps if n is non-zero, disable them otherwise. Vertical position traps are traps set by the wh or dt requests. Traps set by the it request are not vertical position traps. The parameter that controls whether vertical position traps are enabled is global. Initially vertical position traps are enabled.
.warn n
Control warnings. n is the sum of the numbers associated with each warning that is to be enabled; all other warnings will be disabled. The number associated with each warning is listed in @g@troff(@MAN1EXT@). For example, .warn 0 will disable all warnings, and .warn 1 will disable all warnings except that about missing characters. If n is not given, all warnings will be enabled.
.warnscale si
Set the scaling indicator used in warnings to si. Valid values for si are u, i, c, p, and P. At startup, it is set to i.
.while c anything
While condition c is true, accept anything as input; c can be any condition acceptable to an if request; anything can comprise multiple lines if the first line starts with [rs]{ and the last line ends with [rs]}. See also the break and continue requests.
.write stream anything
Write anything to the stream named stream. stream must previously have been the subject of an open request. anything is read in copy mode; a leading [dq] will be stripped.
.writec stream anything
Similar to write but without writing a final newline.
.writem stream xx
Write the contents of the macro or string xx to the stream named stream. stream must previously have been the subject of an open request. xx is read in copy mode.

Extended requests

New number registers




Text Commands

Drawing Commands

Device Control Commands


Groff Language

Intermediate Output



  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003