man
Section: Misc. Reference Manual Pages (pj)
Updated: 2 July 2005
Index
Return to Main Contents
NAME
Writing man Pages
SYNOPSIS
Writing a man page is not hard!
DESCRIPTION
Here are some macros you might use:
- .TH command-name man-section date
-
Title header. This text will appear in the header and footer of the resulting man page. If any of the arguments contain spaces, you'll need to quote them or \ (backslash + space).
- .SH name
-
Section header. Usually section names are written in caps. See below for a recommended list of sections.
-
- NAME
-
The name of whatever you're documenting: a binary, a file, sometimes a concept.
- SYNOPSIS
-
A one-liner. For commands, this should show their parameterized form, like this:
-
whizprog
[
options
] [
files
... ]
- DESCRIPTION
-
More detailed description of your topic. Often you'll include a list of options here.
- BUGS
-
Any bugs you know about, plus some way users can report new ones.
- AUTHOR
-
The author of the documented thing, or perhaps the manpage itself. Beats me!
- COPYRIGHT
-
A copyright statement, so people know if it is free as in speech or free as in beer.
- SEE ALSO
-
Any references to other documentation.
- .TP [width]
-
Tabbed paragraph? Whatever it stands for, it's a hanging indent. The next line will hang, and following lines will be indented. This is useful for listing options. Usually the options appear in bold (.B) and parameter names in italics \fIblah\fR. You use \fI to set an italic font and \fR to set a roman font.
- .IP tag [width]
-
Indented paragraph. This is also a hanging indent, but unlike .TP, it reads the hanging line as its next argument. This is good when all your hanging tags are single words.
- .RS
-
Relative indent start. This is good for nested lists.
- .RE
-
Relative indent end. You should have one of these for every .RS.
- .nf
-
No formatting. Sort of like the HTML <pre> tag.
- .fi
-
Format again.
- .PP
-
Paragraph. Nothing fancy. You could also use .P or .LP for the same thing.
- .br
-
Line break. Start a new line without inter-paragraph spacing.
- \\&.
-
A literal period at the beginning of a line.
AUTHOR
Written by Paul Jungwirth
COPYRIGHT
Copyright © 2005 Paul Jungwirth
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- AUTHOR
-
- COPYRIGHT
-
This document was created by
man2html,
using the manual pages.
Time: 23:18:39 GMT, April 26, 2010