| MAN(7) | Miscellaneous Information Manual | MAN(7) |
NAME
man — legacy
formatting language for manual pages
DESCRIPTION
The man language describes a manual page
by how it looks: headings, paragraphs, indentation and fonts. It is older
than mdoc(7), in which OxideBSD's own
pages are written, but most manual pages of third-party software use it, and
oxdoc(1) formats both. Like
mdoc(7), it is written as
roff(7) input: text lines, and macro
lines starting with a dot and a macro name.
A macro's arguments are separated by spaces; an argument containing spaces is quoted with double quotes, and a double quote inside one is written twice. Spaces inside a quoted argument are kept as they are, and the line may break at any of them.
Text lines are filled and adjusted into paragraphs. A sentence
should end at the end of an input line, so that it can be followed by two
spaces. A blank line is a paragraph break with vertical space, like
sp, but PP should be used
instead.
MANUAL STRUCTURE
A page starts with TH and continues with
sections, conventionally NAME, SYNOPSIS, DESCRIPTION and those listed in
mdoc(7). The NAME section holds one
line: the names the page describes, separated by commas, then
‘\-’ and a short description.
.TH NAME 1 2026-09-27 "OxideBSD" "General Commands Manual" .SH NAME name \- one-line description .SH SYNOPSIS .B name .RI [ file ...] .SH DESCRIPTION The .B name utility ...
MACRO OVERVIEW
Document structure
TH |
the title line |
SH |
section heading |
SS |
subsection heading |
Paragraphs and indentation
PP, LP,
P |
paragraph |
TP |
paragraph with a tag on the next line |
TQ |
another tag for the same paragraph |
IP |
paragraph, optionally with a tag |
HP |
paragraph with a hanging indent |
RS, RE |
move the left margin right and back |
PD |
the space between paragraphs |
Fonts
B |
bold |
I |
italic |
SB |
small bold, shown bold |
SM |
small, shown in the regular font |
R |
the regular font |
BI, BR,
IB, IR,
RB, RI |
two fonts in turn |
Hyperlinks and cross-references
UR, UE |
a link to a URL |
MT, ME |
a link to an e-mail address |
MR |
a reference to another manual page |
Synopses and examples
SY, YS |
a command synopsis |
OP |
an optional command-line option |
EX, EE |
an example, not filled |
Obsolete macros
AT |
the AT&T system the page belongs to |
UC |
the Berkeley system the page belongs to |
DT |
restore the default tab stops |
MACRO REFERENCE
THtitle section [date [source [volume]]]- The title line, which must come first. title is conventionally in capitals. The page header shows it with section in parentheses at both ends and volume in the middle; the footer shows source, the system or package the page belongs to, at the left, date in the middle and the title again at the right. Without volume, the section's usual name is used, such as “General Commands Manual” for section 1.
SH[heading]- A section heading, printed at the left margin in bold. Without
heading, the next input line is the heading. It ends
any open paragraph and
RSindentation. SS[heading]- A subsection heading, indented less than the text of the section; a long one wraps to the text's indentation.
PP,LP,P- A paragraph: a blank line, then text at the section's indentation. Empty paragraphs, and one right after a heading, produce no blank line.
TP[width]- A tagged paragraph. The next input line is the tag, printed at the current
indentation; the text after it is indented by width,
by default seven columns or the width last given. When the tag is too wide
for that indentation, the text starts on the next line. Blank lines
between
TPand the tag are ignored. TQ- Another tag for the paragraph of the
TPbefore it, printed on its own line with no space above it. IP[tag [width]]- An indented paragraph, with the optional tag in the
margin like
TP. HP[width]- A paragraph whose first line starts at the current indentation and whose other lines are indented by width.
RS[width]- Moves the left margin right by width, by default the
width of the last tagged paragraph, until the matching
RE. RE[level]- Ends the innermost
RS, or all of them down to level. PD[distance]- Sets the vertical space before paragraphs and headings, in lines; without
distance, one line. ‘
.PD 0’ is used before aTPthat should follow the one before it without space. B,I,SB,SM,R[text ...]- Prints text, or without it the next input line, in the macro's font.
BI,BR,IB,IR,RB,RItext ...- Prints its arguments joined without spaces, in the two fonts of its name
in turn: bold, italic or regular. For example,
‘
.BR ls (1)’ prints ls in bold and ‘(1)’ in the regular font. URurl- The text up to
UEis a link to url, which is printed after it in angle brackets. UE[punctuation]- Ends a
URlink; punctuation is printed right after it. MTaddress,ME[punctuation]- The same for an e-mail address.
MRname section [suffix]- A reference to the manual page name in
section, as
‘
name(section)’. SYcommand- Starts a synopsis of command: the command in bold, then the following text with its continuation lines indented to line up after it.
YS- Ends a synopsis.
OPflag [argument]- An optional option in a synopsis: the flag in bold and the argument in italics, in brackets.
EX,EE- An example: the lines between them are printed as they are, not filled.
AT[version [release]]- Sets the footer's source to an AT&T system: “7th Edition” by default, or System III or System V for version 4 or 5.
UC[version]- Sets the footer's source to a Berkeley system, from “3rd Berkeley Distribution” for version 3 to “4.4 Berkeley Distribution” for version 7.
DT- Restores the default tab stops, every half inch (five columns).
A font macro or a line of text ending in
‘\c’ continues on the next line
without a space.
ROFF REQUESTS
These roff(7) requests are commonly used in manual pages and have their usual effect on a terminal:
br- Ends the output line.
sp[distance]- Ends the line and leaves distance blank lines, by default one; an exact half line leaves none.
nf,fi- Stops and resumes filling: in between, each input line is an output line.
in[[+|-]width]- Sets the left margin: to width columns from the left edge of the page, or moved by it with a sign, or with no argument back to the paragraph's own margin. The next paragraph or heading macro resets it.
ti[[+|-]width]- Indents only the next output line.
ft[font]- Changes the font, like
\f; an unknown font name is ignored. tastop ...- Sets tab stops, in columns from the left margin. A stop written
‘
+n’ is n columns after the one before it, and ‘T n’ repeats every n columns after the last one. Past the last stop a tab moves nowhere.
Other typesetting requests, such as ad,
na, hy,
nh, ne and
ll, are accepted and have no effect. A page cannot
redefine the man macros with
de; such definitions are ignored.
The number register an-margin holds the left
margin set by RS and RE, in
basic units (24 to a column), as groff's man macros keep it.
SCALING UNITS
Widths and distances are numbers with an optional unit:
| Unit | Meaning |
n,
m |
one column (default for widths) |
v |
one line (default for vertical distances) |
i |
an inch, ten columns |
c |
a centimetre |
p,
P |
a point, a pica |
u |
a basic unit, 1/24 of a column |
3n+2n’, is ignored. Fractions are
rounded to whole columns or lines, an exact half down.
SEE ALSO
HISTORY
The man language first appeared in
Version 7 AT&T UNIX, replacing the
man macros of earlier editions. The
SY, OP,
EX, UR,
MT and MR macros are
extensions from GNU troff. This manual was written for OxideBSD.
| September 27, 2026 | OxideBSD |