title: groff_filenames(7)

summary: filename extensions for roff and groff

text:
# groff_filenames(7)

## NAME
groff_filenames — filename extensions for roff and groff

## DESCRIPTION
Since the evolution of roff in the 1970s, a whole bunch of filename extensions for roff files were used.

The roff extensions refer to preprocessors or macro packages. These extensions are fixed in all Unix-like operating systems.

Later on, groff added some more extensions. We will now write a man-page about these filename extensions.

## COMPRESSION OF ROFF FILES
Each roff file can be optionally compressed. That means that the total filename ends with a compressor name. So the whole filename has the structure <name>.<extension>[.<compression>].

Mostly known are the compressor extensions .Z, .gz, and .bzip2. Relatively new is .xz.

From now on, we will ignore the compressions and only comment the structure <name>.<extension>.

## MAN-PAGES
The Unix manual pages are shortly named man-pages. The man-page style is the best known part of the roff language.

The extensions for man should be better documented. So this is documented here.

Files written in the man language use the following extension: *.<section>[<group>].

### Man-page Sections
The traditional man-page <section> is a digit from 1 to 8.

<name>.1

<name>.2

<name>.3

<name>.4

<name>.5

<name>.6

<name>.7

<name>.8

Classic man-page sections.

Linux added the section number 9 for kernel man-pages.

<name>.9

Linux kernel man-pages

In older commercial Unix systems, the 3 characters l, n, and o were also used as section names. This is today deprecated, but there are still documents in this format.

<name>.l

<name>.n

<name>.o

Deprecated old man-page sections.

### Man-page Group Extensions
The <group> extension in .<section>[<group>] is optional, but it can be any string of word characters. Usually programmers use a group name that is already used, e.g. x for X Window System documents or tk to refer to the tk programming language.

Examples:

groff.1

is the man-page for groff in section 1 without a group

xargs.1posix.gz

is the man-page for the program xargs in section 1 and group posix; moreover it is compressed with gz (gzip).

config.5ssl

OpenSSL CONF library configuration files from section 5 with group ssl.

dpkg-reconfigure.8cdebconf

man-page for the program dpkg-reconfigure in section 8 and group cdebconf.

### Source of Man-pages
There are 2 roff languages for writing man-pages: man and mdoc.

The names of these 2 styles are taken as extensions for the source code files of man-pages in the groff package.

<name>.man

traditional Unix-like man-page format within groff source files.

<name>.n

A temporary man-page file produced from a name.man man-page by a run of make within the groff source package.

<name>.mdoc

Man-page format in BSD.

<name>.1b

Man-page format in heirloom roff .

<name>.mandoc

Files using this extension recognize both man-page formats in groff and other processors.

## TRADITIONAL TROFF EXTENSIONS

### Files Using Macro Packages
The classical roff languages were interpreted by the traditional troff and nroff programs.

There were several roff languages, each represented by a macro-package. Each of these provided a suitable file name extension:

<name>.me

roff file using the me macro package.

<name>.mm

roff file using the mm macro package

<name>.ms

roff file using the ms macro package

All of these classical roff languages and their extensions are still very active in groff.

### Source Code for Macro Packages (TMAC Files)
In traditional roff the source code for the macro packages was stored in TMAC files. Their file names have the form:

tmac.<package>,

<package> is the name of the macro package without the leading m character, which is reintegrated by the option -m.

For example, tmac.an is the source for the man macro package.

In the groff source, more suitable file names were integrated, see later on.

### Preprocessors
Moreover, the following preprocessors were used as filename extension:

<name>.chem

for the integration of chemical formulas

<name>.eqn

for the mathematical use of equations

<name>.pic

graphical tool

<name>.tbl

for tables with tbl

<name>.ref

for files using the prefer preprocessor

### Classical Roff Files
<name>.t

<name>.tr

for files using the roff language of any kind

## NEW GROFF EXTENSIONS
GNU roff groff is the actual roff standard, both for classical roff and new extensions. So even the used new extensions in the source code should be regarded as actual standard. The following extensions are used instead of classical .t or .tr:

<name>.groff

<name>.roff

general ending for files using the groff language

### Source Code for Macro Packages (TMAC Files)
As the classical form tmac.<package_without_m>, of the TMAC file names is quite strange, groff added the following structures:

<package_without_m>.tmac

m<package>.tmac

groff_m<package>.tmac

### Files Using new Macro Packages
Groff uses the following new macro packages:

<name>.mmse

file with swedish mm macros for groff

<name>.mom

files written in the groff macro package mom

<name>.www

files written in HTML-like groff macros.

### Preprocessors and Postprocessors
<name>.hdtbl

a new tbl format. See groff_hdtbl(7).

<name>.grap

files written for the graphical grap processor.

<name>.grn

for including gremlin(1), pictures, see grn(1).

<name>.pdfroff

transform this file with pdfroff of the groff system

## SEE ALSO
History and future

roff(7), man-pages(7), groff_diff(7), groff(7)

Compression

uncompress(1posix), gzip2(1), bzip2(1), xz(1)

A man-page of the naming form name(n) can be read in text mode by

```
man n name
```

or in graphical mode (PDF) by

```
groffer n name
```

Gunnar Ritter's Heirloom roff project. You can get this package with the shell command:

```
$ git clone https://github.com/n-t-roff/heirloom-doctools
```

## COPYING
Copyright © 2013-2014 Free Software Foundation, Inc.

This file is part of groff, a free software project. You can redistribute it and/or modify it under the terms of the GNU General Public License version 2 (GPL2) as published by the Free Software Foundation (FSF).

The license text can be found in the internet at http://www.gnu.org/licenses.

## AUTHORS
This file was written by Bernd Warken.


package: groff-extra

title: groff_hdtbl(7)

text:
# groff_hdtbl(7)

## NAME
groff_hdtbl - groff `hdtbl' macros for generation of tables

## DESCRIPTION
The hdtbl macros consist of four base and three optional macros, controlled by about twenty arguments. The syntax is simple and similar to the HTML table model and nearly as flexible: You can write sequences of tokens (macro calls with their arguments and content data), separated by blanks and beginning with a macro call, into the same line to get compact and cleanly arrranged input. An advantage of hdtbl is that the tables are constructed without calling a preprocessor; this means that groff's full macro capabilities are available. On the other hand, table processing with hdtbl is much slower than using the tbl(1) preprocessor. A further advantage is that the HTML-like syntax of hdtbl will be easily converted to HTML; this is not implemented yet.

## USAGE
In this and the next section, we present examples to help users understand the basic workflow of hdtbl. First of all, you must load the hdtbl.tmac file. As with nearly all other groff macro packages, there are two possibilities to do so: Either add the line

```
.mso hdtbl.tmac
```

to your roff file before using any macros of the hdtbl package, or add the option

```
-m hdtbl
```

to the command line of groff (before the document file which contains hdtbl macros). Then you can include on or more tables in your document, where each one must be started and ended with the .TBL and .ETB macros, respectively.

In this man page, we approximate the result of each example in the tty format to be as generic as possible since hdtbl currently only supports the PS and PDF output devices.

The simplest well-formed table consists of just single calls to the four base table macros in the right order. Here we construct a table with only one cell.

```
.TBL
.TR
.TD
contents of the table cell
.ETB
```

A tty representation is

```
+------------------------------------------------------+
| contents-of-the-table-cell                           |
+------------------------------------------------------+
```

```

```

Equivalent to the above is the following notation.

```
.TBL .TR .TD "contents of the table cell" .ETB
```

By default, the formatted table is inserted into the surrounding text at the place of its definition. If the vertical space isn't sufficient, it is placed at the top of the next page. Tables can also be stored for later insertion.

Using ‘row-number*column-number’ as the data for the table cells, a table with two rows and two columns can be written as

```
.TBL cols=2
.  TR .TD 1*1 .TD 1*2
.  TR .TD 2*1 .TD 2*2
.ETB
```

A tty representation is

```
+--------------------------+---------------------------+
| 1*1                      | 1*2                       |
+--------------------------+---------------------------+
| 2*1                      | 2*2                       |
+--------------------------+---------------------------+
```

```

```

Here we see a difference to HTML tables: The number of columns must be explicitly specified using the ‘cols=m’ argument (or indirectly via the ‘width’ argument, see below).

The contents of a table cell is arbitrary; for example, it can be another table, without restriction to the nesting depth. A given table layout can be either constructed with suitably nested tables or with proper arguments to .TD and .TH, controlling column and row spanning. Note, however, that this table

```
.TBL
.  TR
.    TD
.      nop 1*1 1*2
.  TR
.    TD
.      TBL cols=2 border=
.        TR
.          TD
.            nop 2*1
.          TD
.            nop 2*2
.      ETB
.ETB
```

and this table

```
.TBL cols=2
.  TR
.    TD colspan=2
.      nop 1*1 1*2
.  TR
.    TD
.      nop 2*1
.    TD
.      nop 2*2
.ETB
```

are similar but not identical (the use of .nop is purely cosmetic to get proper indentation).

The first table looks like

```
+------------------------------------------------------+
| 1*1 1*2                                              |
+------------------------------------------------------+
|                                                      |
| 2*1                         2*2                      |
|                                                      |
+------------------------------------------------------+
```

```

```

and the second one like

```
+------------------------------------------------------+
| 1*1 1*2                                              |
+---------------------------+--------------------------+
| 2*1                       | 2*2                      |
+---------------------------+--------------------------+
```

```

```

Here the latter table in a more compact form.

```
.TBL cols=2 .TR ".TD colspan=2" 1*1 1*2
.            TR .TD 2*1 .TD 2*2 .ETB
```

If a macro has one or more arguments (see below), and it is not starting a line, everything belonging to this macro including the macro itself must be enclosed in double quotes.

## MACROS AND ARGUMENTS
The order of macro calls and other tokens follows the HTML model. In the following list, valid predecessors and successors of all hdtbl macros are given, together with the possible arguments.

Macro arguments are separated by blanks. The order of arguments is arbitrary; they are of the form

key=value

or

key='value1 [value2 [...]]'

with the only exception of the optional argument of the macro .ETB, which is the string ‘hold’. Another possible form is

"key=value1 [value2 [...]]"

However, this is limited to the case where the macro is the first one in the line and not already enclosed in double quotes.

Argument values specified below as c are colors predefined by groff or colors defined by the user with the .defcolor request. Argument values d are decimal numbers with or without decimal point. Argument values m are natural numbers. Argument values n are numerical values with the usual groff scaling indicators. Some of the arguments are specific to one or two macros, but most of them can be specified with .TBL, .TR, .TD, and .TH. These common arguments are explained in the next subsection.

Most of the argument default values can be changed by the user by setting corresponding default registers or strings, as listed below.

.TBL [args]

Begin a new table.

predecessor: .TD, .TH, .ETB, cell contents

successor: .CPTN, .TR

arguments:

border=[n]

Thickness of the surrounding box border. ‘border=’ (no value) means neither a surrounding box border nor any horizontal or vertical separator lines between the table rows and cells. ‘border=0’ suppresses the surrounding box border, but still allows separator lines between cells and rows.

Default: ‘border=.1n’ (register ‘t*b’).

bc=c

Border color.

Default: ‘bc=red4’ (string ‘t*bc’).

cols=m

Number of table columns. This argument is necessary if more than one column is in the table and no ‘width’ arguments are present.

Default: ‘cols=1’ (register ‘t*cols’).

cpd=n

Cell padding, i.e., the extra space between the cell space border and the cell contents.

Default: ‘cpd=.5n’ (register ‘t*cpd’).

csp=n

Cell spacing, i.e., the extra space between the table border or vertical or horizontal lines between cells and the cellspace.

Default: ‘csp=.5n’ (register ‘t*csp’).

tal=l|c|r

Horizontal alignment of the table, if it is smaller than the line width. ‘tal=l’: left alignment. ‘tal=c’: centered alignment. ‘tal=r’: right alignment.

Default: ‘tal=l’ (register ‘t*tal’).

width='w1 [w2 [...]]'

Widths of table cells. w1, w2, ... are either numbers of type n or natural numbers with the pseudo-scaling indicator ‘%’, with the meaning “percent of the actual line length (or column length for inner tables, respectively)”. If there are less width values than table columns, the last width value is used for the remaining cells. The argument

width='1.5i 10%'

for example indicates that the first column is 1.5 inches wide; the remaining columns take 1/10 of the column length each.

Default: The table width equals the outer line length or column length; the columns have equal widths.

height=n

Height of the table. If the table with its contents is lower than n, the last row is stretched to this value.

.CPTN [args]

Text of caption.

The (optionally numbered) table caption. .CPTN is optional.

predecessor: .TBL

successor: .TR

arguments:

val=t|b

Vertical alignment of the table caption. ‘val=t’: The caption is placed above the table. ‘val=b’: The caption is placed below the table.

Default: ‘val=t’ (string ‘t*cptn’).

.TR [args]

Begin a new table row.

predecessor: .TBL, .CPTN, .TD, .TH, .ETB, cell contents

successor: .TD, .TH

arguments:

height=n

The height of the row. If a cell in the row is higher than n this value is ignored; otherwise the row height is stretched to n.

.TD [args [cell contents]]

Begin a table data cell.

.TH [args [cell contents]]

Begin a table header cell.

Arguments and cell contents can be mixed. The macro .TH is not really necessary and differs from .TD only in three default settings, similar to the <TH> and <TD> HTML tags: The contents of .TH is horizontally and vertically centered and typeset in boldface.

predecessor: .TR, .TD, .TH, .ETB, cell contents

successor: .TD, .TH, .TR, .ETB, cell contents

arguments:

colspan=m

The width of this cell is the sum of the widths of the m cells above and below this row.

rowspan=m

The height of this cell is the sum of the heights of the m cells left and right of this column.

Remark: Overlapping of column and row spanning, as in the following table fragment (the overlapping happens in the second cell in the second row), is invalid and causes incorrect results.

```
.TR .TD 1*1 ".TD 1*2 rowspan=2" .TD 1*3
.TR ".TD 2*1 colspan=2"         .TD 2*3
```

A working example for headers and cells with colspan is

```
.TBL cols=3
.  TR ".TH colspan=2" header1+2 .TH header3
.  TR .TD 1*1 .TD 1*2 .TD 1*3
.  TR .TD 2*1 ".TD colspan=2" 2*2+3
.ETB
```

This looks like

```
+------------------------------+---------------+
|          header1+2           |    header3    |
+--------------+---------------+---------------+
| 1*1          | 1*2           | 1*3           |
+--------------+---------------+---------------+
| 2*1          | 2*2+3                         |
+--------------+-------------------------------+
```

```

```

A working example with rowspan is

```
.TBL cols=3
.  TR
.  TD 1*1
.  TD rowspan=2 1+2*2
.  TD 1*3
.
.  TR
.  TD 2*1
.  TD 2*3
.ETB
```

which looks like

```
+--------------+---------------+---------------+
| 1*1          | 1+2*2         | 1*3           |
+--------------+               +---------------+
| 2*1          |               | 2*3           |
+--------------+---------------+---------------+
```

.ETB [hold]

End of the table.

This macro finishes a table. It causes one of the following actions.

•

If the argument ‘hold’ is given, the table is held until it is freed by calling the macro .t*free, which in turn prints the table immediately, either at the current position or at the top of the next page if its height is larger than the remaining space on the page.

•

Otherwise, if the table is higher than the remaining space on the page, it is printed at the top of the next page.

•

If none of the two above constraints hold, the table is printed immediately at the place of its definition.

predecessor: .TD, .TH, .ETB, cell contents

successor: .TBL, .TR, .TD, .TH, .ETB, cell contents

arguments:

hold

Prevent the table from being printed until it is freed by calling the macro .t*free. This argument is ignored for inner (nested) tables.

.t*free [n]

Free the next held table or n held tables. Call this utility macro to print tables which are held by using the ‘hold’ argument of the .ETB macro.

### Arguments common to .TBL, .TR, .TD, and .TH
The arguments described in this section can be specified with the .TBL and .TR macros, but they are eventually passed on to the table cells. If omitted, the defaults take place, which the user can change by setting the corresponding default registers or strings, as documented below. Setting an argument with the .TBL macro has the same effect as setting it for all rows in the table. Setting an argument with a .TR macro has the same effect as setting it for all the .TH or .TD macro in this row.

bgc=[c]

The background color of the table cells. This includes the area specified with the ‘csp’ argument. The argument ‘bgc=’ (no value) suppresses a background color; this makes the background transparent.

Default: ‘bgc=bisque’ (string ‘t*bgc’).

fgc=c

The foreground color of the cell contents.

Default: ‘fgc=red4’ (string ‘t*fgc’).

ff=name

The font family for the table. name is one of the groff font families, for example A for the AvantGarde fonts or HN for Helvetica-Narrow.

Default: The font family found before the table (string ‘t*ff’).

fst=style

The font style for the table. One of R, I, B, or BI for roman, bold, italic, or bold italic, respectively. As with roff's .ft request the ‘fst’ argument can be used to specify the font family and font style together, for example ‘fst=HNBI’ instead of ‘ff=HN’ and ‘fst=BI’.

Default: The font style in use right before the table (string ‘t*fst’).

fsz='d1 [d2]'

A decimal or fractional factor d1, by which the point size for the table is changed, and d2, by which the vertical line spacing is changed. If d2 is omitted, value d1 is taken for both.

Default: ‘fsz='1.0 1.0'’ (string ‘t*fsz’).

hal=l|c|b|r

Horizontal alignment of the cell contents in the table. ‘hal=l’: left alignment. ‘hal=c’: centered alignment. ‘hal=b’: both (left and right) alignment. ‘hal=r’: right alignment.

Default: ‘hal=b’ (string ‘t*hal’).

val=t|m|b

Vertical alignment of the cell contents in the table for cells lower than the current row. ‘val=t’: alignment below the top of the cell. ‘val=m’: alignment in the middle of the cell. ‘val=b’: alignment above the cell bottom.

Default: ‘val=t’ (string ‘t*val’).

hl=[s|d]

Horizontal line between the rows. If specified with .TD or .TH this is a separator line to the cell below. ‘hl=’ (no value): no separator line. ‘hl=s’: a single separator line between the rows. ‘hl=d’: a double separator line.

The thickness of the separator lines is the half of the border thickness, but at least 0.1 inches. The distance between the double lines is equal to the line thickness.

Remark: Together with ‘border=0’ for proper formatting the value of ‘csp’ must be at least .05 inches for single separator lines and .15 inches for double separator lines.

Default: ‘hl=s’ (string ‘t*hl’).

vl=[s|d]

Vertical separator line between the cells. If specified with .TD or .TH this is a separator line to the cell on the right. ‘vl=s’: a single separator line between the cells. ‘vl=d’: a double separator line. ‘vl=’ (no value): no vertical cell separator lines. For more information see the documentation of the ‘hl’ argument above.

Default: ‘vl=s’ (string ‘t*vl’).

## HDTBL CUSTOMIZATION
Before creating the first table, you should configure default values to minimize the markup needed in each table. The following example sets up defaults suitable for typical papers:

```
.ds t*bgc white\" background color
.ds t*fgc black\" foreground color
.ds t*bc black\"  border color
.nr t*cpd 0.1n\"  cell padding
```

The file examples/common.roff provides another example setup in the ``minimal Page setup'' section.

A table which does not fit on a partially filled page is printed automatically on the top of the next page if you append the little utility macro t*hm to the page header macro of your document's main macro package. For example, say

```
.am pg@top
.  t*hm
..
```

if you use the ms macro package.

The macro t*EM checks for held or kept tables, and for missing ETB macros (table not closed). You can append this macro to the ``end'' macro of your document's main macro package. For example:

```
.am pg@end-text
.  t*EM
..
```

If you use the ms macro package.

## BUGS AND SUGGESTIONS
Please send your commments to the groff mailing list or directly to the author.

## COPYING
Copyright © 2005-2014 Free Software Foundation, Inc.

This file is part of groff, the groff.

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 the Invariant Sections being this .ig-section and AUTHORS, 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.

## AUTHORS
This document was written by Joachim Walsdorff.


title: groff_man(7)

text:
# groff_man(7)

## NAME
groff_man - groff man macros to support generation of man pages

## SYNOPSIS
groff -man

[options ...] [files ...]

groff -m man

[options ...] [files ...]

## DESCRIPTION
The man macros used to generate man pages with groff were written by James Clark. This document provides a brief summary of the use of each macro in that package.

## OPTIONS
The man macros understand the following command line options (which define various registers).

-rcR=1

This option (the default if in nroff mode) creates a single, very long page instead of multiple pages. Say -rcR=0 to disable it.

-rC1

If more than one manual page is given on the command line, number the pages continuously, rather than starting each at 1.

-rD1

Double-sided printing. Footers for even and odd pages are formatted differently.

-rFT=dist

Set distance of the footer relative to the bottom of the page if negative or relative to the top if positive. The default is -0.5i.

-rHY=flags

Set hyphenation flags. Possible values are 1 to hyphenate without restrictions, 2 to not hyphenate the last word on a page, 4 to not hyphenate the last two characters of a word, and 8 to not hyphenate the first two characters of a word. These values are additive; the default is 14.

-rIN=width

Set body text indentation to width. The default is 7n for nroff, 7.2n for troff. For nroff, this value should always be an integer multiple of unit ‘n’ to get consistent indentation.

-rLL=line-length

Set line length. If this option is not given, the line length is set to respect any value set by a prior ‘.ll’ request (which must be in effect when the ‘.TH’ macro is invoked), if this differs from the built-in default for the formatter; otherwise it defaults to 78n in nroff mode and 6.5i in troff mode.

Note that the use of a ‘.ll’ request to initialize the line length is supported for backward compatibility with some versions of the man program; direct initialization of the ‘LL’ register should always be preferred to the use of such a request. In particular, note that a ‘.ll 65n’ request does not preserve the normal nroff default line length, (the man default initialization to 78n prevails), whereas, the ‘-rLL=65n’ option, or an equivalent ‘.nr LL 65n’ request preceding the use of the ‘TH’ macro, does set a line length of 65n.

-rLT=title-length

Set title length. If this option is not given, the title length defaults to the line length.

-rPnnn

Enumeration of pages start with nnn rather than with 1.

-rSxx

Base document font size is xx points (xx can be 10, 11, or 12) rather than 10 points.

-rSN=width

Set sub-subheading indentation to width. The default is 3n.

-rXnnn

After page nnn, number pages as nnna, nnnb, nnnc, etc. For example, the option ‘-rX2’ produces the following page numbers: 1, 2, 2a, 2b, 2c, etc.

## USAGE
This section describes the available macros for manual pages. For further customization, put additional macros and requests into the file man.local, which is loaded immediately after the man package.

.EX

.EE

Example/End Example. After .EX, filling is disabled and the font is set to constant-width. This is useful for formatting code, command, and configuration-file examples. The EE macro restores filling and restores the previous font.

These macros are defined on many (but not all) legacy Unix systems running classic troff. To be certain your page will be portable to those systems, copy their definitions from the an-ext.tmac file of a groff installation.

.HP [nnn]

Set up a paragraph with hanging left indentation. The indentation is set to nnn if that argument is supplied (the default unit is ‘n’ if omitted), otherwise it is set to the previous indentation value specified with .TP, .IP, or .HP (or to the default value if none of them have been used yet). Font size and face are reset to its default values. The following paragraph illustrates the effect of this macro with hanging indentation set to 4 (enclosed by .RS and .RE to set the left margin temporarily to the current indentation):

This is a paragraph following an invocation of the HP macro. As you can see, it produces a paragraph where all lines but the first are indented.

Use of this presentation-level macro is deprecated. While it is universally portable to legacy Unix systems, a hanging indentation cannot be expressed naturally under HTML, and many HTML-based manual viewers simply interpret it as a starter for a normal paragraph. Thus, any information or distinction you tried to express with the indentation may be lost.

.IP [designator] [nnn]

Set up an indented paragraph, using designator as a tag to mark its beginning. The indentation is set to nnn if that argument is supplied (the default unit is ‘n’ if omitted), otherwise it is set to the previous indentation value specified with .TP, .IP, or .HP (or to the default value if none of them have been used yet). Font size and face of the paragraph (but not the designator) are reset to its default values.

To start an indented paragraph with a particular indentation but without a designator, use ‘""’ (two doublequotes) as the second argument.

For example, the following paragraphs were all set up with bullets as the designator, using ‘.IP \(bu 4’. The whole block has been enclosed with .RS and .RE to set the left margin temporarily to the current indentation value.

- IP is one of the three macros used in the man package to format lists.

- HP is another. This macro produces a paragraph with a left hanging indentation.

- TP is another. This macro produces an unindented label followed by an indented paragraph.

.LP

.PP

.P

These macros are mutual aliases. Any of them causes a line break at the current position, followed by a vertical space downwards by the amount specified by the PD macro. The font size and shape are reset to the default value (normally 10pt Roman). Finally, the current left margin and the indentation is reset to the default values.

.RE [nnn]

This macro moves the left margin back to level nnn, restoring the previous left margin. If no argument is given, it moves one level back. The first level (i.e., no call to .RS yet) has number 1, and each call to .RS increases the level by 1.

.RS [nnn]

This macro moves the left margin to the right by the value nnn if specified (default unit is ‘n’); otherwise it is set to the previous indentation value specified with .TP, .IP, or .HP (or to the default value if none of them have been used yet). The indentation value is then set to the default.

Calls to the RS macro can be nested.

.SH [text for a heading]

Set up an unnumbered section heading sticking out to the left. Prints out all the text following .SH up to the end of the line (or the text in the next input line if there is no argument to .SH) in bold face (or the font specified by the string HF), one size larger than the base document size. Additionally, the left margin and the indentation for the following text is reset to the default values.

.SS [text for a heading]

Set up a secondary, unnumbered section heading. Prints out all the text following .SS up to the end of the line (or the text in the next input line if there is no argument to .SS) in bold face (or the font specified by the string HF), at the same size as the base document size. Additionally, the left margin and the indentation for the following text is reset to the default values.

.TH title section [extra1] [extra2] [extra3]

Set the title of the man page to title and the section to section, which must take on a value between 1 and 8. The value section may also have a string appended, e.g. ‘.pm’, to indicate a specific subsection of the man pages. Both title and section are positioned at the left and right in the header line (with section in parentheses immediately appended to title. extra1 is positioned in the middle of the footer line. extra2 is positioned at the left in the footer line (or at the left on even pages and at the right on odd pages if double-sided printing is active). extra3 is centered in the header line.

For HTML output, headers and footers are completely suppressed.

Additionally, this macro starts a new page; the new line number is 1 again (except if the ‘-rC1’ option is given on the command line) -- this feature is intended only for formatting multiple man pages; a single man page should contain exactly one TH macro at the beginning of the file.

.TP [nnn]

Set up an indented paragraph with label. The indentation is set to nnn if that argument is supplied (the default unit is ‘n’ if omitted), otherwise it is set to the previous indentation value specified with .TP, .IP, or .HP (or to the default value if none of them have been used yet).

The first input line of text following this macro is interpreted as a string to be printed flush-left, as it is appropriate for a label. It is not interpreted as part of a paragraph, so there is no attempt to fill the first line with text from the following input lines. Nevertheless, if the label is not as wide as the indentation the paragraph starts at the same line (but indented), continuing on the following lines. If the label is wider than the indentation the descriptive part of the paragraph begins on the line following the label, entirely indented. Note that neither font shape nor font size of the label is set to a default value; on the other hand, the rest of the text has default font settings.

The TP macro is the macro used for the explanations you are just reading.

.TQ

The TQ macro sets up header continuation for a TP macro. With it, you can stack up any number of labels (such as in a glossary, or list of commands) before beginning the indented paragraph. For an example, look up the documentation of the LP, PP, and P macros.

This macro is not defined on legacy Unix systems running classic troff. To be certain your page will be portable to those systems, copy its definition from the an-ext.tmac file of a groff installation.

To summarize, the following macros cause a line break with the insertion of vertical space (which amount can be changed with the PD macro): SH, SS, TP, TQ, LP (PP, P), IP, and HP. The macros RS, RE, EX, and EE also cause a break but no insertion of vertical space.

## MACROS TO SET FONTS
The standard font is Roman; the default text size is 10 point.

.B [text]

Causes text to appear in bold face. If no text is present on the line where the macro is called the text of the next input line appears in bold face.

.BI text

Causes text on the same line to appear alternately in bold face and italic. The text must be on the same line as the macro call. Thus

.BI this "word and" that

would cause ‘this’ and ‘that’ to appear in bold face, while ‘word and’ appears in italics.

.BR text

Causes text on the same line to appear alternately in bold face and roman. The text must be on the same line as the macro call.

.I [text]

Causes text to appear in italic. If no text is present on the line where the macro is called the text of the next input line appears in italic.

.IB text

Causes text to appear alternately in italic and bold face. The text must be on the same line as the macro call.

.IR text

Causes text on the same line to appear alternately in italic and roman. The text must be on the same line as the macro call.

.RB text

Causes text on the same line to appear alternately in roman and bold face. The text must be on the same line as the macro call.

.RI text

Causes text on the same line to appear alternately in roman and italic. The text must be on the same line as the macro call.

.SB [text]

Causes the text on the same line or the text on the next input line to appear in boldface font, one point size smaller than the default font.

.SM [text]

Causes the text on the same line or the text on the next input line to appear in a font that is one point size smaller than the default font.

## MACROS TO DESCRIBE HYPERLINKS AND EMAIL ADDRESSES
The following macros are not defined on legacy Unix systems running classic troff. To be certain your page will be portable to those systems, copy their definitions from the an-ext.tmac file of a groff installation.

Using these macros helps ensure that you get hyperlinks when your manual page is rendered in a browser or other program that is Web-enabled.

.MT address

.ME [punctuation]

Wrap an email address. The argument of .MT is the address; text following, until .ME, is a name to be associated with the address. Any argument to the ME macro is pasted to the end of the link text. On a device that is not a browser,

```
contact
.MT fred.foonly@\:fubar.net
Fred Foonly
.ME
for more information

```

usually displays like this: “contact Fred Foonly <fred.foonly@fubar.net> for more information”.

The use of \: to insert hyphenless breakpoints is a groff extension and can be omitted.

.UR URL

.UE [punctuation]

Wrap a World Wide Web hyperlink. The argument to .UR is the URL; thereafter, lines until .UE are collected and used as the link text. Any argument to the UE macro is pasted to the end of the text. On a device that is not a browser,

```
this is a link to
.UR http://\:randomsite.org/\:fubar
some random site
.UE ,
given as an example

```

usually displays like this: “this is a link to some random site <http://randomsite.org/fubar>, given as an example”.

The use of \: to insert hyphenless breakpoints is a groff extension and can be omitted.

## MACROS TO DESCRIBE COMMAND SYNOPSES
The following macros are not defined on legacy Unix systems running classic troff. To be certain your page will be portable to those systems, copy their definitions from the an-ext.tmac file of a groff installation.

These macros are a convenience for authors. They also assist automated translation tools and help browsers in recognizing command synopses and treating them differently from running text.

.OP key value

Describe an optional command argument. The arguments of this macro are set surrounded by option braces in the default Roman font; the first argument is printed with a bold face, while the second argument is typeset as italic.

.SY command

Begin synopsis. Takes a single argument, the name of a command. Text following, until closed by .YS, is set with a hanging indentation with the width of command plus a space. This produces the traditional look of a Unix command synopsis.

.YS

This macro restores normal indentation at the end of a command synopsis.

Here is a real example:

```
.SY groff
.OP \-abcegiklpstzCEGNRSUVXZ
.OP \-d cs
.OP \-f fam
.OP \-F dir
.OP \-I dir
.OP \-K arg
.OP \-L arg
.OP \-m name
.OP \-M dir
.OP \-n num
.OP \-o list
.OP \-P arg
.OP \-r cn
.OP \-T dev
.OP \-w name
.OP \-W name
.RI [ file
.IR .\|.\|. ]
.YS

```

produces the following output:

groff

[-abcegiklpstzCEGNRSUVXZ] [-d cs] [-f fam] [-F dir] [-I dir] [-K arg] [-L arg] [-m name] [-M dir] [-n num] [-o list] [-P arg] [-r cn] [-T dev] [-w name] [-W name] [file ...]

If necessary, you might use br requests to control line breaking. You can insert plain text as well; this looks like the traditional (unornamented) syntax for a required command argument or filename.

## MISCELLANEOUS
The default indentation is 7.2n in troff mode and 7n in nroff mode except for grohtml, which ignores indentation.

.AT [system [release]]

Alter the footer for use with AT&T man pages. This command exists only for compatibility; don't use it. See the groff info manual for more.

.BT

Print the footer string. Redefine this macro to get control of the footer.

.DT

Set tabs every 0.5 inches. Since this macro is always called during a TH macro, it makes sense to call it only if the tab positions have been changed.

Use of this presentation-level macro is deprecated. It translates poorly to HTML, under which exact whitespace control and tabbing are not readily available. Thus, information or distinctions that you use .DT to express are likely to be lost. If you feel tempted to use it, you should probably be composing a table using tbl(1) markup instead.

.PD [nnn]

Adjust the empty space before a new paragraph or section. The optional argument gives the amount of space (default unit is ‘v’); without parameter, the value is reset to its default value (1 line in nroff mode, 0.4v otherwise). This affects the macros SH, SS, TP, LP (resp. PP and P), IP, and HP.

Use of this presentation-level macro is deprecated. It translates poorly to HTML, under which exact control of inter-paragraph spacing is not readily available. Thus, information or distinctions that you use .PD to express are likely to be lost.

.PT

Print the header string. Redefine this macro to get control of the header.

.UC [version]

Alter the footer for use with BSD man pages. This command exists only for compatibility; don't use it. See the groff info manual for more.

The following strings are defined:

\*R

The ‘registered’ sign.

\*S

Switch back to the default font size.

\*(lq

\*(rq

Left and right quote. This is equal to ‘\(lq’ and ‘\(rq\[cq], respectively.

\*(HF

The typeface used to print headings and subheadings. The default is ‘B’.

\*(Tm

The ‘trademark’ sign.

If a preprocessor like tbl or eqn is needed, it has become common to make the first line of the man page look like this:

'\" word

Note the single space character after the double quote. word consists of letters for the needed preprocessors: ‘e’ for eqn, ‘r’ for refer, and ‘t’ for tbl. Modern implementations of the man program read this first line and automatically call the right preprocessor(s).

## PORTABILITY AND TROFF REQUESTS
Since the man macros consist of groups of groff requests, one can, in principle, supplement the functionality of the man macros with individual groff requests where necessary. See the groff info pages for a complete reference of all requests.

Note, however, that using raw troff requests is likely to make your page render poorly on the (increasingly common) class of viewers that render it to HTML. Troff requests make implicit assumptions about things like character and page sizes that may break in an HTML environment; also, many of these viewers don't interpret the full troff vocabulary, a problem that can lead to portions of your text being silently dropped.

For portability to modern viewers, it is best to write your page entirely in the requests described on this page. Further, it is best to completely avoid those we have described as ‘presentation-level’ (.HP, .PD, and .DT).

The macros we have described as extensions (.EX/.EE, .SY/.OP/.YS, .UR/.UE, and .MT/.ME) should be used with caution, as they may not yet be built in to some viewer that is important to your audience. If in doubt, copy the implementation onto your page.

## FILES
man.tmac

an.tmac

These are wrapper files to call andoc.tmac.

andoc.tmac

Use this file in case you don't know whether the man macros or the mdoc package should be used. Multiple man pages (in either format) can be handled.

an-old.tmac

Most man macros are contained in this file.

an-ext.tmac

The extension macro definitions for .SY, .OP, .YS, .TQ, .EX/.EE, .UR/.UE, and .MT/.ME are contained in this file. It is written in classic troff, and released for free re-use, and not copylefted; manual page authors concerned about portability to legacy Unix systems are encouraged to copy these definitions into their pages, and maintainers of troff or its workalikes are encouraged to re-use them.

Note that the definitions for these macros are read after the call of TH, so they will replace macros of the same names given at the beginning of your file. If you must use your own definitions for these macros, they must be given after calling TH.

man.local

Local changes and customizations should be put into this file.

## SEE ALSO
tbl(1), eqn(1), refer(1), man(1), man(7), groff_mdoc(7)

## COPYING
Copyright © 1999-2014 Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English.

## AUTHORS
This manual page was originally written for the Debian GNU/Linux system by Susan G. Kleinmann.

It was corrected and updated by Werner Lemberg.

The extension macros were documented (and partly designed) by Eric S. Raymond; he also wrote the portability advice.