Manpages

Manpage of GROFF

GROFF

Section: Environments, Tables, and Troff Macros (7)
Updated: 27 June 2001
Index
Return to Main Contents
 

NAME

groff - a short reference for the GNU roff language  

DESCRIPTION

groff stands for GNU roff and is the free implementation of the roff type-setting system. See roff(7) for a survey and the background of the groff system.

This document gives only short descriptions of the predefined roff language elements as used in groff. Both the classical features and the groff extensions are provided.

Historically, the roff language was called troff. groff is compatible with the classical system and provides proper extensions. So in GNU, the terms roff, troff, and groff language could be used as synonyms. However troff slightly tends to refer more to the classical aspects, whereas groff emphasizes the GNU extensions, and roff is the general term for the language.

This file is only a short version of the complete documentation that is found in the groff info(1) file, which contains more detailed, actual, and concise information.

The general syntax for writing groff documents is relatively easy, but writing extensions to the roff language can be a bit harder.

The roff language is line-oriented. There are only two kinds of lines, control lines and text lines. The control lines start with a control character, by default a period or a single quote all other lines are text lines.

Control lines represent commands, optionally with arguments. They have the following syntax. The leading control character can be followed by a command name; arguments, if any, are separated by blanks from the command name and among themselves, for example,

.command_name arg1 arg2

For indentation, any number of space or tab characters can be inserted between the leading control character and the command name, but the control character must be on the first position of the line.

Text lines represent the parts that will be printed. They can be modified by escape sequences, which are recognized by a leading backslash These are in-line or even in-word formatting elements or functions. Some of these take arguments separated by single quotes others are regulated by a length encoding introduced by an open parenthesis or enclosed in brackets and

The roff language provides flexible instruments for writing language extension, such as macros. When interpreting macro definitions, the roff system enters a special operating mode, called the copy mode.

The copy mode behavior can be quite tricky, but there are some rules that ensure a safe usage.

1.
Printable backslashes must be denoted as To be more precise, represents the current escape character. To get a backslash glyph, use
2.
Double all backslashes.
3.
Begin all text lines with the special non-spacing character

This does not produce the most efficient code, but it should work as a first measure. For better strategies, see the groff info file and groff_tmac(5).

Reading roff source files is easier, just reduce all double backslashes to a single one in all macro definitions.  

GROFF ELEMENTS

The roff language elements add formatting information to a text file. The fundamental elements are predefined commands and variables that make roff a full-blown programming language.

There are two kinds of roff commands, possibly with arguments. Requests are written on a line of their own starting with a dot or a whereas Escape sequences are in-line functions and in-word formatting elements starting with a backslash

The user can define her own formatting commands using the request. These commands are called macros, but they are used exactly like requests. Macro packages are pre-defined sets of macros written in the groff language. A user's possibilities to create escape sequences herself is very limited, only special characters can be mapped.

The groff language provides several kinds of variables with different interfaces. There are pre-defined variables, but the user can define her own variables as well.

String variables store character sequences. They are set with the request and retrieved by the escape sequences.

Register variables can store numerical values, numbers with a scale unit, and occasionally string-like objects. They are set with the request and retrieved by the escape sequences.

Environments allow the user to temporarily store global formatting parameters like line length, font size, etc. for later reuse. This is done by the request.

Fonts are identified either by a name or by an internal number. The current font is chosen by the request or by the escape sequences. Each device has special fonts, but the following fonts are available for all devices. R is the standard font Roman. B is its bold counterpart. The italic font is called I is everywhere available, but on text devices, it is displayed as an underlined Roman font. For the graphical output devices, there exist constant-width pendants of these font, CR, CI, and CB. On text devices, all characters have a constant width anyway.

Moreover, there are some advanced roff elements. A diversion stores information into a macro for later usage. A trap is a positional condition like a certain number of lines from page top or in a diversion or in the input. Some action can be prescribed to be run automatically when the condition is met.

More detailed information can be found in the groff info file.  

CONTROL CHARACTERS

There is a small set of characters that have a special controlling task in certain conditions.
A dot is only special at the beginning of a line or after the condition in the requests and There it is the control character that introduces a request (or macro). The special behavior can be delayed by using the escape. By using the request, the control character can be set to a different character, making the dot a non-special character.
In all other positions, it just means a dot character. In text paragraphs, it is advantageous to start each sentence at a line of its own.
The single quote has two controlling tasks. At the beginning of a line and in the conditional requests it is the non-breaking control character. That means that it introduces a request like the dot, but with the additional property that this request doesn't cause a linebreak. By using the request, the non-break control character can be set to a different character.
As a second task, it is the most commonly used argument separator in some functional escape sequences (but any pair of characters not part of the argument will work). In all other positions, it denotes the single quote or apostrophe character. Groff provides a printable representation with the escape sequence.
The double quote is used to enclose arguments in requests and macros. In the and requests, a leading double quote in the argument will be stripped off, making everything else afterwards the string to be defined (enabling leading whitespace). The escaped double quote introduces a comment. Otherwise, it is not special. Groff provides a printable representation with the escape sequence.
The backslash usually introduces an escape sequence (this can be changed with the request). A printed version of the escape character is the escape; a backslash glyph can be obtained by
The open parenthesis is only special in escape sequences when introducing an escape name or argument consisting of exactly two characters. In groff, this behavior can be replaced by the [] construct.
The opening bracket is only special in groff escape sequences; there it is used to introduce a long escape name or long escape argument. Otherwise, it is non-special, e.g. in macro calls.
The closing bracket is only special in groff escape sequences; there it terminates a long escape name or long escape argument. Otherwise, it is non-special.
space
Space characters are only functional characters. They separate the arguments in requests or macros, and the words in text lines. They are subject to groff's horizontal spacing calculations. To get a defined space width, escape sequences like (this is the escape character followed by a space), or should be used.
newline
In text paragraphs, newlines mostly behave like space characters. Continuation lines can be specified by an escaped newline, i.e., by specifying a backslash as the last character of a line.
tab
If a tab character occurs during text the interpreter makes a horizontal jump to the next pre-defined tab position. There is a sophisticated interface for handling tab positions.
 

NUMERICAL EXPRESSIONS

A numerical value is a signed or unsigned integer or float with or without an appended scale indicator. A scale indicator is a one-character abbreviation for a unit of measurement. A number followed by a scale indicator signifies a size value. By default, numerical values do not have a scale indicator, i.e., they are normal numbers.

The roff language defines the following scale indicators.

cCentimeter
iInch
PPica = 1/6 inch
pPoint = 1/72 inch
m Em = the font size in points (width of letter `m')
M100th of an Em
nEn = Em/2
uBasic unit for actual output device
vVertical line space in basic units
z scaled point = 1/sizescale of a point (defined in font DESC file)

Numerical expressions are combinations of the numerical values defined above with the arithmetical operators | t& | t& | t& | t& | t& (modulo), the comparative operators | t& (this is the same as | t& | t& | t& | t& | t& the logical operators | t& (and), | t& (or), | t& (not), and the parentheses | t& and | t&

Moreover, groff added the following operators for numerical expressions:

e1>?e2The maximum of e1 and e2.
e1<?e2The minimum of e1 and e2.
(c;e) Evaluate e using c as the default scaling indicator.

For details see the groff info file.  

CONDITIONS

Conditions occur in tests raised by the | t& | t& and the | t& requests. The following table characterizes the different types of conditions.

N A numerical expression N yields true if its value is >0.
!N True if the value of N is <=0.
's1's2' True if string s1 is identical to string s2.
!'s1's2' True if string s1 is not identical to string s2.
cch True if there is a character ch available.
dname True if there is a string, macro, diversion, or request called name.
eCurrent page number is even.
oCurrent page number is odd.
nFormatter is nroff.
rreg True if there is a register named reg.
tFormatter is troff.

 

REQUESTS

This section provides a short reference for the predefined requests. In groff, request and macro names can be arbitrarily long. No bracketing or marking of long names is needed.

Most requests take one or more arguments. The arguments are separated by space characters (no tabs!); there is no inherent limit for their length or number. An argument can be enclosed by a pair of double quotes: This is very handy if an argument contains space characters, e.g., | t& denotes a single argument.

Some requests have optional arguments with a different behaviour. Not all of these details are outlined here. Refer to the groff info file for all details.

In the following request specifications, most argument names were chosen to be descriptive. Only the following denotations need clarification.

cdenotes a single character.
font a font either specified as a font name or a font number.
anything all characters up to the end of the line or within rs{ and rs}.
n is a numerical expression that evaluates to an integer value.
N is an arbitrary numerical expression, signed or unsigned.
±N has three meanings depending on its sign, described below.

If an expression defined as | t& starts with a | t& sign the resulting value of the expression will be added to an already existing value inherent to the related request, e.g. adding to a number register. If the expression starts with a | t& the value of the expression will be subtracted from the request value.

Without a sign, | t& replaces the existing value directly. To assign a negative number either prepend  | t& or enclose the negative number in parentheses.  

REQUEST SHORT REFERENCE

Empty line, ignored. Useful for structuring documents. Complete line is a comment. Print | t& on standard error, exit program. Begin line adjustment for output lines in current adjust mode. Start line adjustment in mode | t& (c=l,r,b,n). Assign format | t& to | t& (c=l,i,I,a,A). Create alias name for | t& Create alias name for request, string, macro, or diversion | t& Append to | t& until | t& is called. Append to | t& until | t& is called. Same as | t& but with compatibility mode switched off during macro expansion. Same as | t& but with compatibility mode switched off during macro expansion. Append | t& to | t& Unformat ASCII characters, spaces, and some escape sequences in | t& Print a backtrace of the input on stderr. Embolden | t& by | t& units. Embolden Special Font | t& when current font is | t& Unset the blank line macro. Set the blank line macro to | t& End current diversion. Divert to | t& omitting a partially filled line. End current diversion. Divert and append to | t& omitting a partially filled line. Eject current page and begin new page. Eject current page; next page number | t& Line break. Break and spread output line. Same as | t& Break out of a while loop. Reset no-break control character to | t& Set no-break control character to | t& Reset control character to | t& Set control character to | t& Center the next input line. Center following | t& input lines. Copy contents of file | t& unprocessed to stdout or to the diversion. Treat characters | t& | t& | t& according to | t& number. Change | t& location to | t& Define character | t& to string | t& Chop the last character off macro, string, or diversion | t& Close the | t& Finish the current iteration of a while loop. Enable compatibility mode. If N is zero disable compatibility mode, otherwise enable it. Set constant character width mode for | t& to | t& ems with em | t& Continuous underline in nroff, like | t& in troff. End current diversion. Divert and append to | t& Define or redefine | t& until | t& is called. Define or redefine | t& until | t& is called. Same as | t& but with compatibility mode switched off during macro expansion. Same as | t& but with compatibility mode switched off during macro expansion. Define or redefine a macro whose name is contained in the string register | t& until | t& is called. Define or redefine a macro indirectly. | t& and | t& are string registers whose contents are interpolated for the macro name and the end macro, respectively. End current diversion. Divert to | t& Interpret | t& with compatibility mode disabled. Set | t& to | t& Set diversion trap to position | t& (default scale indicator  | t& Reset escape character to | t& Set escape character to | t& Restore escape character saved with | t& Save current escape character. Else part for if-else ( | t& request. The | t& will be run after the end of input. Turn off escape character mechanism. Switch to previous environment. Push down environment number or name | t& and switch to it. Copy the contents of environment | t& to the current environment. No pushing or popping. Exit from roff processing. Return to previous font family. Set the current font family to | t& Disable field mechanism. Set field delimiter to | t& and pad character to space. Set field delimiter to | t& and pad character to | t& Fill output lines. Flush output buffer. Mount | t& on position | t& Mount font with long | t& name to short | t& name on position | t& When the current font is | t& then the fonts | t& | t& | t& will be special. Return to previous font. Same as | t& Change to font name or number | t& same as | t& escape sequence. Translate | t& to | t& Remove additional hyphenation indicator character. Set up additional hyphenation indicator character  | t& Set the hyphenation code of character | t& to | t& that of | t& to | t& etc. Set the current hyphenation language to | t& Set the maximum number of consecutive hyphenated lines to | t& Read hyphenation patterns from | t& List of | t& with exceptional hyphenation. Switch to hyphenation mode | t& Set the hyphenation margin to | t& (default scale indicator  | t& Set the hyphenation space to | t& If | t& then | t& else goto | t& If | t& then | t& otherwise do nothing. Ignore text until | t& is called. Ignore text until | t& Change to previous indent value. Change indent according to | t& (default scale indicator  | t& Set an input-line count trap at position | t& Enable pairwise kerning. If | t& is zero, disable pairwise kerning, otherwise enable it. Remove leader repetition character. Set leader repetition character to  | t& Write the length of the string | t& in | t& Enable line-tabs mode (i.e., calculate tab positions relative to output line). If | t& is zero, disable line-tabs mode, otherwise enable it. Set input line number to | t& and filename to | t& Ligature mode on if | t& Change to previous line length. Set line length according to | t& (default size | t& default scale indicator  | t& Change to the previous value of additional intra-line skip. Set additional intra-line skip value to | t& i.e., | t& blank lines are inserted after each text output line. Length of title (default scale indicator  | t& Margin character off. Print character | t& after each text line at actual distance from right margin. Set margin character to | t& and distance to | t& from right margin (default scale indicator  | t& Mark current vertical position in | t& The same as the .so request except that file is searched in the tmac directories. No output-line adjusting. Need a one-line vertical space. Need | t& vertical space (default scale indicator  | t& No filling or adjusting of output-lines. No hyphenation. Number mode off. In line number mode, set number, multiple, spacing, and indent. Do not number next line. Do not number next | t& lines. Always execute | t& Define or modify | t& using | t& with auto-increment | t& Make the built-in condition n true and t false. Turn no-space mode on. Next file. Open | t& for writing and associate the stream named | t& with it. Like | t& but append to it. Output vertical distance that was saved by the | t& request. Reset page number character to  | t& Page number character. Pipe output to | t& (nroff only). Set page length to default | t& The current page length is stored in | t& Change page length to | t& (default scale indicator  | t& Print macro names and sizes (number of blocks of 128 bytes). Print only total of sizes of macros (number of 128 bytes blocks). Next page number | t& Print the names and contents of all currently defined number registers on stderr. Change to previous page offset. The current page offset is available in | t& Page offset | t& Return to previous point-size. Point size; same as | t& Get the bounding box of a PostScript image | t& This behaves like the | t& request except that input comes from the standard output of | t& Print the names and positions of all traps (not including input line traps and diversion traps) on stderr. Remove the definitions of characters | t& | t& | t& Read insertion. Return from a macro. Right justify the next | t& input lines. Remove request, macro, or string | t& Rename request, macro, or string | t& to | t& Rename register | t& to | t& Remove | t& Restore spacing; turn no-space mode off. Return (upward only) to marked vertical place (default scale indicator  | t& Reset soft hyphen character to | t& Set the soft hyphen character to | t& In a macro, shift the arguments by | t& positions. Include source file. Skip one line vertically. Space vertical distance | t& up or down according to sign of | t& (default scaling indicator  | t& Fonts | t& | t& etc. are special and will be searched for characters not in the current font. Space-character size set to | t& of the spacewidth in the current font. Space-character size set to | t& and sentence space size set to | t& of the spacewidth in the current font (=1/3 em). Associate | t& with font position | t& Replace the string in | t& with the substring defined by the indices | t& and | t& Save | t& of vertical space. Save the vertical distance | t& for later output with | t& request. Execute program | t& Set tabs after every position that is a multiple of | t& (default scaling indicator  | t& Set tabs at positions | t& | t& ..., | t& then set tabs at | t& | t& ..., | t& then at | t& | t& ..., | t& and so on. Remove tab repition character. Set tab repetition character to  | t& Temporary indent next line (default scaling indicator  | t& Enable track kerning for | t& Three-part title. Print | t& on terminal (UNIX standard message output). Print | t& on terminal (UNIX standard message output), allowing leading whitespace if | t& starts with | t& (which will be stripped off). Similar to | t& without emitting a final newline. Translate | t& to | t& | t& to | t& etc. on output. Transparently output the contents of file | t& This is the same as the | t& request except that the translations do not apply to text that is transparently throughput into a diversion with | t& Make the built-in condition t true and n false. Underline font set to | t& (to be switched to by | t& Underline (italicize in troff) | t& input lines. Unformat space characters and tabs, preserving font information in | t& Enable vertical position traps if | t& is non-zero, disable them otherwise. Change to previous vertical base line spacing. Set vertical base line spacing to | t& Default value is | t& Set warnings code to | t& Set location trap; negative means from page bottom. While condition | t& is true, accept | t& as input. Write | t& to the stream named | t&

Besides these standard groff requests, there might be further macro calls. They can originate from a macro package (see roff(7) for an overview) or from a preprocessor.

Preprocessor macros are easy to be recognized. They enclose their code into a pair of characteristic macros.

preprocessorstart macro end macro


eqn.PS.PE
grap.G1.G2
grn.GS.GE
pic.PS.PE
refer.R1.R2
soelimnonenone
tbl.TS.TE

 

ESCAPE SEQUENCES

Escape sequences are in-line language elements usually introduced by a backslash | t& and followed by an escape name and sometimes by a required argument. Input processing is continued directly after the escaped character or the argument resp. without an intervening separation character. So there must be a way to determine the end of the escape name and the end of the argument.

This is done by enclosing names (escape name and arguments consisting of a variable name) by a pair of brackets | t& and constant arguments (number expressions and characters) by apostrophes (ASCII 0x27) like cqconstantcq.

There are abbreviations for short names. Two character escape names can be specified by an opening parenthesis like | t& without a closing counterpart. And all one-character names different from the special characters | t& and | t& can even be specified without a marker in the form | t&

Constant arguments of length | t& can omit the marker apostrophes, too, but there is no two-character analogue.

While 1-character escape sequences are mainly used for in-line functions and system related tasks, the 2-letter names following the | t& construct are used for special characters predefined by the roff system. Names with more than two characters | t& mostly denote user defined named characters (see the | t& request).  

SINGLE CHARACTER ESCAPES

| t& Beginning of a comment. Everything up to the end of the line is ignored.
| t& Everything up to and including the next newline is ignored. This is interpreted in copy mode. This is like | t& except the ignoring of the terminating newline.
| t& The string stored in the string variable with 1-character name | t&
| t& The string stored in the string variable with 2-character name | t&
| t& The string stored in the string variable with arbitrary length name | t&
| t& The name by which the current macro was invoked. The | t& request can make a macro have more than one name.
| t& Macro argument with 1-place number | t& where | t& is a digit between 1 and 9.
| t& Macro argument with 2-digit number | t&
ǃf~D Macro argument with number ǃf~D where ǃf~D is a numerical expression evaluating to an integer >=1.
ǃf~D In a macro, the concatenation of all the arguments separated by spaces.
ǃf~D In a macro, the concatenation of all the arguments with each surrounded by double quotes, and separated by spaces.
ǃf~D reduces to a single backslash; useful to delay its interpretation as escape character in copy mode. For a printable backslash, use ǃf~D
ǃf~D The acute accent ´; same as ǃf~D Unescaped: apostrophe, right quotation mark, single quote (ASCII 0x27).
ǃf~D The grave accent `; same as ǃf~D Unescaped: left quote, backquote (ASCII 0x60).
ǃf~D The - sign in the current font.
ǃf~D An uninterpreted dot (period), even at start of line.
ǃf~D Default optional hyphenation character.
ǃf~D Transparent line indicator.
ǃf~D In a diversion, this will transparently embed ǃf~D in the diversion. ǃf~D is read in copy mode. See also the escape sequences ǃf~D and ǃf~D
ǃf~D Unpaddable space-size space character (no line break).
ǃf~D Digit width.
ǃf~D 1/6 em narrow space character; zero width in nroff.
ǃf~D 1/12 em half-narrow space character; zero width in nroff.
ǃf~D Non-printable, zero width character.
ǃf~D Like ǃf~D except that it behaves like a character declared with the cflags request to be transparent for the purposes of end of sentence recognition.
ǃf~D 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.
ǃf~D 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.
ǃf~D Unbreakable space that stretches like a normal inter-word space when a line is adjusted.
ǃf~D Inserts a zero-width break point (similar to ǃf~D but without a soft hyphen character).
ǃf~D Ignored newline, for continuation lines.
ǃf~D Begin conditional input.
ǃf~D End conditional input.
ǃf~D The special character with 2-character name ǃf~D see section SPECIAL CHARACTERS.
ǃf~D The named character with arbitrary length name ǃf~D
ǃf~D Non-interpreted leader character.
ǃf~D If ǃf~D is acceptable as a name of a string, macro, diversion, register, environment or font it expands to ǃf~D and ǃf~D otherwise.
ǃf~D Bracket building function.
ǃf~D If ǃf~D is acceptable as a valid numeric expression it expands to ǃf~D and ǃf~D otherwise.
ǃf~D Interrupt text processing.
ǃf~D The character called ǃf~D same as ǃf~D but compatible to other roff versions.
ǃf~D Forward (down) 1/2 em vertical unit (1/2 line in nroff).
ǃf~D Draw a graphical element defined by the characters in ǃf~D see groff info file for details.
ǃf~D Printable version of the current escape character.
ǃf~D Equivalent to an escape character, but is not interpreted in copy-mode.
ǃf~D Change to font with 1-character name or 1-digit number ǃf~D
ǃf~D Change to font with 2-characer name or 2-digit number ǃf~D
ǃf~D Change to font with arbitrary length name or number expression ǃf~D
ǃf~D Return format of register with name ǃf~D suitable for ǃf~D Alternative forms ǃf~D and ǃf~D
ǃf~D Local horizontal motion; move right ǃf~D (left if negative).
ǃf~D Set height of current font to ǃf~D
ǃf~D Mark horizontal input place in register with arbitrary length name ǃf~D Alternative forms ǃf~D and ǃf~D
ǃf~D Horizontal line drawing function (optionally using character ǃf~D
ǃf~D Vertical line drawing function (optionally using character ǃf~D
ǃf~D The numerical value stored in the register variable with the 1-character name ǃf~D
ǃf~D The numerical value stored in the register variable with the 2-character name ǃf~D
ǃf~D The numerical value stored in the register variable with arbitrary lenght name ǃf~D
ǃf~D Typeset the character with code ǃf~D in the current font, no special fonts are searched. Useful for adding characters to a font using the ǃf~D request.
ǃf~D Overstrike characters ǃf~D ǃf~D ǃf~D etc.
ǃf~D Break and spread output line.
ǃf~D Reverse 1 em vertical motion (reverse line in nroff).
ǃf~D The same as ǃf~D ǃf~D ǃf~D
ǃf~D Set the point size to N scaled points. Note the alternative forms rss±[N], rss'±N', rss±'N', ǃf~D rss±(xy, ǃf~D Same as ǃf~D request.
ǃf~D Slant output ǃf~D degrees.
ǃf~D Non-interpreted horizontal tab.
ǃf~D Reverse (up) 1/2 em vertical motion (1/2 line in nroff).
ǃf~D Local vertical motion; move down ǃf~D (up if negative).
ǃf~D The contents of the environment variable ǃf~D Alternative forms ǃf~D and ǃf~D
ǃf~D The width of the character sequence ǃf~D
ǃf~D Extra line-space function (negative before, positive after).
ǃf~D Output ǃf~D as device control function.
ǃf~D Output string variable or macro ǃf~D uninterpreted as device control function. Alternative forms ǃf~D and ǃf~D
ǃf~D Print ǃf~D with zero width (without spacing).
ǃf~D Print ǃf~D and then restore the horizontal and vertical position; ǃf~D may not contain tabs or leaders.

The escape sequences ǃf~D ǃf~D ǃf~D ǃf~D ǃf~D ǃf~D ǃf~D ǃf~D ǃf~D and ǃf~D are interpreted in copy mode.

Escape sequences starting with ǃf~D or ǃf~D do not represent single character escape sequences, but introduce escape names with two or more characters.

If a backslash is followed by a character that does not constitute a defined escape sequence the backslash is silently ignored and the character maps to itself.  

SPECIAL CHARACTERS

Common special characters are predefined by escape sequences of the form ǃf~D with characters ǃf~D and ǃf~D Some of these exist in the usual font while most of them are only available in the special font. Below you'll find a selection of the most important glyphs; a complete list can be found in groff_char(7).

ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
ǃf~D
 

REGISTERS

Registers are variables that store a value. In groff, most registers store numerical values (see section NUMERICAL EXPRESSIONS above), but some can also hold a string value.

Each register is given a name. Arbitrary registers can be defined and set with the request ǃf~D ǃf~D

The value stored in a register can be retrieved by the escape sequences introduced by ǃf~D

Most useful are predefined registers. In the following the notation ǃf~D is used to refer to a register called ǃf~D to make clear that we speak about registers. Please keep in mind that the ǃf~D decoration is not part of the register name.  

READ-ONLY REGISTERS

The following registers have predefined values that should not be modified by the user (usually, registers starting with a dot a read-only). Mostly, they provide information on the current settings or store results from request calls.

Post-line extra line-space most recently utilized using ǃf~D Set to ǃf~D in troff if option -A is used; always ǃf~D in nroff. 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 ǃf~D request. 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. The skew 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. Current vertical place in current diversion; equal to register ǃf~D Always 1 in GNU troff. Macros should use it to test if running under groff. The current hyphenation language as set by the .hla request. The number of immediately preceding consecutive hyphenated lines. The maximum allowed number of consecutive hyphenated lines, as set by the ǃf~D request. The current hyphenation flags (as set by the ǃf~D request). The current hyphenation margin (as set by the ǃf~D request). The current hyphenation space (as set by the ǃf~D request). Positive if last output line contains ǃf~D ǃf~D if pairwise kerning is enabled, ǃf~D otherwise. The current ligature mode (as set by the ǃf~D request). The current line-tabs mode (as set by the ǃf~D request). The title length (as set by the ǃf~D request). The amount of space that was needed in the last ǃf~D request that caused a trap to be sprung. Useful in conjunction with ǃf~D ǃf~D if in no-space mode, ǃf~D otherwise. The number of the next page: either the value set by a ǃf~D request, or the number of the current page plus 1. The number of lines to be right-justified as set by the rj request. The last requested pointsize in points as a decimal fraction (string-valued). Set to ǃf~D if option -T is used. A string representation of the current tab settings suitable for use as an argument to the ǃf~D request. The amount of vertical space truncated by the most recently sprung vertical position trap, or, if the trap was sprung by a ǃf~D request, minus the amount of vertical motion produced by ǃf~D request. 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 ǃf~D register. The value of the parameters set by the first argument of the ǃf~D request. The value of the parameters set by the second argument of the ǃf~D request. ǃf~D if vertical position traps are enabled, ǃf~D otherwise. The sum of the number codes of the currently enabled warnings.  

WRITABLE REGISTERS

The following registers can be read and written by the user. They have predefined default values, but these can be modified for customizing a document.

ǃf~D Lower left x-coordinate (in PostScript units) of a given PostScript image (set by ǃf~D Lower left y-coordinate (in PostScript units) of a given PostScript image (set by ǃf~D ǃf~D but takes account of the heights and depths of characters. Like ǃf~D but takes account of the heights and depths of characters. Depth of string below base line (generated by width function ǃf~D Right skip width from the center of the last character in the ǃf~D argument. If greater than 0, the maximum number of objects on the input stack. If <=0 there is no limit, i.e., recursion can continue until virtual memory is exhausted. The amount of horizontal space (possibly negative) that should be added to the last character before a subscript (generated by width function ǃf~D Height of string above base line (generated by width function ǃf~D The return value of the system() function executed by the last ǃf~D request. Upper right x-coordinate (in PostScript units) of a given PostScript image (set by ǃf~D Upper right y-coordinate (in PostScript units) of a given PostScript image (set by ǃf~D Current year minus 1900. For Y2K compliance use register ǃf~D instead.  

WARNINGS

Each warning generated by groff is identified by a name and a code number. The codes are powers of 2 to allow bit-encoding with a single integer. There are also names that can be used to refer to groups of warnings.

The name associated with a warning is used by the ǃf~D and ǃf~D options; the number code is used by the ǃf~D request and by the ǃf~D register.

ǃf~D
All warnings except and Intended to cover all warnings with traditional macro packages.
ǃf~D
In fill mode, lines which could not be broken so that their length was less than the line length. This is enabled by default.
ǃf~D
Non-existent characters. This is enabled by default.
ǃf~D
Missing or mismatched closing delimiters.
ǃf~D
Use of ǃf~D or ǃf~D without an argument when there is no current diversion.
ǃf~D
Use of the ǃf~D request with no matching ǃf~D request.
ǃf~D
Unrecognized escape sequence. Then the escape character is ignored.
ǃf~D
Non-existent fonts. This is enabled by default.
ǃf~D
Illegal escapes in text ignored with the ǃf~D request. These are conditions that are errors when they occur outside of ignored text.
ǃf~D
Use of undefined strings, macros, and diversions. Automatically handled as empty. Usually, only one warning per name.
ǃf~D
Request that is missing non-optional arguments.
ǃf~D
Illegal input character.
ǃf~D
Invalid numeric expressions. This is enabled by default.
ǃf~D
Out of range arguments.
ǃf~D
Use of undefined number register. Automatically defined as having value 0. Usually, only one warning per name.
ǃf~D
Use of ǃf~D where a number was expected.
ǃf~D
Meaningless scaling indicators.
ǃf~D
Missing space between a request or macro and its argument. Then no macro is automatically defined. This is enabled by default. This warning will never occur in compatibility mode.
ǃf~D
Dubious syntax in numeric expressions.
ǃf~D
Inappropriate use of a tab character (either in an unquoted macro argument or where a number was expected).
ǃf~D
All warnings.

BitCodeWarningBitCodeWarningBitCodeWarning

01char8256di1665536space
12number9512mac17131072font
24break101024reg18262144ig
38delim112048tab
416el124096right-brace
532scale138192missing
664range1416384input
7128syntax1532768escape

 

COMPATIBILITY

groff provides a compatibility mode that allows to process roff code written for classical or for other implementations of roff in a consistent way.

Compatibility mode can be turned on with the | t& command line option, and turned on or off with the | t& request. The number register | t& is | t& if compatibility mode is on, | t& otherwise.

This became necessary because the GNU concept for long names causes some incompatibilities. Classical troff will interpret

.dsabcd

as defining a string ab with contents cd. Normally, groff will interpret this as a call of a macro named | t&

Also classical troff will interpret | t& or | t& as references to a string or number register called | t& In GNU native mode, however, this will normally be interpreted as the start of a long name.

In compatibility mode, groff will interpret these things in the traditional way, but long names are not recognized.

On the other hand, groff in GNU native mode does not allow to use the escape sequences | t& | t& | t& | t& | t& | t& | t& | t& | t& | t& | t& | t& | t& and | t& in names of strings, macros, diversions, number registers, fonts or environments, whereas classical troff does. The | t& escape sequence can be helpful in avoiding these escape sequences in names.

Fractional pointsizes cause one noteworthy incompatibility. In classical troff, the | t& 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 mode, 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 the | t& | t& | t& | t& or | t& requests.

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. The following example will make things clearer.

.di x
rsrsrsrs
.br
.di
.x

In GNU mode this will be printed as | t& So each pair of input backslashes | t& is turned into a single output backslash | t& 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 | t&

The correct way to get a printable | t& is to use the | t& 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 mode and compatibility mode.

To store an escape sequence in a diversion that will be interpreted when the diversion is reread, either the traditional | t& transparent output facility or the new | t& escape sequence can be used.  

BUGS

At the moment, the documentation of the groff system is in a state of change and evolution. It is possible that there are small inconsistencies between different documents temporarily.

The WARNINGS section belongs to troff(1).  

AUTHOR

This document is part of groff, the GNU roff distribution. It was written by Bernd Warken <bwarken@mayn.de>.

It 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 under

http://www.gnu.org/copyleft/fdl.html.

Formerly, the extensions of the groff language were kept in the manual page troff(1). This document contains the essential parts of that documentation, but the gory details are found in the groff info file.  

SEE ALSO

The main source of information for the groff language is the groff info(1) file.

For a survey of roff and the groff system and further documentation pointers see roff(7).

The formatter programs are described in groff(1) and troff(1); a complete of all predefined glyph names can be found in groff_char(7).

The classical troff documentation is available on-line at

http://cm.bell-labs.com/cm/cs/cstr.html

and
http://www.kohala.com/start/troff/.


 

Index

NAME
DESCRIPTION
GROFF ELEMENTS
CONTROL CHARACTERS
NUMERICAL EXPRESSIONS
CONDITIONS
REQUESTS
REQUEST SHORT REFERENCE
ESCAPE SEQUENCES
SINGLE CHARACTER ESCAPES
SPECIAL CHARACTERS
REGISTERS
READ-ONLY REGISTERS
WRITABLE REGISTERS
WARNINGS
COMPATIBILITY
BUGS
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 22:57:25 GMT, December 09, 2024