troff(1)
π troff(1) β GNU roff typesetter and document formatter β¨
General Commands Manual found it. This is the troff(1) page, bestie: troff is the GNU roff typesetter and document formatter, and we are reading every single line because that's the vibe. π«Ά
πΈ NAME πΈ
troff β GNU roff typesetter and document formatter π
π¦ SYNOPSIS π¦
troff [-abcCEiRUz] [-d ctext] [-d string=text] [-f font-family]
[-F font-directory] [-I inclusion-directory] [-m macro-package]
[-M macro-directory] [-n page-number] [-o page-list] [-r cnumeric-
expression] [-r register=numeric-expression] [-T output-device]
[-w warning-category] [-W warning-category] [file ...]
troff --help
troff -v
troff --version
π DESCRIPTION π
GNU troff transforms groff(7) language input into the device-independent output format described in groff_out(5); troff is thus the heart of the GNU roff document formatting system. π
If no file operands are given on the command line, or if file is -, the standard input stream is read.
GNU troff is functionally compatible with the AT&T troff typesetter and features numerous extensions. Many people prefer to use the groff(1) command, a front end which also runs preprocessors and output drivers in the appropriate order and with appropriate options. β¨
β¨ OPTIONS β¨
Okay bestie, option menu time. No skips, no βIβll read it laterβ β weβre doing all of them. π
-h,--helpβ display a usage message.-v,--versionβ show version information.
All of these exit afterward. Bye. π
-aβ generate a plain text approximation of the typeset output. The read-only register.Ais set to1. This option produces a sort of abstract preview of the formatted output. π- Page breaks are marked by a phrase in angle brackets; for example, β
<beginning of page>β. - Lines are broken where they would be in the formatted output.
- A horizontal motion of any size is represented as one space. Adjacent horizontal motions are not combined. Inter-sentence space nodes (those arising from the second argument to the
.ssrequest) are not represented. - Vertical motions are not represented.
- Special characters are rendered in angle brackets; for example, the default soft hyphen character appears as β
<hy>β.
- Page breaks are marked by a phrase in angle brackets; for example, β
π¨ Do not treat the above description as a specification, bestie β the details of -a output are subject to change.
-bβ write a backtrace reporting the state oftroff's input parser to the standard error stream with each diagnostic message. The line numbers given in the backtrace might not always be correct, becausetroff's idea of line numbers can be confused by requests that append to macros. π-cβ start with color output disabled. π¨-Cβ enable AT&T troff compatibility mode; implies-c. Seegroff_diff(7).-d ctext/-d string=textβ define roff stringcorstringastext.cmust be one character;stringcan be of arbitrary length. Such string assignments happen before any macro file is loaded, including the startup file. Due togetopt_long(3)limitations,ccannot be, andstringcannot contain, an equals sign, even though that is a valid character in a roff identifier. π-Eβ inhibittrofferror messages; implies-Ww. This option does not suppress messages sent to the standard error stream by documents or macro packages usingtmor related requests.-ffam β use fam as the default font family.-Fdir β search in directory dir for the selected output device's directory of device and font description files. See the description ofGROFF_FONT_PATHin section βEnvironmentβ below for the default search locations and ordering.-iβ read the standard input stream after all named input files have been processed.-Idir β search the directory dir for files (those named on the command line; inpsbb,so, andsoquietrequests; and in\X'ps: import',\X'ps: file', and\X'pdf: pdfpic'device control escape sequences).-Imay be specified more than once; each dir is searched in the given order. To search the current working directory before others, add-I .at the desired place; it is otherwise searched last.-Iworks similarly to, and is named for, the βincludeβ option of Unix C compilers.-mname β process the filename.tmacprior to any input files. If not found,tmac.nameis attempted. name (in both arrangements) is presumed to be a macro file; see the description ofGROFF_TMAC_PATHin section βEnvironmentβ below for the default search locations and ordering.-Mdir β search directory dir for macro files. See the description ofGROFF_TMAC_PATHin section βEnvironmentβ below for the default search locations and ordering.-nnum β begin numbering pages at num. The default is1.-olist β output only pages in list, which is a comma-separated list of inclusive page ranges;nmeans pagen,m-nmeans every page betweenmandn,-nmeans every page up ton, andn-means every page fromnon.troffstops processing and exits after formatting the last page enumerated in list.-r cnumeric-expression/-r register=numeric-expressionβ define roff registercorregisterasnumeric-expression.cmust be a one-character name;registercan be of arbitrary length. Such register assignments happen before any macro file is loaded, including the startup file. Due togetopt_long(3)limitations,ccannot be, andregistercannot contain, an equals sign, even though that is a valid character in a roff identifier. π-Rβ don't loadtroffrcandtroffrc-end.-Tdev β prepare output for device dev. The default isps; seegroff(1).-Uβ operate in unsafe mode, enabling theopen,opena,pi,pso, andsyrequests, which are disabled by default because they allow an untrusted input document to write to arbitrary file names and run arbitrary commands. This option also adds the current directory to the macro package search path; see the-mand-Moptions above.
π¨ Like, genuinely unsafe, bestie. That's why it's off by default.
-wname /-Wname β enable (-w) or inhibit (-W) warnings in category name. See section βWarningsβ below.-zβ suppress formatted output.
π Warnings π
Okay bestie, troff's warnings are divided into named, numbered categories. The name associated with each warning category is used by the -w and -W options. Each category is also assigned a power of two; the sum of enabled category codes is used by the warn request and the .warn register. Warnings of each category are produced under the following circumstances.
breakβ bit2, code4. A filled output line could not be broken such that its length was less than the output line length\n[.l]. This category is enabled by default.charβ bit0, code1. No mounted font defines a glyph for the requested character. This category is enabled by default.colorβ bit19, code524288. An undefined color name was selected, an attempt was made to define a color using an unrecognized color space, an invalid component in a color definition was encountered, or an attempt was made to redefine a default color.delimβ bit3, code8. The closing delimiter in an escape sequence was missing or mismatched.diβ bit8, code256. Adi,da,box, orboxarequest was invoked without an argument when there was no current diversion.elβ bit4, code16. Theelrequest was encountered with no prior correspondingierequest.escapeβ bit15, code32768. An unsupported escape sequence was encountered.fileβ bit20, code1048576. An attempt was made to load a file that does not exist. This category is enabled by default.fontβ bit17, code131072. A non-existent font was selected, or the selection was ignored because a font selection escape sequence was used after the output line continuation escape sequence on an input line. This category is enabled by default.igβ bit18, code262144. An invalid escape sequence occurred in input ignored using theigrequest. This warning category diagnoses a condition that is an error when it occurs in non-ignored input.inputβ bit14, code16384. An invalid character occurred on the input stream.macβ bit9, code512. An undefined string, macro, or diversion was used. When such an object is dereferenced, an empty one of that name is automatically created. So, unless it is later deleted, at most one warning is given for each.
This warning is also emitted upon an attempt to move an unplanted trap macro. In such cases, the unplanted macro is not dereferenced, so it is not created if it does not exist.
missingβ bit13, code8192. A request was invoked with a mandatory argument absent.numberβ bit1, code2. An invalid numeric expression was encountered. This category is enabled by default.rangeβ bit6, code64. A numeric expression was out of range for its context.regβ bit10, code1024. An undefined register was used. When an undefined register is dereferenced, it is automatically defined with a value of 0. So, unless it is later deleted, at most one warning is given for each.right-braceβ bit12, code4096. A right brace escape sequence\}was encountered where a number was expected.scaleβ bit5, code32. A scaling unit inappropriate to its context was used in a numeric expression.spaceβ bit16, code65536. A space was missing between a request or macro and its argument. This warning is produced when an undefined name longer than two characters is encountered and the first two characters of the name constitute a defined name. No request is invoked, no macro called, and an empty macro is not defined. This category is enabled by default. It never occurs in compatibility mode.syntaxβ bit7, code128. A self-contradictory hyphenation mode was requested; an empty or incomplete numeric expression was encountered; an operand to a numeric operator was missing; an attempt was made to define a recursive, empty, or nonsensical character class; or a groff extension conditional expression operator was used while in compatibility mode.tabβ bit11, code2048. A tab character was encountered where a number was expected, or appeared in an unquoted macro argument.
Two warning names group other warning categories for convenience.
allβ All warning categories exceptdi,mac, andreg. This shorthand is intended to produce all warnings that are useful with macro packages and documents written for AT&T troff and its descendants, which have less fastidious diagnostics than GNU troff.wβ All warning categories. Authors of documents and macro packages targeting groff are encouraged to use this setting.
π Environment π
GROFF_FONT_PATH and GROFF_TMAC_PATH each accept a search path of directories; that is, a list of directory names separated by the system's path component separator character. On Unix systems, this character is a colon (:); on Windows systems, it is a semicolon (;).
GROFF_FONT_PATH
A list of directories in which to seek the selected output device's directory of device and font description files. troff will scan directories given as arguments to any specified -F options before these, then in a site-specific directory (/etc/groff/site-font), a standard location (/usr/share/groff/1.23.0/font), and a compatibility directory (/usr/lib/font) after them.
GROFF_TMAC_PATH
A list of directories in which to search for macro files. troff will scan directories given as arguments to any specified -M options before these, then the current directory (only if in unsafe mode), the user's home directory, a site-specific directory (/etc/groff/site-tmac), and a standard location (/usr/share/groff/1.23.0/tmac) after them.
GROFF_TYPESETTER
Set the default output device. If empty or not set, ps is used. The -T option overrides GROFF_TYPESETTER.
SOURCE_DATE_EPOCH
A timestamp (expressed as seconds since the Unix epoch) to use as the output creation timestamp in place of the current time. The time is converted to human-readable form using localtime(3) when the formatter starts up and stored in registers usable by documents and macro packages.
TZ
The timezone to use when converting the current time (or value of SOURCE_DATE_EPOCH) to human-readable form; see tzset(3).
π Files π
/usr/share/groff/1.23.0/tmac/troffrcβ is an initialization macro file loaded before any macro packages specified with-moptions./usr/share/groff/1.23.0/tmac/troffrc-endβ is an initialization macro file loaded after all macro packages specified with-moptions./usr/share/groff/1.23.0/tmac/name.tmacβ are macro files distributed with groff./usr/share/groff/1.23.0/font/devname/DESCβ describes the output device name./usr/share/groff/1.23.0/font/devname/Fβ describes the font F of device name.
π¨troffrcandtroffrc-endare sought neither in the current nor the home directory by default for security reasons, even if the-Uoption is specified. Use the-Mcommand-line option or theGROFF_TMAC_PATHenvironment variable to add these directories to the search path if necessary.
π Authors π
The GNU version of troff was originally written by James Clark; he also wrote the original version of this document, which was updated by Werner Lemberg, Bernd Warken, and G. Branden Robinson.
π See also π
Groff: The GNU Implementation of troff, by Trent A. Fisher and Werner Lemberg, is the primary groff manual. You can browse it interactively with info groff.
groff(1)β offers an overview of the GNU roff system and describes its front end executable.groff(7)β details the groff language, including a short but complete reference of all predefined requests, registers, and escape sequences.groff_char(7)β explains the syntax of groff special character escape sequences, and lists all special characters predefined by the language.groff_diff(7)β enumerates the differences between AT&T device-independent troff and groff.groff_font(5)β covers the format of groff device and font description files.groff_out(5)β describes the format of troff's output.groff_tmac(5)β includes information about macro files that ship with groff.roff(7)β supplies background on roff systems in general, including pointers to further related documentation.
π That's the whole page, bestie β this one is troff(1) from groff 1.23.0, dated 29 October 2024. Periodt. π
π¦ where this page comes from
- centos-stream 10: groff-base 1.23.0-10.el10 Β· GPL-3.0-or-later AND GFDL-1.3-or-later AND BSD-4-Clause-UC AND MIT AND X11 AND LicenseRef-Fedora-Public-Domain
- Copyright (C) 1989-2021 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms