.\" define a string tx for the TeX logo
.ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
.\" Like TP, but if specified indent is more than half
.\" the current line-length - indent, use the default indent.
.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
.\" The BSD man macros can't handle " in arguments to font change macros,
.\" so use \(ts instead of ".
.TH TROFF 1 "1 April 1993" "Groff Version 1.08"
troff \- format documents
.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
.el .RB "[\ " "\\$1" "\ ]"
.RI "[\ " files\|.\|.\|. "\ ]"
This manual page describes the GNU version of
which is part of the groff document formatting system.
It is highly compatible with Unix troff.
Usually it should be invoked using the groff command, which will
also run preprocessors and postprocessors in the appropriate
order and with the appropriate options.
approximation of the typeset output.
Print a backtrace with each warning or error message. This backtrace
should help track down the cause of the error. The line numbers given
in the backtrace may not always correct: troff's idea of line numbers
Read the standard input after all the named input files have been
Print the version number.
Available warnings are described in
the Warnings subsection below.
Inhibit all error messages.
Suppress formatted output.
Enable compatibility mode.
must be a one letter name.
as the default font family.
Normally this will be searched for in /usr/share/tmac.
which is a comma-separated list of page ranges;
means print every page between
means print every page up to
means print every page from
must be a one character name;
can be any troff numeric expression.
Prepare output for device
is the name of the device)
file and font files before the normal
.BR /usr/share/groff_font .
for macro files before the normal
Only the features not in Unix troff are described here.
The names of number registers, fonts, strings/macros/diversions,
special characters can be of any length. In escape sequences, where
for a two character name, you can use
for a name of arbitrary length:
Print the special character called
Interpolate number register
.SS Fractional pointsizes
sizescale is specified in the
There is a new scale indicator
which has the effect of multiplying by sizescale.
Requests and escape sequences in troff
interpret arguments that represent a pointsize as being in units
of scaled points, but they evaluate each such argument
using a default scale indicator of
Arguments treated in this way are
the third argument to the
the second and fourth arguments to the
and those variants of the
escape sequence that take a numeric expression as their argument.
For example, suppose sizescale is 1000;
then a scaled point will be equivalent to a millipoint;
and so sets the pointsize to 10250 scaled points,
which is equal to 10.25 points.
returns the pointsize in points as decimal fraction.
There is also a new number register
that returns the pointsize in scaled points.
It would make no sense to use the
scale indicator in a numeric expression
whose default scale indicator was neither
Similarily it would make no sense to use a scaling indicator
in a numeric expression whose default scale indicator was
There is also new scale indicator
which multiplies by the number of units in a scaled point.
Be sure not to confuse the
Spaces are permitted in a number expression within parentheses.
indicates a scale of 100ths of an em.
as the default scaling indicator.
is missing, ignore scaling indicators in the evaluation of
is or is not acceptable as the name of a string, macro, diversion,
number register, environment or font.
This is useful if you want to lookup user input in some sort of
Normally it is more convenient to use
has the advantage that it is compatible with recent versions of
and is available in compatibility mode.
This is equivalent to an escape character,
but it's not interpreted in copy-mode.
For example, strings to start and end superscripting could be defined
\&.ds { \ev'\-.3m'\es'\eEn[.s]*6u/10u'
ensures that these definitions will work even if
gets interpreted in copy-mode
(for example, by being used in a macro argument.)
Typeset the character with code
Most devices only have characters with codes between 0 and 255.
If the current font does not contain a character with that code,
escape sequence can be conveniently used on conjunction with the
\&.char \e[phone] \ef(ZD\eN'37'
The code of each character is given in the fourth column in the font
description file after the
It is possible to include unnamed characters in the font description
escape sequence is the only way to use these.
This has the same effect as
must be exactly two digits.
is a numeric expression with a default scale indicator of
Interpolate the contents of the environment variable
is interpreted in copy-mode.
This is approximately equivalent to
However the contents of the string or macro
to have been defined as a macro and thus contain newlines
(it is not permitted for the argument to
The inclusion of newlines requires an extension to the Unix troff output
format, and will confuse drivers that do not know about this
Print anything and then restore the horizontal and vertical
may not contain tabs or leaders.
The name by which the current macro was invoked.
request can make a macro have more than one name.
In a macro, the concatenation of all the arguments separated by spaces.
In a macro, the concatenation of all the arguments with each surrounded by
double quotes, and separated by spaces.
In a macro, this gives the
Macros can have a unlimited number of arguments.
When used in a diversion, this will transparently embed
When the diversion is reread,
may not contain newlines; use
if you want to embed newlines in a diversion.
is also recognised in copy mode and turned into a single internal
code; it is this code that terminates
\e?\e\e?\e\e\e\e?\e\e\e\e\e\e\e\enx\e\e\e\e?\e\e?\e?
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.
For example, if an italic f is immediately followed by a roman
right parenthesis, then in many fonts the top right portion of the f
will overlap the top left of the right parenthesis producing \fIf\fR)\fR,
It is a good idea to use this escape sequence whenever an
italic character is immediately followed by a roman character without any
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.
between the parenthesis and the f changes
It is a good idea to use this escape sequence whenever a
roman character is immediately followed by an italic character without any
except that it behaves like a character declared with the
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.
Everything up to and including the next newline is ignored.
This is interpreted in copy mode.
does not ignore the terminating newline.
for number register object named
The new name and the old name will be exactly equivalent.
is undefined, a warning of type
will be generated, and the request will be ignored.
for request, string, macro, or diversion object named
The new name and the old name will be exactly equivalent (it is similar to a
hard rather than a soft link).
is undefined, a warning of type
will be generated, and the request will be ignored.
requests only create a new object if the name of the macro, diversion
or string diversion is currently undefined or if it is defined to be a
request; normally they modify the value of an existing object.
This request only exists in order to make it possible
to make certain gross hacks work with GNU troff.
It `unformats' the diversion
characters that were formatted and diverted into
will be treated like ordinary input characters when
Print a backtrace of the input stack on stderr.
Break out of a while loop.
Be sure not to confuse this with the
.BI .cflags\ n\ c1\ c2\|.\|.\|.
have properties determined by
which is ORed from the following:
the character ends sentences
lines can be broken before the character
(initially no characters have this property);
lines can be broken after the character
the character overlaps horizontally
the character overlaps vertically
an end of sentence character followed by any number of characters
with this property will be treated
as the end of a sentence if followed by a newline or two spaces;
the character is transparent for the purposes of end of sentence
this is the same as having a zero space factor in \*(tx
will be processed in a temporary environment and the result
will be wrapped up into a single object.
Compatibility mode will be turned off
and the escape character will be set to
Any emboldening, constant spacing or track kerning will be applied
to this object rather than to individual characters in
A character defined by this request can be used just like
a normal character provided by the output device.
In particular other characters can be translated to it
it can be made the leader character by the
repeated patterns can be drawn with the character using the
words containing the character can be hyphenated
request is used to give the character a hyphenation code.
There is a special anti-recursion feature:
use of character within the character's definition
will be handled like normal characters not defined with
A character definition can be removed with the
Chop the last character off macro, string, or diversion
This is useful for removing the newline from the end of diversions
that are to be interpolated as strings.
will no longer be an acceptable argument to the
Finish the current iteration of a while loop.
is non-zero or missing, enable compatibility mode, otherwise
In compatibility mode, long names are not recognised, and the
incompatibilities caused by long names do not arise.
with compatibility mode disabled.
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
Set the current font family to
The current font family is part of the current environment.
See the description of the
request for more information on font families.
.BI .fspecial\ f\ s1\ s2\|.\|.\|.
will be special, that is, they will searched for characters not in
Any fonts specified in the
request will be searched before fonts specified in the
.BI .hcode \ c1\ code1\ c2\ code2\|.\|.\|.
Set the hyphenation code of character
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 has a hyphenation code, which
is itself, and each upper-case letter has a hyphenation code
which is the lower case version of itself.
Set the current hyphenation language to
Hyphenation exceptions specified with the
request and hyphenation patterns specified with the
request are both associated with the current hyphenation language.
request is usually invoked by the
Set the maximum number of consecutive hyphenated lines to
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
are counted; explicit hyphens are not.
Read hyphenation patterns from
this will be searched for in the same way that
It should have the same format as the argument to
the \epatterns primitive in \*(tx;
the letters appearing in this file are interpreted as hyphenation
character in the patterns file introduces a comment that continues
The set of hyphenation patterns is associated with the current language
is usually invoked by the
when the current adjustment mode is not
the line will not be hyphenated if the line is no more than
The default hyphenation margin is 0.
The default scaling indicator for this request is
The hyphenation margin is associated with the current environment.
The current hyphenation margin is available in the
when the current adjustment mode is
don't hyphenate the line if the line can be justified by adding no more than
extra space to each word space.
The default hyphenation space is 0.
The default scaling indicator for this request is
The hyphenation space is associated with the current environment.
The current hyphenation space is available in the
is non-zero or missing, enable pairwise kerning, otherwise disable it.
is searched for in the same way that
built-in condition false.
This can be reversed using the
.BI .open\ stream\ filename
for writing and associate the stream named
.BI .opena\ stream\ filename
exists, append to it instead of truncating it.
Print the names and contents of all currently defined number registers
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.
.BI .rchar\ c1\ c2\|.\|.\|.
Remove the definitions of characters
This undoes the effect of a
Without an argument right justify the next input line.
The number of lines to be right justifed is available in the
Set the soft hyphen character to
the soft hyphen character will be set to the default
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
nor translations (specified with the
are considered when finding the soft hyphen character.
In a macro, shift the arguments by
will no longer be available.
arguments will be shifted by 1.
Shifting by negative amounts is currently undefined.
.BI .special\ s1\ s2\|.\|.\|.
are special and will be searched for characters not in the
A font position can be associated either with a font or
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
If the current font is not a style, then the current family is ignored.
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
The styles command in the
file controls which font positions
(if any) are initially associated with styles rather than fonts.
.BI .tkf\ f\ s1\ n1\ s2\ n2
Enable track kerning for font
the width of every character will be increased by an amount
when the current point size is less than or equal to
the width will be increased by
when it is greater than or equal to
the width will be increased by
when the point size is greater than or equal to
and less than or equal to
the increase in width is a linear function of the point size.
Transparently output the contents of file
Each line is output as it would be were it preceded by
however, the lines are not subject to copy-mode interpretation.
If the file does not end with a newline, then a newline will
For example, you can define a macro
containing the contents of file
the file cannot contain characters such as
that are not legal troff input characters.
request except that the translations do not apply to text that is
transparently throughput into a diversion with
built-in condition false,
This undoes the effect of the
Enable vertical position traps if
is non-zero, disable them otherwise.
Vertical position traps are traps set by the
request are not vertical position traps.
The parameter that controls whether vertical position traps are enabled
Initially vertical position traps are enabled.
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 the `Warnings' section.
will disable all warnings, and
will disable all warnings except that about missing characters.
all warnings will be enabled.
can be any condition acceptable to an
can comprise multiple lines if the first line starts with
and the last line ends with
.BI .write\ stream\ anything
must previously have been the subject of an
When used in a diversion, this will embed in the diversion an object which,
when reread, will cause the contents of
to be transparently copied through to the output.
is immediately copied through to the output regardless of whether
there is a current diversion; this behaviour is so anomalous that it
must be considered a bug.
is not a number, this will switch to a named environment called
The environment should be popped with a matching
request without any arguments, just as for numbered environments.
There is no limit on the number of named environments; they will be
created the first time that they are referenced.
request has an optional third argument.
This argument gives the external name of the font,
which is used for finding the font description file.
The second argument gives the internal name of the font
which is used to refer to the font in troff after it has been mounted.
If there is no third argument then the internal name will be used
This feature allows you to use fonts with long names in compatibility mode.
When two arguments are given to the
request, the second argument gives the
.IR "sentence space size" .
If the second argument is not given, the sentence space size
will be the same as the word space size.
Like the word space size, the sentence space is in units of
one twelfth of the spacewidth parameter for the current font.
Initially both the word space size and the sentence
The sentence space size is used in two circumstances:
if the end of a sentence occurs at the end of a line in fill mode, then
both an inter-word space and a sentence space will be added;
if two spaces follow the end of a sentence in the middle of a line,
then the second space will be a sentence space.
Note that the behaviour of Unix troff will be exactly
that exhibited by GNU troff if a second argument is never given to the
In GNU troff, as in Unix troff, you should always
follow a sentence with either a newline or two spaces.
.BI .ta\ n1\ n2\|.\|.\|.nn \ T\ r1\ r2\|.\|.\|.\|rn
.IR nn + r2 ,\|.\|.\|.\|.\|,
.IR nn + rn + r2 ,\|.\|.\|.\|,
will set tabs every half an inch.
The following read-only registers are available:
1 if compatibility mode is in effect, 0 otherwise.
The depth of the last character added to the current environment.
It is positive if the character extends below the baseline.
The number of lines remaining to be centered, as set by the
The height of the last character added to the current environment.
It is positive if the character extends above the baseline.
The skew of the last character added to the current environment.
of a character is how far to the right of the center of a character
the center of an accent over that character should be placed.
The name or number of the current environment.
This is a string-valued register.
This is a string-valued register.
The number of the next free font position.
Macros should use this to determine whether they are running
The current hyphenation language as set by the
The number of immediately preceding consecutive hyphenated lines.
The maximum allowed number of consecutive hyphenated lines, as set by the
The current hyphenation flags (as set by the
The current hyphenation margin (as set by the
The current hyphenation space (as set by the
The indent that applies to the current output line.
if pairwise kerning is enabled,
The current ligature mode (as set by the
The line length that applies to the current output line.
The title length as set by the
The amount of space that was needed in the last
request that caused a trap to be sprung.
Useful in conjunction with the
The number of the next page:
either the value set by a
request, or the number of the current page plus 1.
The current pointsize in scaled points.
The last-requested pointsize in scaled points.
The number of lines to be right-justified as set by the
The last requested pointsize in points as a decimal fraction.
This is a string-valued register.
A string representation of the current tab settings suitable for use as
The amount of vertical space truncated by the most recently sprung
vertical position trap, or,
if the trap was sprung by a
minus the amount of vertical motion produced by the
In other words, at the point a trap is sprung, it represents the difference
of what the vertical position would have been but for the trap,
and what the vertical position actually is.
Useful in conjunction with the
These give the values of the parameters set by the
first and second arguments of the
1 if vertical position traps are enabled, 0 otherwise.
The sum of the numbers associated with each of the currently enabled
The number associated with each warning is listed in the `Warnings'
The major version number.
For example, if the version number is
The minor version number.
For example, if the version number is
The following registers are set by the
registers, but takes account of the heights and depths of characters.
The amount of horizontal space (possibly negative) that should
be added to the last character before a subscript.
How far to right of the center of the last character
the center of an accent from a roman font should be placed over that character.
The following read/write number registers are available:
The return value of the system() function executed by the last
If greater than 0, the maximum number of objects on the input stack.
If less than or equal to 0, there is no limit on the number of objects
on the input stack. With no limit, recursion can continue until
virtual memory is exhausted.
file are automatically mounted on the next available font position
when they are referenced.
If a font is to be mounted explicitly with the
request on an unused font position,
it should be mounted on the first unused font position,
which can be found in the
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
If the font description file contains pairwise kerning information,
characters from that font will be kerned.
Kerning between two characters can be inhibited by placing a
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.
a character that appears at a different input level to
the starting delimiter character will not be recognised
as the closing delimiter character.
When decoding a macro 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.
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.
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:
True if there is a number register named
True if there is a string, macro, diversion, or request named
True if there is a character
the condition will also be true if
The warnings that can be given by
are divided into the following categories.
The name associated with each warning is used by the
the number is used by the
.nr x \w'\fBright-brace'+1n+\w'0000'u
This is enabled by default.
Invalid numeric expressions.
This is enabled by default.
In fill mode, lines which could not be broken so that their length was
less than the line length.
This is enabled by default.
Missing or mismatched closing delimiters.
Meaningless scaling indicators.
Dubious syntax in numeric expressions.
without an argument when there is no current diversion.
Use of undefined strings, macros and diversions.
When an undefined string, macro or diversion is used,
that string is automatically defined as empty.
So, in most cases, at most one warning will be given for
Use of undefined number registers.
When an undefined number register is used,
that register is automatically defined to have a value of 0.
a definition is automatically made with a value of 0.
So, in most cases, at most one warning will be given for
use of a particular name.
Use of a tab character where a number was expected.
where a number was expected.
Requests that are missing non-optional arguments.
Illegal input characters.
Unrecognized escape sequences.
When an unrecognized escape sequence is encountered,
the escape character is ignored.
Missing space between a request or macro and its argument.
This warning will be given
when an undefined name longer than two characters is encountered,
and the first two characters of the name make a defined name.
The request or macro will not be invoked.
When this warning is given, no macro is automatically defined.
This is enabled by default.
This warning will never occur in compatibility mode.
This is enabled by default.
There are also names that can be used to refer to groups of warnings:
It is intended that this covers all warnings
that are useful with traditional macro packages.
Long names cause some incompatibilities.
Unix troff will interpret
Normally, GNU troff will interpret this as a call of a macro named
Also Unix troff will interpret
as references to a string or number register called
In GNU troff, however, this will normally be interpreted as the start
GNU troff will interpret these things in the traditional way.
In compatibility mode, however, long names are not recognised.
Compatibility mode can be turned on with the
command line option, and turned on or off with the
is 1 if compatibility mode is on, 0 otherwise.
does not allow the use of the escape sequences
.BR \\e\e|\e^\e&\e}\e{\e (space) \e'\e`\e-\e_\e!\e%\ec
in names of strings, macros, diversions, number registers,
fonts or environments; Unix troff does.
escape sequence may be helpful in avoiding use of these
escape sequences in names.
Fractional pointsizes cause one noteworthy incompatibility.
request ignores scale indicators and so
will set the pointsize to 10 points, whereas in
GNU troff it will set the pointsize to 10 scaled points.
In GNU troff there is a fundamental difference between unformatted,
input characters, and formatted, output characters.
Everything that affects how an output character
will be output is stored with the character; once an output
character has been constructed it is unaffected by any subsequent
requests that are executed, including
Normally output characters are constructed from input
characters at the moment immediately before the character
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 output
characters in any combination.
An output character 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.
is turned into one output
are not interpreted as escape characters when they are reread.
Unix troff would interpret them as escape characters
when they were reread and would end up printing one
The correct way to obtain a printable
escape sequence: this will always print a single instance of the
current escape character, regardless of whether or not it is used in a
diversion; it will also work in both GNU troff and Unix troff.
If you wish for some reason to store in a diversion an escape
sequence that will be interpreted when the diversion is reread,
you can either use the traditional
transparent output facility, or, if this is unsuitable, the new
A colon separated list of directories in which to search for
A colon separated list of directories in which to search for the
will search in directories given in the
option before these, and in standard directories
.RB ( /usr/share/groff_font )
.Tp \w'/usr/share/groff_font/devname/DESC'u+3n
.B /usr/share/tmac/troffrc
.BI /usr/share/tmac/tmac. name
.BI /usr/share/groff_font/dev name /DESC
Device description file for device
.BI /usr/share/groff_font/dev name / F