man-pages/man1/troff.1.html
2021-03-31 01:06:50 +01:00

798 lines
15 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of TROFF</TITLE>
</HEAD><BODY>
<H1>TROFF</H1>
Section: User Commands (1)<BR>Updated: 21 March 2020<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
troff - the troff processor of the groff text formatting system
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
[ <B>-abcivzCERU</B> ]
[ <B>-d </B><I>cs</I> ]
[ <B>-f </B><I>fam</I> ]
[ <B>-F </B><I>dir</I> ]
[ <B>-I </B><I>dir</I> ]
[ <B>-m </B><I>name</I> ]
[ <B>-M </B><I>dir</I> ]
[ <B>-n </B><I>num</I> ]
[ <B>-o </B><I>list</I> ]
[ <B>-r </B><I>cn</I> ]
[ <B>-T </B><I>name</I> ]
[ <B>-w </B><I>name</I> ]
[ <B>-W </B><I>name</I> ]
[<I>file</I>
...]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This manual page describes the GNU version of
<B>troff</B>.
It is part of the groff document formatting system.
It is functionally compatible with Unix troff, but has many
extensions, see
<B><A HREF="/cgi-bin/man/man2html?7+groff_diff">groff_diff</A></B>(7).
Usually it should be invoked using the
<B><A HREF="/cgi-bin/man/man2html?1+groff">groff</A></B>(1)
command which will also run preprocessors and postprocessors in the
appropriate order and with the appropriate options.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
Whitespace is permitted between a command-line option and its argument.
<DL COMPACT>
<DT id="1"><B>-a</B>
<DD>
Generate an ASCII approximation of the typeset output.
<DT id="2"><B>-b</B>
<DD>
Print a backtrace with each warning or error message.
This backtrace should help track down the cause of the error.
The line numbers given in the backtrace may not always be correct, for
<B>troff</B>'s
idea of line numbers gets confused by
<B>as</B>
or
<B>am</B>
requests.
<DT id="3"><B>-c</B>
<DD>
Disable color output (always disabled in compatibility mode).
<DT id="4"><B>-C</B>
<DD>
Enable compatibility mode.
<DT id="5"><B>-d</B><I>cs</I>
<DD>
<B>-d</B><I>name</I><B>=</B><I>s</I>
Define
<I>c</I>
or
<I>name</I>
to be a string
<I>s</I>;
<I>c</I>
must be a one letter name.
<DT id="6"><B>-E</B>
<DD>
Inhibit all error messages of
<B>troff</B>.
Note that this doesn't affect messages output to standard error by
macro packages using the
<B>tm</B>
or
<B>tm1</B>
requests.
<DT id="7"><B>-f</B><I>fam</I>
<DD>
Use
<I>fam</I>
as the default font family.
<DT id="8"><B>-F</B><I>dir</I>
<DD>
Search in directory (or directory path)
<I>dir</I>
for subdirectories
<I>dev</I>name
(<I>name</I>
is the name of the device) and there for the
<I>DESC</I>
file and font files.
<I>dir</I>
is scanned before all other font directories.
<DT id="9"><B>-i</B>
<DD>
Read the standard input after all the named input files have been
processed.
<DT id="10"><B>-I</B><I>dir</I>
<DD>
This option may be used to add a directory to the search path for
files (both those on the command line and those named in
<B>.psbb</B>
requests).
The search path is initialized with the current directory.
This option may be specified more than once; the directories are then
searched in the order specified (but before the current directory).
If you want to make the current directory be read before other
directories, add
<B>-I.</B>
at the appropriate place.
<DT id="11"><DD>
No directory search is performed for files with an absolute file name.
<DT id="12"><B>-m</B><I>name</I>
<DD>
Read in the file
name<I>.tmac</I>.
If it isn't found, try
<I>tmac.</I>name
instead.
It will be first searched for in directories given with the
<B>-M</B>
command-line option, then in directories given in the
<I>GROFF_TMAC_PATH</I>
environment variable, then in the current directory (only if in unsafe
mode), the home directory,
<I>/usr/:lib/:groff/:site-tmac</I>,
<I>/usr/:share/:groff/:site-tmac</I>,
and
<I>/usr/:share/:groff/:1.22.4/:tmac</I>.
<DT id="13"><B>-M</B><I>dir</I>
<DD>
Search directory (or directory path)
<I>dir</I>
for macro files.
This is scanned before all other macro directories.
<DT id="14"><B>-n</B><I>num</I>
<DD>
Number the first page
<I>num</I>.
<DT id="15"><B>-o</B><I>list</I>
<DD>
Output only pages in
<I>list</I>,
which is a comma-separated list of page ranges;
<I>n</I>
means print page
<I>n</I>,
<I>m</I><B>-</B><I>n</I>
means print every page between
<I>m</I>
and
<I>n</I>,
<B>-</B><I>n</I>
means print every page up to
<I>n</I>,
<I>n</I><B>-</B>
means print every page from
<I>n</I>.
<B>troff</B>
will exit after printing the last page in the list.
<DT id="16"><B>-r</B><I>cn</I>
<DD>
<B>-r</B><I>name</I><B>=</B><I>n</I>
Set number register
<I>c</I>
or
<I>name</I>
to
<I>n</I>;
<I>c</I>
must be a one character name;
<I>n</I>
can be any troff numeric expression.
<DT id="17"><B>-R</B>
<DD>
Don't load
<I>troffrc</I>
and
<I>troffrc-end</I>.
<DT id="18"><B>-T</B><I>name</I>
<DD>
Prepare output for device
<I>name</I>,
rather than the default
<B>ps</B>;
see
<B><A HREF="/cgi-bin/man/man2html?1+groff">groff</A></B>(1)
for a more detailed description.
<DT id="19"><B>-U</B>
<DD>
Unsafe mode.
This will enable the following requests:
<B>open</B>,
<B>opena</B>,
<B>pso</B>,
<B>sy</B>,
and
<B>pi</B>.
For security reasons, these potentially dangerous requests are
disabled otherwise.
It will also add the current directory to the macro search path.
<DT id="20"><B>-v</B>
<DD>
Print the version number.
<DT id="21"><B>-w</B><I>name</I>
<DD>
Enable warning
<I>name</I>.
Available warnings are described in section "Warnings" below.
To enable most useful warnings use
<B>-w</B>
<B>all</B>.
To enable absolutely all warnings use
<B>-w w</B>
instead.
Multiple
<B>-w</B>
options are allowed.
<DT id="22"><B>-W</B><I>name</I>
<DD>
Inhibit warning
<I>name</I>.
Multiple
<B>-W</B>
options are allowed.
<DT id="23"><B>-z</B>
<DD>
Suppress formatted output.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>WARNINGS</H2>
The warnings that can be given by
<B>troff</B>
are divided into the following categories.
The name associated with each warning is used by the
<B>-w</B>
and
<B>-W</B>
options; the number is used by the
<B>warn</B>
request, and by the
<B>.warn</B>
register; it is always a power of 2 to allow bitwise composition.
<P>
<CENTER><TABLE BORDER><TR><TD><TABLE>
<TR VALIGN=top><TD ALIGN=center>Bit</TD><TD ALIGN=center>Code</TD><TD ALIGN=center>Warning</TD><TD ALIGN=center>Bit</TD><TD ALIGN=center>Code</TD><TD ALIGN=center>Warning<BR></TD></TR>
<TR VALIGN=top><TD COLSPAN=6><HR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>0</TD><TD ALIGN=right><I>1</I></TD><TD><B>char</B></TD><TD ALIGN=right>10</TD><TD ALIGN=right><I>1024</I></TD><TD><B>reg</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>1</TD><TD ALIGN=right><I>2</I></TD><TD><B>number</B></TD><TD ALIGN=right>11</TD><TD ALIGN=right><I>2048</I></TD><TD><B>tab</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>2</TD><TD ALIGN=right><I>4</I></TD><TD><B>break</B></TD><TD ALIGN=right>12</TD><TD ALIGN=right><I>4096</I></TD><TD><B>right-brace</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>3</TD><TD ALIGN=right><I>8</I></TD><TD><B>delim</B></TD><TD ALIGN=right>13</TD><TD ALIGN=right><I>8192</I></TD><TD><B>missing</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>4</TD><TD ALIGN=right><I>16</I></TD><TD><B>el</B></TD><TD ALIGN=right>14</TD><TD ALIGN=right><I>16384</I></TD><TD><B>input</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>5</TD><TD ALIGN=right><I>32</I></TD><TD><B>scale</B></TD><TD ALIGN=right>15</TD><TD ALIGN=right><I>32768</I></TD><TD><B>escape</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>6</TD><TD ALIGN=right><I>64</I></TD><TD><B>range</B></TD><TD ALIGN=right>16</TD><TD ALIGN=right><I>65536</I></TD><TD><B>space</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>7</TD><TD ALIGN=right><I>128</I></TD><TD><B>syntax</B></TD><TD ALIGN=right>17</TD><TD ALIGN=right><I>131072</I></TD><TD><B>font</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>8</TD><TD ALIGN=right><I>256</I></TD><TD><B>di</B></TD><TD ALIGN=right>18</TD><TD ALIGN=right><I>262144</I></TD><TD><B>ig</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right>9</TD><TD ALIGN=right><I>512</I></TD><TD><B>mac</B></TD><TD ALIGN=right>19</TD><TD ALIGN=right><I>524288</I></TD><TD><B>color</B><BR></TD></TR>
<TR VALIGN=top><TD ALIGN=right></TD><TD ALIGN=right><I></I></TD><TD><B></B></TD><TD ALIGN=right>20</TD><TD ALIGN=right><I>1048576</I></TD><TD><B>file</B><BR></TD></TR>
</TABLE></TABLE></CENTER>
<P>
<DL COMPACT>
<DT id="24"><B>break</B> 4
<DD>
In fill mode, lines which could not be broken so that their length was
less than the line length.
This is enabled by default.
<DT id="25"><B>char</B> 1
<DD>
Non-existent characters.
This is enabled by default.
<DT id="26"><B>color</B> 524288
<DD>
Color-related warnings.
<DT id="27"><B>delim</B> 8
<DD>
Missing or mismatched closing delimiters.
<DT id="28"><B>di</B> 256
<DD>
Use of
<B>di</B>
or
<B>da</B>
without an argument when there is no current diversion.
<DT id="29"><B>el</B> 16
<DD>
Use of the
<B>el</B>
request with no matching
<B>ie</B>
request.
<DT id="30"><B>escape</B> 32768
<DD>
Unrecognized escape sequences.
When an unrecognized escape sequence is encountered, the escape
character is ignored.
<DT id="31"><B>file</B> 1048576
<DD>
Indicates a missing file for the
<B>mso</B>
request.
Enabled by default.
<DT id="32"><B>font</B> 131072
<DD>
Non-existent fonts.
This is enabled by default.
<DT id="33"><B>ig</B> 262144
<DD>
Invalid escapes in text ignored with the
<B>ig</B>
request.
These are conditions that are errors when they do not occur in ignored
text.
<DT id="34"><B>input</B> 16384
<DD>
Invalid input characters.
<DT id="35"><B>mac</B> 512
<DD>
Use of undefined strings, macros and diversions.
When an undefined string, macro or diversion is used, that string is
automatically defined as empty.
So, in most cases, at most one warning will be given for each name.
<DT id="36"><B>missing</B> 8192
<DD>
Requests that are missing non-optional arguments.
<DT id="37"><B>number</B> 2
<DD>
Invalid numeric expressions.
This is enabled by default.
<DT id="38"><B>range</B> 64
<DD>
Out of range arguments.
<DT id="39"><B>reg</B> 1024
<DD>
Use of undefined number registers.
When an undefined number register is used, that register is
automatically defined to have a value of~0.
So, in most cases, at most one warning will be given for use of a
particular name.
<DT id="40"><B>right-brace</B> 4096
<DD>
Use of
<B>\}</B>
where a number was expected.
<DT id="41"><B>scale</B> 32
<DD>
Meaningless scaling indicators.
<DT id="42"><B>space</B> 65536
<DD>
Missing space between a request or macro and its argument.
This warning will be given when an undefined name longer than two
characters is encountered, and the first two characters of the name
make a defined name.
The request or macro will not be invoked.
When this warning is given, no macro is automatically defined.
This is enabled by default.
This warning will never occur in compatibility mode.
<DT id="43"><B>syntax</B> 128
<DD>
Dubious syntax in numeric expressions.
<DT id="44"><B>tab</B> 2048
<DD>
Inappropriate use of a tab character.
Either use of a tab character where a number was expected, or use of tab
character in an unquoted macro argument.
</DL>
<P>
There are also names that can be used to refer to groups of warnings:
<DL COMPACT>
<DT id="45"><B>all</B>
<DD>
All warnings except
<B>di</B>,
<B>mac</B>,
and
<B>reg</B>.
It is intended that this covers all warnings that are useful with
traditional macro packages.
<DT id="46"><B>w</B>
<DD>
All warnings.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>ENVIRONMENT</H2>
<DL COMPACT>
<DT id="47"><I>GROFF_TMAC_PATH</I>
<DD>
A colon separated list of directories in which to search for
macro files.
<B>troff</B>
will scan directories given in the
<B>-M</B>
option before these, and in standard directories (current directory if
in unsafe mode, home directory,
<I>/usr/:lib/:groff/:site-tmac</I>,
<I>/usr/:share/:groff/:site-tmac</I>,
<I>/usr/:share/:groff/:1.22.4/:tmac</I>)
after these.
<DT id="48"><I>GROFF_TYPESETTER</I>
<DD>
Default device.
<DT id="49"><I>GROFF_FONT_PATH</I>
<DD>
A colon separated list of directories in which to search for the
<I>dev</I>name
directory.
<B>troff</B>
will scan directories given in the
<B>-F</B>
option before these, and in standard directories
(<I>/usr/:share/:groff/:site-font</I>,
<I>/usr/:share/:groff/:1.22.4/:font</I>,
<I>/usr/:lib/:font</I>)
after these.
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>FILES</H2>
<DL COMPACT>
<DT id="50"><I>/usr/:share/:groff/:1.22.4/:tmac/troffrc</I>
<DD>
Initialization file (called before any other macro package).
<DT id="51"><I>/usr/:share/:groff/:1.22.4/:tmac/troffrc-end</I>
<DD>
Initialization file (called after any other macro package).
<DT id="52"><I>/usr/:share/:groff/:1.22.4/:tmac/</I>name<I>.tmac</I>
<DD>
<I>/usr/:share/:groff/:1.22.4/:tmac/tmac.</I>name
Macro files
<DT id="53"><I>/usr/:share/:groff/:1.22.4/:font/dev</I>name<I>/DESC</I>
<DD>
Device description file for device
<I>name</I>.
<DT id="54"><I>/usr/:share/:groff/:1.22.4/:font/dev</I>name<I>/</I>F
<DD>
Font file for font
<I>F</I>
of device
<I>name</I>.
</DL>
<P>
Note that
<I>troffrc</I>
and
<I>troffrc-end</I>
are searched for neither in the current nor the home directory by
default for security reasons (even if the
<B>-U</B>
option is given).
Use the
<B>-M</B>
command-line option or the
<I>GROFF_TMAC_PATH</I>
environment variable to add these directories to the search path if
necessary.
<A NAME="lbAI">&nbsp;</A>
<H2>AUTHORS</H2>
The GNU version of
<I>troff</I>
was originally written by James Clark;
he also wrote the original version of this document,
which was modified by
Werner Lemberg
and
Bernd Warken
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<DL COMPACT>
<DT id="55"><B><A HREF="/cgi-bin/man/man2html?1+groff">groff</A></B>(1)
<DD>
The main program of the
<I>groff</I>
system, a wrapper around
<I>troff</I>.
<DT id="56"><B><A HREF="/cgi-bin/man/man2html?7+groff">groff</A></B>(7)
<DD>
A description of the
<I>groff</I>
language, including a short but complete reference of all predefined
requests, registers, and escapes of plain
<I>groff</I>.
From the command line, this is called by
<DL COMPACT><DT id="57"><DD>
<DL COMPACT>
<DT id="58"><DD>
<B>man 7 groff</B>
</DL>
</DL>
<DT id="59"><B><A HREF="/cgi-bin/man/man2html?7+groff_diff">groff_diff</A></B>(7)
<DD>
The differences of the
<I>groff</I>
language and the
<I>classical troff</I>
language.
Currently, this is the most actual document of the
<I>groff</I>
system.
<DT id="60"><B><A HREF="/cgi-bin/man/man2html?7+roff">roff</A></B>(7)
<DD>
An overview over
<I>groff</I>
and other
<I>roff</I>
systems, including pointers to further related documentation.
</DL>
<P>
<I>Groff: The GNU Implementation of troff</I>,
by Trent A. Fisher and Werner Lemberg,
is the primary
<I>groff</I>
manual.
You can browse it interactively with "info groff".
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="61"><A HREF="#lbAB">NAME</A><DD>
<DT id="62"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="63"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="64"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="65"><A HREF="#lbAF">WARNINGS</A><DD>
<DT id="66"><A HREF="#lbAG">ENVIRONMENT</A><DD>
<DT id="67"><A HREF="#lbAH">FILES</A><DD>
<DT id="68"><A HREF="#lbAI">AUTHORS</A><DD>
<DT id="69"><A HREF="#lbAJ">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:28 GMT, March 31, 2021
</BODY>
</HTML>