Prev | Current Page 1060 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"

ps). The next example creates HP LaserJet output (-Tlj4) and directs it to the
default printer (-l option).
Creating a Man Page with Groff
Before HOWTOs and info files, man pages were the foundation for information about UNIX and
UNIX-like systems. Each command, file format, device, or other component either had its own
man page or was grouped on a man page with similar components. To create your own man page
requires that you learn a few macros (in particular, man macros). Figure 21-3 shows the source for
a fictitious man page for a command called waycool.
561
Working with Words and Images 21
FIGURE 21-3
Simple markup is required to create man pages.
Most man pages are stored in subdirectories of /usr/share/man. Before you create a
man page, refer to similar man pages to see the markup and the headings they include.
man1 has commands; man2 has system calls; man3 has library functions; man4 has special device
files (/dev/*); man5 has file formats; man6 has games; man7 has miscellaneous components; and
man8 has administrative commands.
A few other kinds of macros are used in the man page. The .IP macros format indented paragraphs
for things such as options. The man page also contains some lower-level font requests; for example,
\fB says to change the current font to bold, \fI changes the font to italic, and \fR changes it
back to regular font.


Pages:
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072