.TH groff 1 "2026-03-15" "groff 1.24.1" .SH Name groff \- front end to the GNU .I roff document formatting system . . .\" ==================================================================== .\" Legal Terms .\" ==================================================================== .\" .\" Copyright 1989-2024 Free Software Foundation, Inc. .\" 2018-2025 G. Branden Robinson .\" .\" This file is part of groff, the GNU roff typesetting system. .\" .\" Permission is granted to copy, distribute and/or modify this .\" document under the terms of the GNU Free Documentation License, .\" Version 1.3 or any later version published by the Free Software .\" Foundation; with no Invariant Sections, with no Front-Cover Texts, .\" and with no Back-Cover Texts. .\" .\" A copy of the Free Documentation License is included as a file .\" called FDL in the main directory of the groff source package. . . .\" Save and disable compatibility mode (for, e.g., Solaris 10/11). .do nr *groff_groff_1_man_C \n[.cp] .cp 0 . .\" Define fallback for groff 1.23's MR macro if the system lacks it. .nr do-fallback 0 .if !\n(.f .nr do-fallback 1 \" mandoc .if \n(.g .if !d MR .nr do-fallback 1 \" older groff .if !\n(.g .nr do-fallback 1 \" non-groff *roff .if \n[do-fallback] \{\ . de MR . ie \\n(.$=1 \ . I \%\\$1 . el \ . IR \%\\$1 (\\$2)\\$3 . . .\} .rr do-fallback . .\" Define a string for the TeX logo. .ie t .ds TeX T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X .el .ds TeX TeX . .\" ==================================================================== .SH Synopsis .\" ==================================================================== . .SY groff .RB [ \-abcCeEgGijklNpRsStUVXzZ ] .RB [ \-d\~\c .IR ctext ] .RB [ \-d\~\c .IB string =\c .IR text ] .RB [ \-D\~\c .IR fallback-encoding ] .RB [ \-f\~\c .IR font-family ] .RB [ \-F\~\c .IR font-directory ] .RB [ \-I\~\c .IR inclusion-directory ] .RB [ \-K\~\c .IR input-encoding ] .RB [ \-L\~\c .IR spooler-argument ] .RB [ \-m\~\c .IR macro-package ] .RB [ \-M\~\c .IR macro-directory ] .RB [ \-n\~\c .IR page-number ] .RB [ \-o\~\c .IR page-list ] .RB [ \-P\~\c .IR postprocessor-argument ] .RB [ \-r\~\c .IR cnumeric-expression ] .RB [ \-r\~\c .IB register =\c .IR numeric-expression ] .RB [ \-T\~\c .IR output-device ] .RB [ \-w\~\c .IR warning-category ] .RB [ \-W\~\c .IR warning-category ] .RI [ file\~ .\|.\|.] .YS . . .P .SY groff .B \-h .YS . .SY groff .B \-\-help .YS . . .P .SY groff .B \-v .RI [ option\~ .\|.\|.\&] .RI [ file\~ .\|.\|.] .YS . .SY groff .B \%\-\-version .RI [ option\~ .\|.\|.\&] .RI [ file\~ .\|.\|.] .YS . . .\" ==================================================================== .SH Description .\" ==================================================================== . .I groff is the primary front end to the GNU .I roff document formatting system. . .\" BEGIN Keep parallel with groff.texi node "What Is groff?". .\" This language is slightly expanded from that in the "ANNOUNCE" file .\" and on the groff home page. GNU .I roff is a typesetting system that reads plain text input that includes formatting commands to produce output in PostScript, PDF, HTML, or other formats, or for display to a terminal. . Formatting commands can be low-level typesetting primitives, macros from a supplied package, or user-defined macros. . All three approaches can be combined. . If no .I file operands are specified, or if .I file is .RB \[lq] \- \[rq], .I groff reads the standard input stream. . . .P A reimplementation and extension of .I troff \" AT&T and other programs from AT&T Unix, .I groff is widely available on POSIX and other systems owing to its long association with Unix manuals, including man pages. . It and its predecessor have produced several best-selling software engineering texts. .I groff can create typographically sophisticated documents while consuming minimal system resources. . . .P Like its predecessor \[lq]troff\[rq], the term \[lq]groff\[rq] affords two popular pronunciations: as one syllable (like the surname), rhyming with \[lq]trough\[rq], or as \[lq]jee-roff\[rq], in analogy to the Bell Labs pronunciation \[lq]tee-roff\[rq]. . Little risk of confusion exists; use whichever suits you. .\" END Keep parallel with groff.texi node "What Is groff?". . . .P The .I groff command orchestrates the execution of preprocessors, the transformation of input documents into a device-independent page description language, and the production of output from that language. . . .\" ==================================================================== .SH Options .\" ==================================================================== . .B \-h and .B \-\-help display a usage message and exit. . . .P Because .I groff is intended to subsume most users' direct invocations of the .MR \%troff 1 formatter, the two programs share a set of options. . However, .I groff has some options that .I \%troff does not share, and others which .I groff interprets differently. . At the same time, not all valid .I \%troff options can be given to .IR groff . . . .\" ==================================================================== .SS "\f[I]groff\f[]-specific options" .\" ==================================================================== . The following options either do not exist in GNU .I troff \" GNU or are interpreted differently by .IR groff . . . .TP 9n \" "-m name" + 2n .BI \-D\~ enc Use .I enc as .MR preconv 1 's fallback input encoding; implies .BR \-k . . . .TP .B \-e Run .MR \%eqn 1 preprocessor. . . .TP .B \-g Run .MR \%grn 1 preprocessor. . . .TP .B \-G Run .MR grap 1 preprocessor; implies .BR \-p . . . .TP .BI \-I\~ dir Works as .IR \%troff 's option (see below), but also implies .B \-g and .BR \-s . . .I groff passes .B \-I options and their arguments to .MR \%soelim 1 , .MR \%troff 1 , and output drivers; with the option letter changed to .BR \-M , it passes the same arguments to .MR \%grn 1 . . . .TP .B \-j Run .MR \%chem 1 preprocessor; implies .BR \-p . . . .TP .B \-k Run .MR preconv 1 preprocessor. . Refer to its man page for its behavior if neither of .IR groff 's .B \-K or .B \-D options is also specified. . . .TP .BI \-K\~ enc Set input encoding used by .MR preconv 1 to .IR enc ; implies .BR \-k . . . .TP .B \-l Send the output to a spooler program for printing. . The .RB \[lq] print \[rq] directive in the device description file specifies the default command to be used; see .MR groff_font 5 . . If no such directive is present for the output device, .ie ''' \{\ this option is ignored. .\} .el \{\ output is piped to .MR 1 . .\} . See options .B \-L and .BR \-X . . . .TP .BI \-L\~ arg Pass .I arg to the print spooler. . If multiple .IR arg s are required, pass each with a separate .B \-L option. . .I groff does not prefix an option dash to .I arg before passing it to the spooler. . . .TP .B \-M Works as .IR \%troff 's option (see below), but is also passed to .MR \%eqn 1 , .MR grap 1 , and .MR \%grn 1 . . . .TP .B \-N Prohibit newlines between .I eqn \" language delimiters: pass .B \-N to .MR \%eqn 1 . . . .TP .B \-p Run .MR \%pic 1 preprocessor. . . .TP .BI \-P\~ arg Pass .I arg to the postprocessor. . If multiple .IR arg s are required, pass each with a separate .B \-P option. . .I groff does not prefix an option dash to .I arg before passing it to the postprocessor. . . .TP .B \-R Run .MR \%refer 1 preprocessor. . No mechanism is provided for passing arguments to it; most .I \%refer options have equivalent language elements that can be specified within the document. . . .TP .B \-s Run .MR \%soelim 1 preprocessor. . . .TP .B \-S Enable safer mode and ignore any subsequent .B \-U option. . .I groff passes the .B \-S option to .MR \%pic 1 and .MR \%troff 1 . . . .TP .B \-t Run .MR \%tbl 1 preprocessor. . . .TP .BI \-T\~ dev Prepare output for device .I dev. . .I groff passes the .B \-T option and its argument to .IR \%troff , then (unless the .B \-Z option is used) runs an output driver to convert .IR \%troff 's output to a form appropriate for .IR dev ; see subsection \[lq]Output devices\[rq] below. . . .TP .B \-U Operate in unsafe mode. . .I groff passes the .B \-U option to .MR \%pic 1 and .MR \%troff 1 . . . .TP .B \%\-\-version .TQ .B \-v Write version information for .I groff and all programs run by it to the standard output stream; that is, the given command line is processed in the usual way, passing .B \-v to the formatter and any pre- or postprocessors invoked. . . .TP .B \-V Output the pipeline that .I groff would run to the standard output stream and exit. . If given more than once, .I groff both writes the pipeline to the standard error stream and runs it. . . .TP .B \-X Use .MR gxditview 1 instead of the usual postprocessor to (pre)view a document on an X11 display. . Combining this option with .RB \[lq] "\-T ps" \[rq] uses the font metrics of the PostScript device, whereas the .RB \[lq] "\-T X75" \[rq], .RB \[lq] "\-T X75\-12" \[rq] .RB \[lq] "\-T X100" \[rq], and .RB \[lq] "\-T X100\-12" \[rq] options use the metrics of X11 fonts. . . .TP .B \-Z Disable postprocessing. . .I \%troff output appears on the standard output stream (unless suppressed with .BR \-z ); see .MR groff_out 5 for a description of this format. . . .\" ==================================================================== .SS "Transparent options" .\" ==================================================================== . The following options are passed as-is to the formatter program .MR \%troff 1 and described in more detail in its man page. . . .TP 9n \" "-m mac" + 2n + hand-tuned for PDF .B \-a Generate a plain text approximation of the typeset output. . . .TP .B \-b Write a backtrace to the standard error stream on each error or warning. . . .TP .B \-c Start with color output disabled. . . .TP .B \-C Enable AT&T .I troff \" AT&T compatibility mode; implies .BR \-c . . . .TP .BI \-d\~ ctext .TQ .BI \-d\~ string = text Define string. . . .TP .B \-E Inhibit .I \%troff error messages; implies .BR \-Ww . . . .TP .BI \-f\~ fam Set default font family. . . .TP .BI \-F\~ dir Search in directory .I dir for the selected output device's directory of device and font description files. . . .TP .B \-i Process standard input after the specified input files. . . .TP .BI \-I\~ dir Search .I dir for input files. . . .TP .BI \-m\~ mac Read macro package .I mac before input. . .I groff passes .B \-m options and their arguments to .MR \%eqn 1 , .MR grap 1 , and .MR \%grn 1 . . . .TP .BI \-M\~ dir Search directory .I dir for macro files. . .I groff passes .B \-M options and their arguments to .MR \%eqn 1 , .MR grap 1 , and .MR \%grn 1 . . . .TP .BI \-n\~ num Begin numbering pages at .I num. . . .TP .BI \-o\~ list Output only pages in .IR list . . . .TP .BI \-r\~ cnumeric-expression .TQ .BI \-r\~ register = numeric-expression Define register. . . .TP .B \-S Enable safer mode and ignore any subsequent .B \-U option. . . .TP .B \-U Operate in unsafe mode. . . .TP .BI \-w\~ cat .TQ .BI \-W\~ cat Enable and inhibit, respectively, warnings in category .I cat. . . .TP .B \-z Suppress formatted device-independent output of .IR \%troff . . . .\" ==================================================================== .SH Usage .\" ==================================================================== . The architecture of the GNU .I roff system follows that of other device-independent .I roff implementations, comprising preprocessors, macro packages, output drivers (or \[lq]postprocessors\[rq]), and a suite of utilities, with the formatter program .MR \%troff 1 at its heart. . See .MR roff 7 for a survey of how a .I roff system works. . . .P The front end programs available in the GNU .I roff system make it easier to use than traditional .IR roff s that required the construction of pipelines or use of temporary files to carry a source document from maintainable form to device-ready output. . The discussion below summarizes the constituent parts of the GNU .I roff system. . It complements .MR roff 7 with .IR groff -specific information. . . .\" ==================================================================== .SS "Getting started" .\" ==================================================================== . Those who prefer to learn by experimenting or are desirous of rapid feedback from the system may wish to start with a \[lq]Hello, world!\&\[rq] document. . . .P .EX $ \c .B echo \[dq]Hello, world!\[dq] | groff \-Tascii \ | sed \[aq]/\[ha]$/d\[aq] Hello, world! .EE . . .P We used a .MR sed 1 command only to eliminate the 65 blank lines that would otherwise flood the terminal screen. . .RI ( roff systems were developed in the days of paper-based terminals with 66 lines to a page.) . . .P Today's users may prefer output to a UTF-8-capable terminal. . . .P .EX $ \c .B echo \[dq]Hello, world!\[dq] | groff \-Tutf8 \ | sed \[aq]/\[ha]$/d\[aq] .EE . . .P Producing PDF, HTML, or \*[TeX]'s DVI is also straightforward. . The hard part may be selecting a viewer program for the output. . . .P .EX $ \c .B echo \[dq]Hello, world!\[dq] | groff \-Tpdf > hello.pdf $ \c .B evince hello.pdf $ \c .B echo \[dq]Hello, world!\[dq] | groff \-Thtml > hello.html $ \c .B firefox hello.html $ \c .B echo \[dq]Hello, world!\[dq] | groff \-Tdvi > hello.dvi $ \c .B xdvi hello.dvi .EE . . .\" ==================================================================== .SS "Using \f[I]groff\f[] as a REPL" .\" ==================================================================== . Those with a programmer's bent may be pleased to know that they can use .I groff in a read-evaluate-print loop (REPL). . Doing so can be handy to verify one's understanding of the formatter's behavior and/or the syntax it accepts. . Turning on all warnings with .B \-ww can aid this goal. . . .P .EX $ \c .B groff \-ww \-Tutf8 .B \[rs]# This is a comment. Let\[aq]s define a register. .B .nr a 1 .B \[rs]# Do integer arithmetic with operators evaluated left-to-right. .B .nr b \[rs]n[a]+5/2 .ne 2v .B \[rs]# Let\[aq]s get the result on the standard error stream. .B .tm \[rs]n[b] 3 .B \[rs]# Now we\[aq]ll define a string. .B .ds name Leslie\[rs]" This is another form of comment. .B .nr b (\[rs]n[a] + (7/2)) .B \[rs]# Center the next two text input lines. .B .ce 2 .B Hi, \[rs]*[name]. .B Your secret number is \[rs]n[b]. .B \[rs]# We will see that the division rounded toward zero. .B It is .B \[rs]# Here\[aq]s an if-else control structure. .B .ie (\[rs]n[b] % 2) odd. .B .el even. .B \[rs]# This trick sets the page length to the current vertical .B \[rs]# position, so that blank lines don\[aq]t spew when we\[aq]re \ done. .B .pl \[rs]n[nl]u .I Hi, Leslie. Your secret number is 4. It is even. .EE . . .\" ==================================================================== .SS "Paper format" .\" ==================================================================== . .\" BEGIN Keep parallel with groff.texi node "Paper Format". The formatter reads the device description file .I DESC for the selected output device when it starts; page dimensions declared there are used if present. . .IR groff 's build process configures a default page format and writes it to typesetters' .I DESC files. . This installation defaults to .RB \[lq] \%A4 \[rq]. . If the .I DESC file lacks this information, the formatter and output driver use a page length of .BR \[lq] 11i \[rq] (eleven inches) for compatibility with AT&T .IR troff . \" AT&T . See .MR groff_font 5 . . . .P In the formatter, the .B pl request changes the page length, but macro packages often do not support alteration of the paper format within a document. . One might, for instance, want to switch between portrait and landscape orientations. . Macro packages lack a consistent approach to configuration of parameters dependent on the paper format; some, like .IR ms , benefit from a preamble in the document prior to the first macro call, while others, like .IR mm , instead require the specification of registers on the command line, or otherwise before its macro file is interpreted, to configure page dimensions. . . .P Output drivers for typesetters also recognize command-line options .B \-p to override the default page dimensions and .B \-l to use landscape orientation. . The output driver's man page, such as .MR grops 1 , may be helpful. . . .P .IR groff 's .RB \[lq] "\-d \%paper" \[rq] command-line option is a convenient means of setting the paper format; see .MR groff_tmac 5 . . Combine it with appropriate .B \-P options for the output driver, overriding its defaults. . The following command formats for PostScript on A4 paper in landscape orientation. . . .P .RS .EX $ \c .B "groff \-T ps \-d paper=a4l \-P \-pa4 \-P \-l \-ms my.ms >my.ps" .EE .RE .\" END Keep parallel with groff.texi node "Paper Format". . . .\" ==================================================================== .SS "Front end" .\" ==================================================================== . The .I groff program wraps .MR \%troff 1 , allowing one to specify preprocessors via command-line options and running the appropriate output driver for the selected output device. . This convenience avoids the manual construction of pipelines or management of temporary files required of users of traditional .MR roff 7 systems. . Use .MR grog 1 to infer an appropriate .I groff command line to format a document. . . .\" ==================================================================== .SS Language .\" ==================================================================== . Input to a .I roff system is in plain text interleaved with control lines and escape sequences. . The combination constitutes a document in one of a family of languages we also call .IR roff ; see .MR roff 7 for background. . An overview of GNU .I roff language syntax and features, including lists of all supported escape sequences, requests, and predefined registers, can be found in .MR groff 7 . . GNU .I roff extensions to the AT&T .I troff \" AT&T language, a common subset of .I roff dialects extant today, are detailed in .MR groff_diff 7 . . . .\" ==================================================================== .SS Preprocessors .\" ==================================================================== . A preprocessor interprets a domain-specific language that produces .I roff language output. . Frequently, such input is confined to sections or regions of .I roff input (bracketed with macro calls specific to each preprocessor), which it replaces. . Preprocessors therefore often interpret a subset of .I roff syntax along with their own language. . GNU .I roff provides reimplementations of most preprocessors familiar to users of AT&T .IR troff ; \" AT&T these routinely have extended features and/or require GNU .I troff \" GNU to format their output. . . .br .ne 10v .P .RS .TS tab($); Li Lx. \%tbl$lays out tables; \%eqn$typesets mathematics; \%pic$draws diagrams; \%refer$processes bibliographic references; \%soelim$preprocesses \[lq]sourced\[rq] input files; \%grn$T{ renders .MR gremlin 1 diagrams; T} \%chem$T{ draws chemical structural formul\[ae] using .IR pic ; \" generic T} gperl$T{ populates .I groff registers and strings using .MR perl 1 ; T} glilypond$T{ embeds .I LilyPond sheet music; and T} gpinyin$T{ eases Mandarin Chinese input using Hanyu Pinyin. T} .TE .RE . . .P A preprocessor unique to GNU .I roff is .MR preconv 1 , which converts various input encodings to something GNU .I troff \" GNU can understand. . When used, it is run before any other preprocessors. . . .P Most preprocessors enclose content between a pair of characteristic tokens. . Such a token must occur at the beginning of an input line and use the dot control character. . Spaces and tabs must not follow the control character or precede the end of the input line. . Deviating from these rules defeats a token's recognition by the preprocessor. . Tokens are generally preserved in preprocessor output and interpreted as macro calls subsequently by .IR \%troff . . The .I \%ideal preprocessor is not yet available in .IR groff . . . .P .TS box center tab(^); C | C | C CfI | Cf(CR) | Cf(CR). preprocessor^starting token^ending token = \%chem^.cstart^.cend \%eqn^.EQ^.EN grap^.G1^.G2 \%grn^.GS^.GE .\" Keep the .IF line below the \%ideal line. \%ideal^.IS^.IE ^^.IF .\" Keep the .PF line below the \%pic line. \%pic^.PS^.PE ^^.PF ^^.PY \%refer^.R1^.R2 \%tbl^.TS^.TE _ glilypond^.lilypond start^.lilypond stop gperl^.Perl start^.Perl stop gpinyin^.pinyin start^.pinyin stop .TE . . .\" ==================================================================== .SS "Macro packages" .\" ==================================================================== . Macro files are .I roff input files designed to produce no output themselves but instead ease the preparation of other .I roff documents. . When a macro file is installed at a standard location and suitable for use by a general audience, it is termed a .IR "macro package" . . . .br .ne 2v .P The .BR \-m \~option loads a macro package prior to any .I roff input documents, and after performing any string and register assignments directed by .B \-d and .B \-r options. . The GNU .I roff system implements most well-known macro packages for AT&T .I troff \" AT&T .\" exceptions: mpm, mv in a compatible way and extends them. . These have one- or two-letter names arising from intense practices of naming economy in early Unix culture, a laconic approach that led to many of the packages being identified in general usage with the .I nroff and .I troff option letter used to invoke them, sometimes to punning effect, as with \[lq]man\[rq] (short for \[lq]manual\[rq]), and even with the option dash, as in the case of the .I s package, much better known as .I ms or even .IR \-ms . . . .P Macro packages serve a variety of purposes. . Some are \[lq]full-service\[rq] packages, adopting responsibility for page layout among other fundamental tasks, and defining their own lexicon of macros for document composition; each such package stands alone and a given document can use at most one. . . .TP .I an is used to compose man pages in the format originating in Version\~7 Unix (1979); see .MR groff_man 7 . . It can be specified on the command line as .BR \-man . . . .TP .I doc is used to compose man pages in the format originating in 4.3BSD-Reno (1990); see .MR groff_mdoc 7 . . It can be specified on the command line as .BR \-mdoc . . . .TP .I e is the Berkeley general-purpose macro suite, developed as an alternative to AT&T's .IR s ; see .MR groff_me 7 . . It can be specified on the command line as .BR \-me . . . .TP .I m implements the format used by the second-generation AT&T macro suite for general documents, a successor to .IR s ; see .MR groff_mm 7 . . It can be specified on the command line as .BR \-mm . . . .TP .I om (invariably called \[lq]mom\[rq]) is a modern package written by Peter Schaffter specifically for GNU .IR roff . . Consult the .UR file://\:/usr/\:\%share/\:\%doc/\:\%groff\-1.24.1/\:\%html/\:mom/\:toc\:.html .I mom HTML manual .UE for extensive documentation. . She\[em]for .I mom takes the female pronoun\[em]can be specified on the command line as .BR \-mom . . . .TP .I s is the original AT&T general-purpose document format; see .MR groff_ms 7 . . It can be specified on the command line as .BR \-ms . . . .P Others are supplemental. . For instance, . .I \%andoc is a wrapper package specific to GNU .I roff that recognizes whether a document uses .I man or .I mdoc format and loads the corresponding macro package. . It can be specified on the command line as .BR \%\-mandoc . . A .MR man 1 librarian \" such as man-db, since 2001 may use this macro file to delegate loading of the correct macro package; it is thus unnecessary for .I man itself to scan the contents of a document to decide the issue. . . .P Many macro files augment the function of the full-service packages, or of .I roff documents that do not employ such a package\[em]the latter are sometimes characterized as \[lq]raw\[rq]. . These auxiliary packages are described, along with details of macro file naming and placement, in .MR groff_tmac 5 . . . .\" ==================================================================== .SS Formatters .\" ==================================================================== . The formatter, the program that interprets .I roff language input, is .MR \%troff 1 . . It provides the features of the AT&T .I troff \" AT&T and .I nroff \" AT&T programs as well as many extensions. . The command-line option .B \-C switches .I \%troff into .IR "compatibility mode" , which tries to emulate AT&T .I troff \" AT&T as closely as is practical to enable the formatting of documents written for the older system. . . .P A shell script, .MR \%nroff 1 , emulates the behavior of AT&T .IR nroff . \" AT&T . It attempts to correctly encode the output based on the locale, relieving the user of the need to specify an output device with the .B \-T option and is therefore convenient for use with terminal output devices, described in the next subsection. . . .P GNU .I troff \" GNU generates output in a device-independent, but not device-agnostic, page description language detailed in .MR groff_out 5 . . . .\" ==================================================================== .SS "Output devices" .\" ==================================================================== . .I \%troff output is formatted for a particular .IR "output device" , typically specified by the .B \-T option to the formatter or a front end. . If neither this option nor the .I \%GROFF_TYPESETTER environment variable is used, the default output device is .BR \%ps . . An output device may be any of the following. . . .TP 10n \" "X100\-12" + 2n + hand-tuned for PDF .B ascii for terminals using the ISO 646 1991:IRV character set and encoding, also known as US-ASCII. . . .TP .B dvi for TeX DVI format. . . .TP .B html .TQ .B xhtml for HTML and XHTML output, respectively. . . .TP .B latin1 for terminals using the ISO\~Latin-1 (8859-1) character set and encoding. . . .TP .B lbp for Canon CaPSL printers (LBP-4 and LBP-8 series laser printers). . . .TP .B lj4 for HP LaserJet4-compatible (or other PCL5-compatible) printers. . . .TP .B pdf for PDF output. . . .TP .B ps for PostScript output. . . .TP .B utf8 for terminals using the ISO 10646 (\[lq]Unicode\[rq]) character set in UTF-8 encoding. . . .TP .B X75 for previewing with .I \%gxditview using 75 dpi resolution and a 10-point base type size. . . .TP .B X75\-12 for previewing with .I \%gxditview using 75 dpi resolution and a 12-point base type size. . . .TP .B X100 for previewing with .I \%gxditview using 100 dpi resolution and a 10-point base type size. . . .TP .B X100\-12 for previewing with .I \%gxditview using 100 dpi resolution and a 12-point base type size. . . .\" ==================================================================== .SS Postprocessors .\" ==================================================================== . Any program that interprets the output of GNU .I troff \" GNU is a postprocessor. . The postprocessors provided by GNU .I roff are .IR "output drivers" , which prepare a document for viewing or printing. . Postprocessors for other purposes, such as page resequencing or statistical measurement of a document, are conceivable. . . .P An output driver supports one or more output devices, each with its own device description file. . A device determines its postprocessor with the .B postpro directive in its device description file; see .MR groff_font 5 . . The .B \-X option overrides this selection, causing .I \%gxditview to serve as the output driver. . . .TP .MR grodvi 1 provides .BR dvi . . . .TP .MR grohtml 1 provides .B html and .BR xhtml . . . .TP .MR grolbp 1 provides .BR lbp . . . .TP .MR grolj4 1 provides .BR lj4 . . . .TP .MR gropdf 1 provides .BR pdf . . . .TP .MR grops 1 provides .BR ps . . . .TP .MR grotty 1 provides .BR ascii , .BR latin1 , and .BR utf8 . . . .TP .MR gxditview 1 provides .BR X75 , .BR X75\-12 , .BR X100 , and .BR X100\-12 , and additionally can preview .BR ps . . . .\" ==================================================================== .SS Utilities .\" ==================================================================== . GNU .I roff includes a suite of utilities. . . .TP .MR gdiffmk 1 marks differences between a pair of .I roff input files. . . .TP .MR grog 1 infers the .I groff command a document requires. . . .P Several utilities prepare descriptions of fonts, enabling the formatter to use them when producing output for a given device. . . .TP .MR addftinfo 1 adds information to AT&T .I troff \" AT&T font description files to enable their use with GNU .IR troff .\" GNU . . .TP .MR afmtodit 1 creates font description files for PostScript Type\~1 fonts. . . .TP .MR pfbtops 1 translates a PostScript Type\~1 font in PFB (Printer Font Binary) format to PFA (Printer Font ASCII), which can then be interpreted by .IR \%afmtodit . . . .TP .MR hpftodit 1 creates font description files for the HP LaserJet\~4 family of printers. . . .TP .MR tfmtodit 1 creates font description files for the TeX DVI device. . . .TP .MR xtotroff 1 creates font description files for X Window System core fonts. . . .P A trio of tools transform material constructed using .I roff preprocessor languages into graphical image files. . . .TP .MR eqn2graph 1 converts an .I eqn equation into a cropped image. . . .TP .MR grap2graph 1 converts a .I grap diagram into a cropped image. . . .TP .MR pic2graph 1 converts a .I pic diagram into a cropped image. . . .P Another set of programs works with the bibliographic data files used by the .MR \%refer 1 preprocessor. . . .TP .MR \%indxbib 1 makes inverted indices for bibliographic databases, speeding lookup operations on them. . . .TP .MR lkbib 1 searches the databases. . . .TP .MR \%lookbib 1 interactively searches the databases. . . .\" ==================================================================== .SH "Exit status" .\" ==================================================================== . .I groff exits successfully (with .RB status\~ 0 ) if either of the options .B \-h or .B \-\-help is specified, .RB status\~ 2 if the program cannot interpret its command-line arguments, and .RB status\~ 1 if it encounters an error during operation. . Otherwise, .I groff runs a pipeline to process its input; if all commands within the pipeline exit successfully, .I groff does likewise. . If not, .IR groff 's exit status encodes a summary of problems encountered, setting bit\~2 if a command exited with a failure status, bit\~3 if a command was terminated with a signal, and bit\~4 if a command could not be executed. . (Thus, if all three misfortunes befall one's pipeline, .I groff exits with status 2\[ha]2 + 2\[ha]3 + 2\[ha]4 = 4+8+16 = 28.) . To troubleshoot pipeline problems, re-run the .I groff command with the .B \-V option and break the reported pipeline down into separate stages, inspecting the exit status of, and diagnostic messages emitted by, each command. . . .\" ==================================================================== .SH Environment .\" ==================================================================== . Environment variables in the host system affect the behavior of programs supplied by .I groff as follows. . Normally, the path separator in environment variables ending with .I PATH is the colon; this may vary depending on the operating system. . For example, Windows uses a semicolon instead. . . .TP .I GROFF_BIN_PATH Locate .I groff \" system commands in these directories, followed by those in .IR PATH . . If not set, the installation directory of GNU .I roff executables, .IR /usr/\:\%bin , is searched before .IR PATH . . . .TP .I GROFF_COMMAND_PREFIX Apply a prefix to certain GNU .I roff commands. . .I groff can be configured at compile time to apply a prefix to the names of programs it provides that had counterparts in AT&T .IR troff , \" AT&T so that name collisions are avoided at run time. . The default prefix is empty. . . .IP When used, this prefix is conventionally the letter \[lq]g\[rq]. . For example, GNU .I troff \" GNU would be installed as .IR gtroff . . Besides .IR troff , \" generic the prefix applies to the formatter wrapper .IR nroff ; \" generic (but not a wrapper in AT&T troff) the preprocessors .IR eqn , \" generic .IR grn , \" generic .IR pic , \" generic .IR \%refer , \" generic .IR tbl , \" generic and .IR \%soelim ; \" generic and the utilities .I \%indxbib \" generic and .IR \%lookbib . \" generic . . .TP .I GROFF_ENCODING Specify the assumed character encoding of the input. . .I groff passes its value as an argument to .IR preconv (1) preprocessor's .B \-e option. . This variable's existence implies the .I groff option .BR \-k . . If set but empty, .I groff runs .I preconv without an .B \-e option. . .IR groff 's .B \-K option overrides .IR \%GROFF_ENCODING . . . .TP .I GROFF_FONT_PATH Seek the selected output device's directory of device and font description files in this list of directories. . See .MR \%troff 1 and .MR groff_font 5 . . . .TP .I GROFF_TMAC_PATH Seek macro packages in this list of directories. . See .MR \%troff 1 and .MR groff_tmac 5 . . . .TP .I GROFF_TMPDIR Create temporary files in this directory. . If not set, but .I \%TMPDIR is, the latter is used instead. . On Windows systems, if neither of the foregoing are set, the environment variables .I TMP and .I TEMP (in that order) are checked also. . Otherwise, temporary files are created in .IR /tmp . . The .MR \%refer 1 , .MR grohtml 1 , and .MR grops 1 commands use temporary files. . . .TP .I GROFF_TYPESETTER Set the default output device. . If empty or not set, .B \%ps is used. . The .B \-T option overrides .IR \%GROFF_TYPESETTER . . . .TP .I SOURCE_DATE_EPOCH Declare a time stamp (expressed as seconds since the Unix epoch) to use as the output creation time stamp in place of the current time. . The time is converted to human-readable form using .MR gmtime 3 and .MR asctime 3 when the formatter starts up and stored in registers usable by documents and macro packages. . . .TP .I TZ Declare the time zone to use when converting the current time to human-readable form; see .MR tzset 3 . . If .I SOURCE_DATE_EPOCH is used, it is always converted to human-readable form using UTC. . . .\" ==================================================================== .SH Examples .\" ==================================================================== . .\" BEGIN Keep parallel with groff.texi node "Invocation Examples". .I roff systems are best known for formatting man pages. . A .MR man 1 librarian program, having located a page, might render it with a .I groff command. . .RS .EX groff \-t \-man \-Tutf8 /usr/share/man/man1/groff.1 .EE .RE . The librarian will also pipe the output through a pager, which might not interpret terminal escape sequences .I groff emits for boldface, underlining, italics, or hyperlinking; see section \[lq]Limitations\[rq] below. . . .P To process a .I roff input file using the preprocessors .I \%tbl and .I \%pic and the .I me macro package in the way to which AT&T .I troff \" AT&T users were accustomed, one would type (or script) a pipeline. . . .IP .EX \%pic foo.me | \%tbl | \%troff \-me \-Tutf8 | grotty .EE . . .P Shorten this pipeline to an equivalent command using .IR groff . . . .IP .EX groff \-p \-t \-me \-T utf8 foo.me .EE . . .P An even easier way to do this is to use .MR grog 1 to guess the preprocessor and macro options and execute the result by using the command substitution feature of the shell. . .IP .EX $(grog \-Tutf8 foo.me) .EE . . .P Each command-line option to a postprocessor must be specified with any required leading dashes .RB \[lq] \- \[rq] .\" No GNU roff postprocessor uses long options for anything except .\" --help or --version. .\"or .\".RB \[lq] \-\- \[rq] .\" XXX: grolbp does. because .I groff passes the arguments as-is to the postprocessor; this permits arbitrary arguments to be transmitted. . For example, to pass a title to the .I gxditview postprocessor, the shell commands . .RS .EX groff \-X \-P \-title \-P \[aq]trial run\[aq] mydoc.t .EE .RE . and . .RS .EX groff \-X \-Z mydoc.t | gxditview \-title \[aq]trial run\[aq] \- .EE .RE . are equivalent. .\" END Keep parallel with groff.texi node "Invocation Examples". . . .\" ==================================================================== .SH Limitations .\" ==================================================================== . When paging output for the .BR ascii , .BR latin1 , and .B utf8 devices, programs like .MR more 1 and .MR less 1 may require command-line options to correctly handle some terminal escape sequences; see .MR grotty 1 . . . .\" ==================================================================== .SH "Installation directories" .\" ==================================================================== . GNU .I roff installs files in varying locations depending on its compile-time configuration. . On this installation, the following locations are used. . . .if !'/usr/\:\%lib/\:\%X11/\:\%app\-defaults'' \{\ .TP .I /usr/\:\%lib/\:\%X11/\:\%app\-defaults Application defaults directory for .MR gxditview 1 . .\} . . .TP .I /usr/\:\%bin Directory containing .IR groff 's executable commands. . . .TP .I /usr/\:\%share/\:\%groff/\:\%1.24.1/\:\%eign List of common words for .MR \%indxbib 1 . . . .TP .I /usr/\:\%share/\:\%groff/\:\%1.24.1 Directory for data files. . . .TP .I /usr/\:\%dict/\:\%papers/\:\%Ind Default index for .MR lkbib 1 and .MR \%refer 1 . . . .TP .I /usr/\:\%share/\:\%doc/\:\%groff\-1.24.1 Documentation directory. . . .TP .I /usr/\:\%share/\:\%doc/\:\%groff\-1.24.1/\:\%examples Example directory. . . .TP .I /usr/\:\%share/\:\%groff/\:\%1.24.1/\:\%font Font directory. . . .TP .I /usr/\:\%share/\:\%doc/\:\%groff\-1.24.1/\:\%html HTML documentation directory. . . .TP .I /usr/\:\%lib/\:\%font Legacy font directory. . . .TP .I /usr/\:\%share/\:\%groff/\:\%site\-font Local font directory. . . .TP .I /usr/\:\%share/\:\%groff/\:\%site\-tmac Local macro package .RI ( tmac file) directory. . . .TP .I /usr/\:\%share/\:\%groff/\:\%1.24.1/\:\%tmac Macro package .RI ( tmac file) directory. . . .TP .I /usr/\:\%share/\:\%groff/\:\%1.24.1/\:\%oldfont Font directory for compatibility with old versions of .IR groff ; see .MR grops 1 . . . .TP .I /usr/\:\%share/\:\%doc/\:\%groff\-1.24.1/\:\%pdf PDF documentation directory. . . .if !'no'no' \{\ .TP .I /usr/\:\%lib/\:\%groff/\:\%site\-tmac System macro package .RI ( tmac file) directory. .\} . . .\" ==================================================================== .SS "\f[I]groff\f[] macro directory" .\" ==================================================================== . Most macro files supplied with GNU .I roff are stored in .I /usr/\:\%share/\:\%groff/\:\%1.24.1/\:\%tmac for the installation corresponding to this document. . As a rule, multiple directories are searched for macro files; see .MR \%troff 1 . . For a catalog of macro files GNU .I roff provides, see .MR groff_tmac 5 . . . .\" ==================================================================== .SS "\f[I]groff\f[] device and font description directory" .\" ==================================================================== . Device and font description files supplied with GNU .I roff are stored in .I /usr/\:\%share/\:\%groff/\:\%1.24.1/\:\%font for the installation corresponding to this document. . As a rule, multiple directories are searched for device and font description files; see .MR \%troff 1 . . For the formats of these files, see .MR groff_font 5 . . . .\" ==================================================================== .SH Availability .\" ==================================================================== . Obtain links to .I groff releases for download, its source repository, discussion mailing lists, a support ticket tracker, and further information from the .UR http://\:www\:.gnu\:.org/\:software/\:groff .I groff page of the GNU website .UE . . . .P A free implementation of the .I grap preprocessor, written by .MT faber@\:lunabase\:.org Ted Faber .ME , can be found at the .UR http://\:www\:.lunabase\:.org/\:\[ti]faber/\:Vault/\:software/\ \:grap/ .I grap website .UE . . .I groff supports only this .IR grap . . . .\" ==================================================================== .SH Authors .\" ==================================================================== . .I groff (both the front-end command and the overall system) was primarily written by .MT jjc@\:jclark\:.com James Clark .ME . . Contributors to this document include Clark, Trent A.\& Fisher, .MT wl@gnu.org Werner Lemberg .ME , .MT groff\-bernd.warken\-72@\:web\:.de Bernd Warken .ME , and .MT g.branden\:.robinson@\:gmail\:.com G.\& Branden Robinson .ME . . . .\" ==================================================================== .SH "See also" .\" ==================================================================== . .IR "Groff: The GNU Implementation of troff" , by Trent A.\& Fisher and Werner Lemberg, is the primary .I groff manual. . You can browse it interactively with \[lq]info groff\[rq]. . . .P A list of all .I groff man pages follows. . A few .RI ( \%grohtml , .IR gropdf , .IR gxditview , and .IR xtotroff ) will be unavailable if their corresponding programs were disabled during compilation. . . .\" groff ships 59 man pages generated from 58 source files. The .\" numbered comments refer to their sorting order in the source tree, .\" so that it is easier to tell that we've enumerated all of them. .TP Introduction, \c history, \c and further reading: .MR roff 7 \" #23 . . .TP .RI "Viewer for\~" groff "\~(and AT&T device-independent\~" troff \ )\~documents: .MR gxditview 1 \" #33 . . .TP Preprocessors: .MR \%chem 1 , \" #1 .MR \%eqn 1 , \" #34 .MR \%neqn 1 , \" #35 .MR glilypond 1 , \" #4 .MR \%grn 1 , \" #36 .MR preconv 1 , \" #38 .MR gperl 1 , \" #5 .MR \%pic 1 , \" #37 .MR gpinyin 1 , \" #6 .MR \%refer 1 , \" #39 .MR \%soelim 1 , \" #40 .MR \%tbl 1 \" #41 . . .TP Macro packages: .MR groff_hdtbl 7 , \" #9 .MR groff_man 7 , \" #55a .MR groff_man_style 7 , \" #55b .MR groff_mdoc 7 , \" #56 .MR groff_me 7 , \" #57 .MR groff_mm 7 , \" # 10 .MR groff_mmse 7 , \" # 11 .MR groff_mom 7 , \" #13 .MR groff_ms 7 , \" #58 .MR groff_rfc1345 7 , \" 16 .MR groff_trace 7 , \" #59 .MR groff_www 7 \" #60 . . .TP Bibliographic database management tools: .MR \%indxbib 1 , \" #49 .MR lkbib 1 , \" #50 .MR \%lookbib 1 \" #51 . . .TP Language, \c conventions, \c and GNU extensions: .MR groff 7 , \" #17 .MR groff_char 7 , \" #18 .MR groff_diff 7 , \" #19 .MR groff_font 5 , \" #20 .MR groff_tmac 5 \" #22 . . .TP Device-independent page description language: .MR groff_out 5 \" #21 . . .TP Formatter program: .MR \%troff 1 \" #45 . . .TP Formatter wrappers: .\".MR groff 1 , \" 42 -- this page .MR \%nroff 1 , \" #44 .MR mmroff 1 , \" #12 .MR pdfmom 1 \" #30 .\" MR pdfroff 1 \" formerly #14 . . .TP Postprocessors for output devices: .MR grodvi 1 , \" #24 .MR grohtml 1 , \" #25 .MR grolbp 1 , \" #26 .MR grolj4 1 , \" #27 .MR gropdf 1 , \" #29 .MR grops 1 , \" #31 .MR grotty 1 \" #32 . . .TP Font support utilities: .MR addftinfo 1 , \" #46 .MR afmtodit 1 , \" #47 .MR hpftodit 1 , \" #48 .MR pfbtops 1 , \" #52 .MR tfmtodit 1 , \" #53 .MR xtotroff 1 \" #54 . . .TP Graphics conversion utilities: .MR eqn2graph 1 , \" #2 .MR grap2graph 1 , \" #7 .MR pic2graph 1 \" #15 . . .TP Difference-marking utility: .MR gdiffmk 1 \" #3 . . .TP \[lq]groff guess\[rq] utility: .MR grog 1 \" #43 . . .\" Restore compatibility mode (for, e.g., Solaris 10/11). .cp \n[*groff_groff_1_man_C] .do rr *groff_groff_1_man_C . . .\" Local Variables: .\" fill-column: 72 .\" mode: nroff .\" End: .\" vim: set filetype=groff textwidth=72: