1 .\" $NetBSD: mdoc.samples.7,v 1.43 2009/03/09 18:13:24 joerg Exp $
3 .\" Copyright (c) 1990, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93
32 .\" This tutorial sampler invokes every macro in the package several
33 .\" times and is guaranteed to give a worst case performance
34 .\" for an already extremely slow package.
41 .Nd tutorial sampler for writing
48 A tutorial sampler for writing
53 .Em content Ns \-based
63 addressed page layout leaving the
64 manipulation of fonts and other
65 typesetting details to the individual author.
70 .Em "page structure domain"
71 which consists of macros for titles, section headers, displays
73 Essentially items which affect the physical position
74 of text on a formatted page.
75 In addition to the page structure domain, there are two more domains,
76 the manual domain and the general text domain.
77 The general text domain is defined as macros which
78 perform tasks such as quoting or emphasizing pieces of text.
79 The manual domain is defined as macros that are a subset of the
80 day to day informal language used to describe commands, routines
84 Macros in the manual domain handle
85 command names, command line arguments and options, function names,
86 function parameters, pathnames, variables, cross
87 references to other manual pages, and so on.
90 for both the author and the future user of the manual page.
91 It is hoped the consistency gained
92 across the manual set will provide easier
93 translation to future documentation tools.
97 manual pages, a manual entry
99 to as a man page, regardless of actual length and without
102 Since a tutorial document is normally read when a person
103 desires to use the material immediately, the assumption has
104 been made that the user of this document may be impatient.
105 The material presented in the remainder of this document is
107 .Bl -enum -offset indent
109 .Tn "TROFF IDIOSYNCRASIES"
110 .Bl -tag -width flag -compact -offset indent
112 .It "Passing Space Characters in an Argument" .
113 .It "Trailing Blank Space Characters (a warning)" .
114 .It "Escaping Special Characters" .
117 .Tn "THE ANATOMY OF A MAN PAGE"
118 .Bl -tag -width flag -compact -offset indent
119 .It "A manual page template" .
122 .Tn "INTRODUCTION OF TITLE MACROS" .
124 .Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS" .
125 .Bl -tag -width flag -compact -offset indent
126 .It "What's in a name..." .
127 .It "General Syntax" .
131 .Bl -tag -width flag -compact -offset indent
134 .It "Configuration Declarations (section four only)" .
135 .It "Command Modifier" .
136 .It "Defined Variables" .
137 .It "Errno's (Section two only)" .
138 .It "Environment Variables" .
139 .It "Function Argument" .
140 .It "Function Declaration" .
142 .It "Functions (library routines)" .
143 .It "Function Types" .
144 .\" .It "Header File (including source code)" .
145 .It "Interactive Commands" .
151 .It "Cross References" .
154 .Tn "GENERAL TEXT DOMAIN"
155 .Bl -tag -width flag -compact -offset indent
156 .It "AT\*[Am]T Macro" .
159 .It "FreeBSD Macro" .
161 .It "OpenBSD Macro" .
163 .It "Emphasis Macro" .
164 .It "Enclosure/Quoting Macros"
165 .Bl -tag -width flag -compact -offset indent
166 .It "Angle Bracket Quote/Enclosure" .
167 .It "Bracket Quotes/Enclosure" .
168 .It "Double Quote macro/Enclosure" .
169 .It "Parenthesis Quote/Enclosure" .
170 .It "Single Quotes/Enclosure" .
173 .It "Extended Arguments" .
174 .It "No\-Op or Normal Text Macro" .
175 .It "No Space Macro" .
176 .It "Section Cross References" .
177 .It "Symbolic Macro" .
178 .It "References and Citations" .
179 .It "Trade Names (Acronyms and Type Names)" .
182 .Tn "PAGE STRUCTURE DOMAIN"
183 .Bl -tag -width flag -compact -offset indent
184 .It "Section Headers" .
185 .It "Paragraphs and Line Spacing" .
188 .It "Lists and Columns" .
191 .Tn "PREDEFINED STRINGS"
195 .Tn "FORMATTING WITH GROFF, TROFF AND NROFF"
200 .Sh TROFF IDIOSYNCRASIES
203 package attempts to simplify the process of writing a man page.
204 Theoretically, one should not have to learn the dirty details of
208 however, there are a few
209 limitations which are unavoidable and best gotten out
211 And, too, be forewarned, this package is
217 a macro is called by placing a
221 a line followed by the two character name for the macro.
222 Arguments may follow the macro separated by spaces.
223 It is the dot character at the beginning of the line which causes
225 to interpret the next two characters as a macro name.
229 at the beginning of a line in some context other than
230 a macro invocation, precede the
237 translates literally to a zero width space, and is never displayed in the
242 macros accept up to nine arguments, any
243 extra arguments are ignored.
246 accept nine arguments and,
247 in limited cases, arguments may be continued or extended
250 .Sx Extended Arguments ) .
251 A few macros handle quoted arguments (see
252 .Sx Passing Space Characters in an Argument
257 general text domain and manual domain macros are special
258 in that their argument lists are
260 for callable macro names.
261 This means an argument on the argument list which matches
262 a general text or manual domain macro name and is determined
263 to be callable will be executed
264 or called when it is processed.
266 the argument, although the name of a macro,
270 It is in this manner that many macros are nested; for
276 the flag and argument macros,
280 to specify an optional flag with an argument:
281 .Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent
284 .Li \&.Op \&Fl s \&Ar bytes
287 To prevent a two character
288 string from being interpreted as a macro name, precede
292 .Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent
293 .It Op \&Fl s \&Ar bytes
295 .Li \&.Op \e\*[Am]Fl s \e\*[Am]Ar bytes
302 are not interpreted as macros.
303 Macros whose argument lists are parsed for callable arguments
305 as parsed and macros which may be called from an argument
306 list are referred to as callable
307 throughout this document and in the companion quick reference
312 as almost all of the macros in
314 are parsed, but as it was cumbersome to constantly refer to macros
315 as being callable and being able to call other macros,
316 the term parsed has been used.
317 .Ss Passing Space Characters in an Argument
318 Sometimes it is desirable to give as one argument a string
319 containing one or more blank space characters.
320 This may be necessary
321 to defeat the nine argument limit or to specify arguments to macros
322 which expect particular arrangement of items in the argument list.
326 expects the first argument to be the name of a function and any
327 remaining arguments to be function parameters.
330 stipulates the declaration of function parameters in the
331 parenthesized parameter list, each parameter is guaranteed
332 to be at minimum a two word string.
336 There are two possible ways to pass an argument which contains
338 .Em Implementation note :
339 Unfortunately, the most convenient way
340 of passing spaces in between quotes by reassigning individual
341 arguments before parsing was fairly expensive speed wise
342 and space wise to implement in all the macros for
345 It is not expensive for
347 but for the sake of portability, has been limited
348 to the following macros which need
351 .Bl -tag -width 4n -offset indent -compact
353 Configuration declaration (section 4
356 Begin list (for the width specifier).
360 Functions (sections two and four).
372 Optional notes for a reference.
374 Report title (in a reference).
376 Title of article in a book or journal.
379 One way of passing a string
380 containing blank spaces is to use the hard or unpaddable space character
382 that is, a blank space preceded by the escape character
384 This method may be used with any macro but has the side effect
385 of interfering with the adjustment of text
386 over the length of a line.
388 sees the hard space as if it were any other printable character and
389 cannot split the string into blank or newline separated pieces as one
391 The method is useful for strings which are not expected
392 to overlap a line boundary.
394 .Bl -tag -width "fetch(char *str)" -offset indent
395 .It Fn fetch char\ *str
397 .Ql \&.Fn fetch char\e *str
398 .It Fn fetch "char *str"
399 can also be created by
400 .Ql \&.Fn fetch "\\*q*char *str\\*q"
408 would see three arguments and
411 .Dl Fn fetch char *str
413 For an example of what happens when the parameter list overlaps
414 a newline boundary, see the
417 .Ss Trailing Blank Space Characters
419 can be confused by blank space characters at the end of a line.
421 is a wise preventive measure to globally remove all blank spaces
422 from \*[Lt]blank-space\*[Gt]\*[Lt]end-of-line\*[Gt] character sequences.
424 arise to force a blank character at the end of a line,
425 it may be forced with an unpaddable space and the
429 .Ql string\e\ \e\*[Am] .
431 To recognize the end of a sentence,
433 needs two spaces or a newline character.
434 Since it is easy to forget about the second space, policy
435 is to begin new sentences on a new line.
436 .Ss Escaping Special Characters
438 like the newline character
440 are handled by replacing the
448 .Sh THE ANATOMY OF A MAN PAGE
449 The body of a man page is easily constructed from a basic
450 template found in the file:
451 .Bd -literal -offset indent
452 \&.\e" /usr/share/misc/mdoc.template:
453 \&.\e" The following six lines are required.
454 \&.Dd Month day, year
455 \&.Dt DOCUMENT_TITLE SECTION_NUMBER [MACHINE]
458 \&.\e" This next request is for sections 2 and 3 only; see next comment.
462 \&.\e" The following requests should be uncommented and
463 \&.\e" used where appropriate.
464 \&.\e" This next request is for
465 \&.\e" sections 1 and 8 exit statuses only.
466 \&.\e" .Sh EXIT STATUS
467 \&.\e" This next request is for sections 2 and 3 function return
469 \&.\e" .Sh RETURN VALUES
470 \&.\e" This next request is for sections 1, 6, 7 \*[Am] 8 only
471 \&.\e" .Sh ENVIRONMENT
474 \&.\e" This next request is for sections 1, 6, 7 \*[Am] 8 only
475 \&.\e" (command return values (to shell) and
476 \&.\e" fprintf/stderr type diagnostics)
477 \&.\e" .Sh DIAGNOSTICS
478 \&.\e" The next request is for sections 2 and 3 error
479 \&.\e" and signal handling only.
486 \&.\e" .Sh SECURITY CONSIDERATIONS
489 The first items in the template are the macros
490 .Pq Li \&.Dd , \&.Os , \&.Dt ;
492 the operating system the man page or subject source is developed
493 or modified for (should have no argument by default),
494 and the man page title
496 along with the section of the manual the page
497 belongs in, and optionally the machine if it is machine specific.
498 These macros identify the page,
499 and are discussed below in
502 The remaining items in the template are section headers
513 .Sx PAGE STRUCTURE DOMAIN ,
517 Several content macros are used to demonstrate page layout macros;
518 reading about content macros before page layout macros is
521 The title macros are the first portion of the page structure
522 domain, but are presented first and separate for someone who
523 wishes to start writing a man page yesterday.
524 Three header macros designate the document title or manual page title,
525 the operating system,
526 and the date of authorship.
527 These macros are called once at the very beginning of the document
528 and are used to construct the headers and footers only.
530 .It Li \&.Dt DOCUMENT_TITLE SECTION_NUMBER [MACHINE]
531 The document title is the
532 subject of the man page and must be in
536 The section number may be 1,\ ...,\ 9, and the machine should be the
537 machine the man page is for (that is, the
539 port to which it applies).
540 .It Li \&.Os operating_system release#
541 This should have no argument on
543 man pages by default.
544 Otherwise, the name of the operating system
545 should be the common acronym, e.g.
549 The release should be the standard release
550 nomenclature for the system specified, e.g. 4.3, 4.3+Tahoe, V.3,
552 Unrecognized arguments are displayed as given in the page footer.
553 For instance, a typical footer might be:
557 or for a locally produced set
559 .Dl \&.Os CS Department
561 The Berkeley default,
563 without an argument, has been defined as the current
566 .Pa /usr/share/tmac/tmac.doc-common .
569 macro is not present, the bottom left corner of the page
571 .It Li \&.Dd month day, year
572 The date of the last significant revision to the manual page;
573 the date should be written formally:
578 Note that the date must not be placed in quotes!
581 .Ss What's in a name...
582 The manual domain macro names are derived from the day to day
583 informal language used to describe commands, subroutines and related
586 different variations of this language are used to describe
587 the three different aspects of writing a man page.
588 First, there is the description of
591 Second is the description of a
598 description of a command to a user in the verbal sense;
599 that is, discussion of a command in the text of a man page.
603 macros are themselves a type of command;
604 the general syntax for a troff command is:
605 .Bd -literal -offset indent
606 \&.Va argument1 argument2 ... argument9
611 is a macro command or request, and anything following it is an argument to
616 command using the content macros is a
620 command line might be displayed as:
621 .Bd -filled -offset indent
629 is the command name and the
634 argument designated as optional by the option brackets.
644 The macros which formatted the above example:
645 .Bd -literal -offset indent
651 In the third case, discussion of commands and command syntax
652 includes both examples above, but may add more detail.
658 from the example above might be referred to as
662 Some command line argument lists are quite long:
663 .Bl -tag -width make -offset indent
670 .Op Fl I Ar directory
673 .Op Ar variable=value
679 Here one might talk about the command
681 and qualify the argument
683 as an argument to the flag,
685 or discuss the optional
689 In the verbal context, such detail can prevent confusion,
693 does not have a macro for an argument
698 argument macro is used for an operand or file argument like
700 as well as an argument to a flag like
702 The make command line was produced from:
703 .Bd -literal -offset indent
706 \&.Op Fl D Ar variable
708 \&.Op Fl f Ar makefile
709 \&.Op Fl I Ar directory
710 \&.Op Fl j Ar max_jobs
711 \&.Op Ar variable=value
721 macros are explained in
724 The manual domain and general text domain macros share a similar
725 syntax with a few minor deviations:
731 differ only when called without arguments;
735 impose an order on their argument lists
741 have nesting limitations.
743 are capable of recognizing and properly handling punctuation,
744 provided each punctuation character is separated by a leading space.
745 If a request is given:
747 .Dl \&.Li sptr, ptr),
753 The punctuation is not recognized and all is output in the
755 If the punctuation is separated by a leading white space:
757 .Dl \&.Li "sptr , ptr ) ,"
761 .Dl Li sptr , ptr ) ,
763 The punctuation is now recognized and is output in the
764 default font distinguishing it from the strings in literal font.
766 To remove the special meaning from a punctuation character
770 is limited as a macro language, and has difficulty
771 when presented with a string containing
772 a member of the mathematical, logical or
774 .Bd -literal -offset indent-two
775 \&{+,\-,/,*,\&%,\*[Lt],\*[Gt],\*[Le],\*[Ge],=,==,\*[Am],`,',"}
780 may assume it is supposed to actually perform the operation
781 or evaluation suggested by the characters.
782 To prevent the accidental evaluation of these characters,
785 Typical syntax is shown in the first content macro displayed
789 The address macro identifies an address construct
790 of the form addr1[,addr2[,addr3]].
792 .Dl Usage: .Ad address ... \*(Pu
793 .Bl -tag -width ".Ad f1 , f2 , f3 :" -compact -offset 14n
796 .It Li \&.Ad addr1\ .
798 .It Li \&.Ad addr1\ , file2
800 .It Li \&.Ad f1\ , f2\ , f3\ :
802 .It Li \&.Ad addr\ )\ )\ ,
806 It is an error to call
810 is callable by other macros and is parsed.
814 argument macro may be used whenever
815 a command line argument is referenced.
817 .Dl Usage: .Ar argument ... \*(Pu
818 .Bl -tag -width ".Ar file1 file2" -compact -offset 15n
823 .It Li \&.Ar file1\ .
825 .It Li \&.Ar file1 file2
827 .It Li \&.Ar f1 f2 f3\ :
829 .It Li \&.Ar file\ )\ )\ ,
835 is called without arguments
840 macro is parsed and is callable.
841 .Ss Configuration Declaration (section four only)
844 macro is used to demonstrate a
846 declaration for a device interface in a section four manual.
847 This macro accepts quoted arguments (double quotes only).
849 .Bl -tag -width "device le0 at scode?" -offset indent
850 .It Cd "device le0 at scode?"
852 .Ql ".Cd device le0 at scode?" .
855 The command modifier is identical to the
857 (flag) command with the exception
860 macro does not assert a dash
861 in front of every argument.
862 Traditionally flags are marked by the
863 preceding dash, some commands or subsets of commands do not use them.
864 Command modifiers may also be specified in conjunction with interactive
865 commands such as editor commands.
868 .Ss Defined Variables
869 A variable which is defined in an include file is specified
873 .Dl Usage: .Dv defined_variable ... \*(Pu
874 .Bl -tag -width ".Dv MAXHOSTNAMELEN" -compact -offset 14n
875 .It Li ".Dv MAXHOSTNAMELEN"
877 .It Li ".Dv TIOCGPGRP )"
881 It is an error to call
885 is parsed and is callable.
886 .Ss Errno's (Section two only)
889 errno macro specifies the error return value
890 for section two library routines.
896 general text domain macro, as it would be used in
897 a section two manual page.
899 .Dl Usage: .Er ERRNOTYPE ... \*(Pu
900 .Bl -tag -width ".Bq Er ENOTDIR" -compact -offset 14n
903 .It Li \&.Er ENOENT\ )\ ;
905 .It Li \&.Bq \&Er ENOTDIR
909 It is an error to call
914 macro is parsed and is callable.
915 .Ss Environment Variables
918 macro specifies an environment variable.
920 .Dl Usage: .Ev argument ... \*(Pu
921 .Bl -tag -width ".Ev PRINTER ) ) ," -compact -offset 14n
926 .It Li \&.Ev PRINTER\ )\ )\ ,
930 It is an error to call
935 macro is parsed and is callable.
936 .Ss Function Argument
939 macro is used to refer to function arguments (parameters)
942 section of the manual or inside
945 section should a parameter list be too
948 macro and the enclosure macros
954 may also be used to refer to structure members.
956 .Dl Usage: .Fa function_argument ... \*(Pu
957 .Bl -tag -width ".Fa d_namlen\ )\ )\ ," -compact -offset 14n
958 .It Li \&.Fa d_namlen\ )\ )\ ,
964 It is an error to call
968 is parsed and is callable.
969 .Ss Function Declaration
974 section with section two, three or nine
978 macro does not call other macros and is not callable by other
981 .Dl Usage: .Fd include_file (or defined variable)
987 request causes a line break if a function has already been presented
988 and a break has not occurred.
989 This leaves a nice vertical space
990 in between the previous function call and the declaration for the
995 macro handles command line flags.
1000 For interactive command flags, which
1001 are not prepended with a dash, the
1004 macro is identical, but without the dash.
1006 .Dl Usage: .Fl argument ... \*(Pu
1007 .Bl -tag -width ".Fl \-s \-t \-v" -compact -offset 14n
1018 .It Li \&.Fl xyz\ )\ ,
1024 macro without any arguments results
1025 in a dash representing stdin/stdout.
1028 a single dash, will result in two dashes.
1031 macro is parsed and is callable.
1032 .Ss Functions (library routines)
1035 macro is modeled on ANSI C conventions.
1037 Usage: .Fn [type] function [[type] parameters ... \*(Pu]
1039 .Bl -tag -width ".Fn .int align. .const * char *sptrsxx" -compact
1040 .It Li "\&.Fn getchar"
1042 .It Li "\&.Fn strlen ) ,"
1044 .It Li \&.Fn "\\*qint align\\*q" "\\*qconst * char *sptrs\\*q" ,
1045 .Fn "int align" "const * char *sptrs" ,
1048 It is an error to call
1050 without any arguments.
1054 is parsed and is callable,
1055 note that any call to another macro signals the end of
1058 call (it will close-parenthesis at that point).
1060 For functions that have more than eight parameters (and this
1071 to get around the limitation.
1073 .Bd -literal -offset indent
1082 \&.Fa "struct rrec *newrr"
1089 .Bd -filled -offset indent
1098 .Fa "struct rrec *newrr"
1108 macros are parsed and are callable.
1111 section, the function will always begin at
1112 the beginning of line.
1113 If there is more than one function
1116 section and a function type has not been
1117 given, a line break will occur, leaving a nice vertical space
1118 between the current function name and the one prior.
1121 does not check its word boundaries
1122 against troff line lengths and may split across a newline
1124 This will be fixed in the near future.
1126 This macro is intended for the
1130 anywhere else in the man page without problems, but its main purpose
1131 is to present the function type in kernel normal form for the
1133 of sections two and three
1134 (it causes a page break allowing the function name to appear
1137 .Dl Usage: .Ft type ... \*(Pu
1138 .Bl -tag -width "\&.Ft struct stat" -offset 14n -compact
1139 .It Li \&.Ft struct stat
1145 request is not callable by other macros.
1151 macro is the short form for
1152 .Dl Li \&.Ft #include <header.h> .
1153 It specifies the C\~header file as being included in a C\~program.
1154 It also causes a line break, and is neither callable nor parsed.
1156 .Dl Usage: .In Ao header file Ac
1158 .Bl -tag -width ".Li .In\ stdio.h" -compact -offset 15n
1159 .It Li ".In stdio.h"
1163 .Ss Interactive Commands
1166 macro designates an interactive or internal command.
1168 .Dl Usage: .Ic command ... \*(Pu
1169 .Bl -tag -width ".Ic setenv , unsetenvxx" -compact -offset 14n
1172 .It Li \&.Ic do while {...}
1174 .It Li \&.Ic setenv\ , unsetenv
1175 .Ic setenv , unsetenv
1178 It is an error to call
1183 macro is parsed and is callable.
1187 literal macro may be used for special characters,
1188 variable constants, anything which should be displayed as it
1191 .Dl Usage: .Li argument ... \*(Pu
1192 .Bl -tag -width ".Li cntrl-D ) ," -compact -offset 14n
1195 .It Li \&.Li M1 M2 M3\ ;
1197 .It Li \&.Li cntrl-D\ )\ ,
1199 .It Li \&.Li 1024\ ...
1205 macro is parsed and is callable.
1209 macro is used for the document title or subject name.
1210 It has the peculiarity of remembering the first
1211 argument it was called with, which should
1212 always be the subject name of the page.
1216 regurgitates this initial name for the sole purpose
1217 of making less work for the author.
1218 If trailing punctuation is required with this feature,
1221 as a first argument to
1224 a section two, three or nine document function name is addressed with the
1232 and remaining sections.
1233 For interactive commands, such as the
1239 macro should be used.
1245 it can not recall the first argument it was invoked with.
1247 .Dl Usage: .Nm argument ... \*(Pu
1248 .Bl -tag -width ".Nm mdoc.samples" -compact -offset 14n
1249 .It Li \&.Nm mdoc.samples
1251 .It Li \&.Nm \e-mdoc
1253 .It Li \&.Nm foo\ )\ )\ ,
1257 .It Li \&.Nm \&"\&"\ :
1263 macro is parsed and is callable.
1268 places option brackets around the any remaining arguments on the command
1269 line, and places any
1270 trailing punctuation outside the brackets.
1275 may be used across one or more lines.
1277 .Dl Usage: .Op options ... \*(Pu
1278 .Bl -tag -width ".Op Fl c Ar objfil Op Ar corfil ," -compact -offset indent
1283 .It Li ".Op Fl k ) ."
1285 .It Li ".Op Fl k Ar kookfile"
1286 .Op Fl k Ar kookfile
1287 .It Li ".Op Fl k Ar kookfile ,"
1288 .Op Fl k Ar kookfile ,
1289 .It Li ".Op Ar objfil Op Ar corfil"
1290 .Op Ar objfil Op Ar corfil
1291 .It Li ".Op Fl c Ar objfil Op Ar corfil ,"
1292 .Op Fl c Ar objfil Op Ar corfil ,
1293 .It Li \&.Op word1 word2
1302 .Bd -literal -offset indent
1304 \&.Op \&Fl k \&Ar kilobytes
1305 \&.Op \&Fl i \&Ar interval
1306 \&.Op \&Fl c \&Ar count
1312 .Op Fl k Ar kilobytes
1313 .Op Fl i Ar interval
1322 are parsed and are callable.
1326 macro formats path or file names.
1328 .Dl Usage: .Pa pathname \*(Pu
1329 .Bl -tag -width ".Pa /tmp/fooXXXXX ) ." -compact -offset 14n
1330 .It Li \&.Pa /usr/share
1332 .It Li \&.Pa /tmp/fooXXXXX\ )\ .
1333 .Pa /tmp/fooXXXXX ) .
1338 macro is parsed and is callable.
1340 Generic variable reference:
1342 .Dl Usage: .Va variable ... \*(Pu
1343 .Bl -tag -width ".Va char s ] ) ) ," -compact -offset 14n
1346 .It Li \&.Va settimer ,
1348 .It Li \&.Va int\ *prt\ )\ :
1350 .It Li \&.Va char\ s\ ]\ )\ )\ ,
1354 It is an error to call
1356 without any arguments.
1359 macro is parsed and is callable.
1360 .Ss Manual Page Cross References
1363 macro expects the first argument to be
1364 a manual page name, and the second argument, if it exists,
1365 to be either a section page number or punctuation.
1367 remaining arguments are assumed to be punctuation.
1369 .Dl Usage: .Xr man_page [1,...,9] \*(Pu
1370 .Bl -tag -width ".Xr mdoc 7 ) ) ," -compact -offset 14n
1373 .It Li \&.Xr mdoc\ ,
1377 .It Li \&.Xr mdoc 7\ )\ )\ ,
1383 macro is parsed and is callable.
1384 It is an error to call
1388 .Sh GENERAL TEXT DOMAIN
1390 .Bd -literal -offset indent -compact
1391 Usage: .At [v1 .. v7 | 32v | V.1 | V.4] ... \*(Pu
1393 .Bl -tag -width ".At v6 ) ," -compact -offset 14n
1407 It accepts at most two arguments.
1409 .Dl Usage: .Bx [Version/release] ... \*(Pu
1410 .Bl -tag -width ".Bx 4.3 ) ," -compact -offset 14n
1419 macro is parsed and is callable.
1421 .Dl Usage: .Bsx [Version/release] ... \*(Pu
1422 .Bl -tag -width ".Bsx 4.1 ) ," -compact -offset 14n
1431 macro is parsed and is callable.
1433 .Dl Usage: .Fx [Version/release] ... \*(Pu
1434 .Bl -tag -width ".Fx 2.2 ) ," -compact -offset 14n
1443 macro is parsed and is callable.
1445 .Dl Usage: .Nx [Version/release] ... \*(Pu
1446 .Bl -tag -width ".Nx 1.4 ) ," -compact -offset 14n
1455 macro is parsed and is callable.
1457 .Dl Usage: .Ox [Version/release] ... \*(Pu
1458 .Bl -tag -width ".Ox 2.7 ) ," -compact -offset 14n
1467 macro is parsed and is callable.
1469 .Dl Usage: .Ux ... \*(Pu
1470 .Bl -tag -width ".Ux 4.3 ) ," -compact -offset 14n
1477 macro is parsed and is callable.
1479 Text may be stressed or emphasized with the
1482 The usual font for emphasis is italic.
1484 .Dl Usage: .Em argument ... \*(Pu
1485 .Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n
1486 .It Li ".Em does not"
1488 .It Li ".Em exceed 1024 ."
1490 .It Li ".Em vide infra ) ) ,"
1491 .Em vide infra ) ) ,
1494 .\" The emphasis can be forced across several lines of text by using
1497 .\" macro discussed in
1500 .\" .Sx PAGE STRUCTURE DOMAIN .
1503 .\" We are certain the reason most people desire a Harvard MBA
1504 .\" so they can become to be successful philanthropists.
1505 .\" Only mathematicians and physicists go to graduate school strictly
1506 .\" to acquire infinite wealthy and fame.
1507 .\" It's that infinity word that does it to them.
1513 macro is parsed and is callable.
1514 It is an error to call
1517 .Ss Enclosure and Quoting Macros
1518 The concept of enclosure is similar to quoting.
1519 The object being to enclose one or more strings between
1520 a pair of characters like quotes or parentheses.
1521 The terms quoting and enclosure are used
1522 interchangeably throughout this document.
1524 one line enclosure macros end
1527 to give a hint of quoting, but there are a few irregularities.
1528 For each enclosure macro
1529 there is also a pair of open and close macros which end
1535 These can be used across one or more lines of text
1536 and while they have nesting limitations, the one line quote macros
1541 .Bd -filled -offset indent
1542 .Bl -column "quote " "close " "open " "Enclose Stringx(in XX) " XXstringXX
1543 .Em " Quote Close Open Function Result"
1544 .It Li ".Aq .Ac .Ao" Ta No Angle Bracket Enclosure \*[Lt]string\*[Gt]
1545 .It Li ".Bq .Bc .Bo" Ta No Bracket Enclosure [string]
1546 .It Li ".Dq .Dc .Do" Ta No Double Quote ``string''
1547 .It Li ".Ec .Eo " Ta No Enclose String (in XX) XXstringXX
1548 .It Li ".Pq .Pc .Po" Ta No Parenthesis Enclosure (string)
1549 .It Li ".Ql " Ta No Quoted Literal `st' or string
1550 .It Li ".Qq .Qc .Qo" Ta No Straight Double Quote "string"
1551 .It Li ".Sq .Sc .So" Ta No Single Quote `string'
1555 Except for the irregular macros noted below, all
1556 of the quoting macros are parsed and callable.
1557 All handle punctuation properly, as long as it
1558 is presented one character at a time and separated by spaces.
1559 The quoting macros examine opening and closing punctuation
1560 to determine whether it comes before or after the
1562 This makes some nesting possible.
1563 .Bl -tag -width xxx,xxxx
1564 .It Li \&.Ec , \&.Eo
1565 These macros expect the first argument to be the
1566 opening and closing strings respectively.
1568 The quoted literal macro behaves differently for
1574 a quoted literal is always quoted.
1575 If formatted with troff, an item is only quoted if the width
1576 of the item is less than three constant width characters.
1577 This is to make short strings more visible where the font change
1578 to literal (constant width) is less noticeable.
1580 The prefix macro is not callable, but it is parsed:
1581 .Bl -tag -width "(namexx" -offset indent
1582 .It Li ".Pf ( Fa name2"
1589 (no space) macro, which
1592 performs the analogous suffix function.
1596 macro inserts an apostrophe and exits any special text modes,
1603 Examples of quoting:
1604 .Bl -tag -width ".Aq Pa ctype.h ) ,xxxxxxxx" -compact -offset indent
1607 .It Li \&.Aq \&Ar ctype.h\ )\ ,
1611 .It Li \&.Bq \&Em Greek \&, French \&.
1612 .Bq Em Greek , French .
1615 .It Li ".Dq string abc ."
1617 .It Li ".Dq \'^[A-Z]\'"
1619 .It Li "\&.Ql man mdoc"
1623 .It Li "\&.Qq string ) ,"
1625 .It Li "\&.Qq string Ns ),"
1629 .It Li "\&.Sq string
1631 .It Li "\&.Em or Ap ing
1635 For a good example of nested enclosure macros, see the
1638 It was created from the same
1639 underlying enclosure macros as those presented in the list
1645 extended argument list macros
1646 were also built from the same underlying routines and are a good
1649 macro usage at its worst.
1650 .Ss No\-Op or Normal Text Macro
1654 a hack for words in a macro command line which should
1656 be formatted and follows the conventional syntax
1661 macro eliminates unwanted spaces in between macro requests.
1662 It is useful for old style argument lists where there is no space
1663 between the flag and argument:
1664 .Bl -tag -width ".Op Fl I Ns Ar directoryxx" -offset indent
1665 .It Li ".Op Fl I Ns Ar directory"
1667 .Op Fl I Ns Ar directory
1672 macro always invokes the
1674 macro after eliminating the space unless another macro name
1678 is parsed and is callable.
1679 .Ss Section Cross References
1682 macro designates a reference to a section header
1683 within the same document.
1684 It is parsed and is callable.
1686 .Bl -tag -width "Li \&.Sx FILES" -offset 14n
1691 The symbolic emphasis macro is generally a boldface macro in
1692 either the symbolic sense or the traditional English usage.
1694 .Dl Usage: .Sy symbol ... \*(Pu
1695 .Bl -tag -width ".Sy Important Noticex" -compact -offset 14n
1696 .It Li \&.Sy Important Notice
1697 .Sy Important Notice
1702 macro is parsed and is callable.
1706 .Ss References and Citations
1707 The following macros make a modest attempt to handle references.
1708 At best, the macros make it convenient to manually drop in a subset of
1709 refer style references.
1711 .Bl -tag -width 6n -offset indent -compact
1714 Causes a line break and begins collection
1715 of reference information until the
1716 reference end macro is read.
1719 The reference is printed.
1721 Reference author name, one name per invocation.
1733 Optional information.
1744 The macros beginning with
1746 are not callable, and are parsed only for the trade name macro which
1747 returns to its caller.
1748 (And not very predictably at the moment either.)
1749 The purpose is to allow trade names
1750 to be pretty printed in
1751 .Xr troff 1 Ns / Ns Ic ditroff
1753 .Ss Trade Names (or Acronyms and Type Names)
1754 The trade name macro is generally a small caps macro for
1755 all upper case words longer than two characters.
1757 .Dl Usage: .Tn symbol ... \*(Pu
1758 .Bl -tag -width ".Tn ASCII" -compact -offset 14n
1768 is parsed and is callable by other macros.
1769 .Ss Extended Arguments
1774 macros allow one to extend an argument list
1775 on a macro boundary.
1776 Argument lists cannot
1777 be extended within a macro
1778 which expects all of its arguments on one line such
1782 Here is an example of
1784 using the space mode macro to turn spacing off:
1785 .Bd -literal -offset indent
1787 \&.It Xo Sy I Ar operation
1788 \&.No \een Ar count No \een
1794 .Bd -filled -offset indent
1795 .Bl -tag -width flag -compact
1797 .It Xo Sy I Ar operation
1798 .No \en Ar count No \en
1805 .Bd -literal -offset indent
1807 \&.It Cm S No \&/ Ar old_pattern Xo
1808 \&.No \&/ Ar new_pattern
1815 .Bd -filled -offset indent
1816 .Bl -tag -width flag -compact
1818 .It Cm S No \&/ Ar old_pattern Xo
1819 .No \&/ Ar new_pattern
1828 and using enclosure macros:
1829 Test the value of an variable.
1830 .Bd -literal -offset indent
1833 \&.Oo \e\*[Am]! Oc Ns Ar variable
1834 \&.Op Ar operator variable ...
1839 .Bd -filled -offset indent
1840 .Bl -tag -width flag -compact
1843 .Oo \&! Oc Ns Ar variable
1844 .Op Ar operator variable ...
1849 All of the above examples have used the
1851 macro on the argument list of the
1855 The extend macros are not used very often, and when they are
1856 it is usually to extend the list-item argument list.
1857 Unfortunately, this is also where the extend macros are the
1859 In the first two examples, spacing was turned off;
1860 in the third, spacing was desired in part of the output but
1862 To make these macros work in this situation make sure
1867 macros are placed as shown in the third example.
1870 macro is not alone on the
1872 argument list, spacing will be unpredictable.
1876 must not occur as the first or last macro on a line
1878 Out of 900 manual pages (about 1500 actual pages)
1879 currently released with
1881 only fifteen use the
1884 .Sh PAGE STRUCTURE DOMAIN
1888 section header macros
1889 listed below are required in every
1891 The remaining section headers
1892 are recommended at the discretion of the author
1893 writing the manual page.
1896 macro can take up to nine arguments.
1897 It is parsed but is not callable.
1898 .Bl -tag -width ".Sh SYNOPSIS"
1904 the headers, footers and page layout defaults
1905 will not be set and things will be rather unpleasant.
1908 section consists of at least three items.
1911 name macro naming the subject of the man page.
1912 The second is the Name Description macro,
1914 which separates the subject
1915 name from the third item, which is the description.
1917 description should be the most terse and lucid possible,
1918 as the space available is small.
1919 .It Li \&.Sh SYNOPSIS
1922 section describes the typical usage of the
1923 subject of a man page.
1939 for manual page sections 2 and 3, the command and general
1942 is required for sections 1, 5, 6, 7, 8.
1943 Section 4 manuals require a
1947 configuration device usage macro.
1948 Several other macros may be necessary to produce
1949 the synopsis line as shown below:
1951 .Bd -filled -offset indent
1958 The following macros were used:
1961 .Dl \&.Op \&Fl benstuv
1971 recognize the pipe bar character
1973 so a command line such as:
1975 .Dl ".Op Fl a | Fl b"
1977 will not go orbital.
1979 normally interprets a \*(Ba as a special operator.
1981 .Sx PREDEFINED STRINGS
1983 character in other situations.
1984 .It Li \&.Sh DESCRIPTION
1985 In most cases the first text in the
1988 is a brief paragraph on the command, function or file,
1989 followed by a lexical list of options and respective
1991 To create such a list, the
1998 macros are used (see
1999 .Sx Lists and Columns
2005 section headers are part of the
2006 preferred manual page layout and must be used appropriately
2007 to maintain consistency.
2008 They are listed in the order
2009 in which they would be used.
2010 .Bl -tag -width SYNOPSIS
2011 .It Li \&.Sh ENVIRONMENT
2014 section should reveal any related
2016 variables and clues to their behavior and/or usage.
2017 .It Li \&.Sh EXAMPLES
2018 There are several ways to create examples.
2025 Files which are used or created by the man page subject
2026 should be listed via the
2031 .It Li \&.Sh SEE ALSO
2032 References to other material on the man page topic and
2033 cross references to other relevant man pages should
2038 are specified using the
2043 style references are not accommodated.
2045 It is recommended that the cross references are sorted on the section
2046 number, and then alphabetically on the names within a section.
2047 .It Li \&.Sh STANDARDS
2048 If the command, library function or file adheres to a
2049 specific implementation such as
2053 this should be noted here.
2055 command does not adhere to any standard, its history
2056 should be noted in the
2059 .It Li \&.Sh HISTORY
2060 Any command which does not adhere to any specific standards
2061 should be outlined historically in this section.
2062 .It Li \&.Sh AUTHORS
2063 Credits, if need be, should be placed here.
2064 .It Li \&.Sh DIAGNOSTICS
2065 Diagnostics from a command should be placed in this section.
2067 Specific error handling, especially from library functions
2068 (man page sections 2 and 3) should go here.
2071 macro is used to specify an errno.
2073 Blatant problems with the topic go here...
2078 sections may be added,
2079 for example, this section was set with:
2080 .Bd -literal -offset 14n
2081 \&.Sh PAGE STRUCTURE DOMAIN
2083 .Ss Paragraphs and Line Spacing.
2088 paragraph command may
2089 be used to specify a line space where necessary.
2090 The macro is not necessary after a
2100 macro asserts a vertical distance unless the -compact flag is given).
2102 .\" This worked with version one, need to redo for version three
2105 .\" .Cw (ax+bx+c) \ is\ produced\ by\ \&
2106 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2123 .\" .Em is produced by
2139 .\" This example shows the same equation in a different format.
2143 .\" signs were forced with
2147 .\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
2148 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2159 .\" .Li \&.Cx \e\ +\e\ \e&
2170 .\" .Em is produced by
2178 .\" .Li \&.Cx \e\ +\e\ \e&
2189 .\" The incantation below was
2195 .\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
2197 .\" .Li \&.Cx Op Sy ?/
2207 .\" .Em is produced by
2209 .\" .Li \&.Ar \e\ b1 e1 f1
2221 The only keep that is implemented at this time is for words.
2228 The only option that
2232 and is useful for preventing line breaks in the middle of options.
2233 In the example for the make command line arguments (see
2234 .Sx What's in a name ) ,
2238 flag and the argument
2240 (Actually, the option macro formerly prevented this from occurring,
2241 but was dropped when the decision (religious) was made to force
2242 right justified margins in
2244 as options in general look atrocious when spread across a sparse
2246 More work needs to be done with the keep macros, a
2248 option needs to be added.)
2249 .Ss Examples and Displays
2250 There are six types of displays: a quickie, one-line indented display
2252 a quickie, one-line literal display
2254 and block-literal, block-filled, block-unfilled, and block-ragged which use
2262 .Bl -tag -width \&.Dlxx
2264 (D-one) Display one line of indented text.
2265 This macro is parsed, but it is not callable.
2269 The above was produced by:
2270 .Li \&.D1 \&Fl ldghfstru .
2273 Display one line of indented
2278 example macro has been used throughout this
2281 the indent (display) of one line of text.
2282 Its default font is set to
2283 constant width (literal) however
2284 it is parsed and will recognize other macros.
2285 It is however not callable.
2287 .Dl % ls -ldg /usr/local/bin
2289 The above was produced by:
2290 .Li \&.Dl % ls -ldg /usr/local/bin .
2295 display must be ended with the
2298 Displays may be nested within lists, but may
2300 contain other displays; this also prohibits nesting
2307 has the following syntax:
2309 .Dl ".Bd display-type [-offset offset_value] [-compact]"
2311 The display-type must be one of the four types
2312 .Fl ( ragged , unfilled , filled , literal )
2313 and may have an offset specifier for indentation:
2316 .Bl -tag -width "file file_name " -compact
2318 Fill, but do not adjust the right margin.
2320 Do not fill: display a block of text as typed, the
2321 right (and left) margin edges are left ragged.
2323 Display a filled (formatted) block.
2324 The block of text is formatted (the edges are filled \-
2325 not left unjustified).
2327 Display a literal block, useful for source code or
2328 simple tabbed or spaced text.
2329 .It Fl file Ar file_name
2330 The file name following the
2332 flag is read and displayed.
2334 asserted and tabs are set at 8 constant width character
2335 intervals, however any
2336 .Xr troff 1 Ns / Ns Nm \-mdoc
2337 commands in file will be processed.
2338 .It Fl offset Ar string
2341 is specified with one of the following strings, the string
2342 is interpreted to indicate the level of indentation for the
2343 forthcoming block of text:
2345 .Bl -tag -width "indent-two" -compact
2347 Align block on the current left margin,
2348 this is the default mode of
2351 Supposedly center the block.
2353 unfortunately, the block merely gets
2354 left aligned about an imaginary center margin.
2356 Indents by one default indent value or tab.
2358 indent value is also used for the
2360 display so one is guaranteed the two types of displays
2362 This indent is normally set to 6n or about two
2363 thirds of an inch (six constant width characters).
2365 Indents two times the default indent value.
2369 aligns the block about two inches from
2370 the right side of the page.
2372 work and perhaps may never do the right thing by
2379 .Ss Tagged Lists and Columns
2380 There are several types of lists which may be initiated with the
2383 Items within the list
2384 are specified with the
2387 each list must end with the
2392 may be nested within themselves and within displays.
2393 The use of columns inside of lists or lists inside of columns
2396 In addition, several list attributes may be specified such as
2397 the width of a tag, the list offset, and compactness
2398 (blank lines between items allowed or disallowed).
2399 Most of this document has been formatted with a tag style list
2401 For a change of pace, the list-type used to present the list-types
2402 is an over-hanging list
2404 This type of list is quite popular with
2406 users, but might look a bit funny after having read many pages of
2408 The following list types are accepted by
2417 These five are the simplest types of lists.
2420 macro has been given, items in the list are merely
2421 indicated by a line consisting solely of the
2424 For example, the source text for a simple enumerated list
2426 .Bd -literal -offset indent-two
2427 \&.Bl -enum -compact
2429 \&Item one goes here.
2431 \&And item two here.
2433 \&Lastly item three goes here.
2439 .Bl -enum -offset indent-two -compact
2445 Lastly item three goes here.
2448 A simple bullet list construction:
2449 .Bd -literal -offset indent-two
2450 \&.Bl -bullet -compact
2452 \&Bullet one goes here.
2459 .Bl -bullet -offset indent-two -compact
2461 Bullet one goes here.
2471 These list-types collect arguments specified with the
2473 macro and create a label which may be
2475 into the forthcoming text,
2477 from the forthcoming text,
2479 from above and not indented or
2482 list was constructed with the
2487 macro is parsed only for the inset, hang
2488 and tag list-types and is not callable.
2489 Here is an example of inset labels:
2490 .Bl -inset -offset indent
2492 The tagged list (also called a tagged paragraph) is the
2493 most common type of list used in the Berkeley manuals.
2496 attribute as described below.
2498 Diag lists create section four diagnostic lists
2499 and are similar to inset lists except callable
2502 Hanged labels are a matter of taste.
2504 Overhanging labels are nice when space is constrained.
2506 Inset labels are useful for controlling blocks of
2507 paragraphs and are valuable for converting
2509 manuals to other formats.
2512 Here is the source text which produced the above example:
2513 .Bd -literal -offset indent
2514 \&.Bl -inset -offset indent
2516 \&The tagged list (also called a tagged paragraph) is the
2517 \&most common type of list used in the Berkeley manuals.
2520 \&attribute as described below.
2522 \&Diag lists create section four diagnostic lists
2523 \&and are similar to inset lists except callable
2524 \¯os are ignored.
2526 \&Hanged labels are a matter of taste.
2528 \&Overhanging labels are nice when space is constrained.
2530 \&Inset labels are useful for controlling blocks of
2531 \¶graphs and are valuable for converting
2533 \&manuals to other formats.
2537 Here is a hanged list with just two items:
2538 .Bl -hang -offset indent
2540 labels appear similar to tagged lists when the
2541 label is smaller than the label width.
2542 .It Em Longer hanged list labels
2543 blend in to the paragraph unlike
2544 tagged paragraph labels.
2547 And the unformatted text which created it:
2548 .Bd -literal -offset indent
2549 \&.Bl -hang -offset indent
2551 \&labels appear similar to tagged lists when the
2552 \&label is smaller than the label width.
2553 \&.It Em Longer hanged list labels
2554 \&blend in to the paragraph unlike
2555 \&tagged paragraph labels.
2559 The tagged list which follows uses a width specifier to control
2560 the width of the tag.
2562 .Bl -tag -width "PAGEIN" -compact -offset indent
2564 sleep time of the process (seconds blocked)
2568 resulting from references
2569 by the process to pages not loaded in core.
2571 numerical user-id of process owner
2573 numerical id of parent of process priority
2574 (non-positive when in non-interruptible wait)
2578 .Bd -literal -offset indent
2579 \&.Bl -tag -width "PAGEIN" -compact -offset indent
2581 \&sleep time of the process (seconds blocked)
2585 \&resulting from references
2586 \&by the process to pages not loaded in core.
2588 \&numerical user-id of process owner
2590 \&numerical id of parent of process priority
2591 \&(non-positive when in non-interruptible wait)
2595 Acceptable width specifiers:
2596 .Bl -tag -width Ar -offset indent
2597 .It Fl width Ar "\&Fl"
2598 sets the width to the default width for a flag.
2600 macros have a default width value.
2604 set to ten constant width characters or about five sixth of
2606 .It Fl width Ar "24n"
2607 sets the width to 24 constant width characters or about two
2611 is absolutely necessary for the scaling to work correctly.
2612 .It Fl width Ar "ENAMETOOLONG"
2613 sets width to the constant width length of the
2615 .It Fl width Ar "\\*qint mkfifo\\*q"
2616 again, the width is set to the constant width of the string
2620 If a width is not specified for the tag list type, the first
2623 is invoked, an attempt is made to determine an appropriate
2625 If the first argument to
2627 is a callable macro, the default width for that macro will be used
2628 as if the macro name had been supplied as the width.
2630 if another item in the list is given with a different callable
2631 macro name, a new and nested list is assumed.
2632 This effectively means that
2634 is required for the tag list type.
2637 This list type generates multiple columns.
2638 The number of columns and the width of each column is determined by
2639 the arguments to the
2644 argument is parsed to make a row, each column within the
2645 row is a separate argument separated by a tab or the
2650 .Bl -column "String" "Nroff" "Troff" -offset indent
2651 .It Sy "String" Ta Sy "Nroff" Ta Sy "Troff"
2652 .It Li "\*[Le]" Ta \&\*[Lt]\&= Ta \*[Le]
2653 .It Li "\*[Ge]" Ta \&\*[Gt]\&= Ta \*[Ge]
2657 .Bd -literal -offset indent
2658 \&.Bl -column "String" "Nroff" "Troff" -offset indent
2659 \&.It Sy "String" Ta Sy "Nroff" Ta Sy "Troff"
2660 \&.It Li "\*[Le]" Ta \e\*[Am]\*[Lt]\e\*[Am]= Ta \e*(\*[Le]
2661 \&.It Li "\*[Ge]" Ta \e\*[Am]\*[Gt]\e\*[Am]= Ta \e*(\*[Ge]
2664 .Sh PREDEFINED STRINGS
2665 The following strings are predefined and may be used by
2666 preceding with the troff string interpreting sequence
2670 is the name of the defined string or as
2674 is the name of the string.
2675 The interpreting sequence may be used any where in the text.
2677 .Bl -column "String " "Nroff " "Troff " -offset indent
2678 .It Sy "String Nroff Troff"
2679 .It Li "\*[Le]" Ta \&\*[Lt]\&= Ta \*[Le]
2680 .It Li "\*[Ge]" Ta \&\*[Gt]\&= Ta \*[Ge]
2681 .It Li "Rq" Ta "''" Ta \*(Rq
2682 .It Li "Lq" Ta "``" Ta \*(Lq
2683 .It Li "ua" Ta ^ Ta \*(ua
2684 .It Li "aa" Ta ' Ta \*(aa
2685 .It Li "ga" Ta \` Ta \*(ga
2686 .\" .It Li "sL" Ta ` Ta \*(sL
2687 .\" .It Li "sR" Ta ' Ta \*(sR
2688 .It Li "q" Ta \&" Ta \*q
2689 .It Li "Pi" Ta pi Ta \*(Pi
2690 .It Li "Ne" Ta != Ta \*(Ne
2691 .It Li "Le" Ta \*[Le] Ta \*(Le
2692 .It Li "Ge" Ta \*[Ge] Ta \*(Ge
2693 .It Li "Lt" Ta \*[Lt] Ta \*(Gt
2694 .It Li "Gt" Ta \*[Gt] Ta \*(Lt
2695 .It Li "Pm" Ta +- Ta \*(Pm
2696 .It Li "If" Ta infinity Ta \*(If
2697 .It Li "Na" Ta \fINaN\fP Ta \*(Na
2698 .It Li "Ba" Ta \fR\&|\fP Ta \*(Ba
2704 should be written as
2706 since it is only one char.
2708 The debugging facilities for
2710 are limited, but can help detect subtle errors such
2711 as the collision of an argument name with an internal
2712 register or macro name.
2714 A register is an arithmetic storage class for
2716 with a one or two character name.
2717 All registers internal to
2723 are two characters and
2724 of the form \*[Lt]upper_case\*[Gt]\*[Lt]lower_case\*[Gt] such as
2726 \*[Lt]lower_case\*[Gt]\*[Lt]upper_case\*[Gt] as
2729 \*[Lt]upper or lower letter\*[Gt]\*[Lt]digit\*[Gt] as
2731 And adding to the muddle,
2733 has its own internal registers all of which are either
2734 two lower case characters or a dot plus a letter or meta-character
2736 In one of the introduction examples, it was shown how to
2737 prevent the interpretation of a macro name with the escape sequence
2739 This is sufficient for the internal register names also.
2741 .\" Every callable macro name has a corresponding register
2742 .\" of the same name (<upper_case><lower_case>).
2743 .\" There are also specific registers which have
2744 .\" been used for stacks and arrays and are listed in the
2746 .\" .Bd -ragged -offset 4n
2747 .\" [A-Z][a-z] registers corresponding to macro names (example ``Ar'')
2748 .\" [a-z][A-Z] registers corresponding to macro names (example ``aR'')
2749 .\" C[0-9] argument types (example C1)
2750 .\" O[0-9] offset stack (displays)
2751 .\" h[0-9] horizontal spacing stack (lists)
2752 .\" o[0-9] offset (stack) (lists)
2753 .\" t[0-9] tag stack (lists)
2754 .\" v[0-9] vertical spacing stack (lists)
2755 .\" w[0-9] width tag/label stack
2758 If a non-escaped register name is given in the argument list of a request
2759 unpredictable behavior will occur.
2760 In general, any time huge portions
2761 of text do not appear where expected in the output, or small strings
2762 such as list tags disappear, chances are there is a misunderstanding
2763 about an argument type in the argument list.
2764 Your mother never intended for you to remember this evil stuff - so here
2765 is a way to find out whether or not your arguments are valid: The
2768 macro displays the interpretation of the argument list for most
2773 macro do not contain debugging information.
2774 All of the callable macros do,
2775 and it is strongly advised whenever in doubt,
2780 .Dl Usage: \&.Db [on | off]
2782 An example of a portion of text with
2783 the debug macro placed above and below an
2784 artificially created problem (a flag argument
2789 .Bd -literal -offset indent
2791 \&.Op Fl aC Ar file )
2795 The resulting output:
2796 .Bd -literal -offset indent
2798 DEBUG(argv) MACRO: `.Op' Line #: 2
2799 Argc: 1 Argv: `Fl' Length: 2
2800 Space: `' Class: Executable
2801 Argc: 2 Argv: `aC' Length: 2
2802 Space: `' Class: Executable
2803 Argc: 3 Argv: `Ar' Length: 2
2804 Space: `' Class: Executable
2805 Argc: 4 Argv: `file' Length: 4
2806 Space: ` ' Class: String
2807 Argc: 5 Argv: `)' Length: 1
2808 Space: ` ' Class: Closing Punctuation or suffix
2809 MACRO REQUEST: .Op Fl aC Ar file )
2813 The first line of information tells the name of the calling
2816 and the line number it appears on.
2817 If one or more files are involved
2818 (especially if text from another file is included) the line number
2820 If there is only one file, it should be accurate.
2821 The second line gives the argument count, the argument
2824 If the length of an argument is two characters, the
2825 argument is tested to see if it is executable (unfortunately, any
2826 register which contains a non-zero value appears executable).
2827 The third line gives the space allotted for a class, and the
2829 The problem here is the argument
2831 should not be executable.
2832 The four types of classes are string, executable, closing
2833 punctuation and opening punctuation.
2834 The last line shows the entire
2835 argument list as it was read.
2836 In this next example, the offending
2839 .Bd -literal -offset indent
2841 \&.Em An escaped \e\*[Am]aC
2844 .Bd -literal -offset indent
2846 DEBUG(fargv) MACRO: `.Em' Line #: 2
2847 Argc: 1 Argv: `An' Length: 2
2848 Space: ` ' Class: String
2849 Argc: 2 Argv: `escaped' Length: 7
2850 Space: ` ' Class: String
2851 Argc: 3 Argv: `aC' Length: 2
2852 Space: ` ' Class: String
2853 MACRO REQUEST: .Em An escaped \*[Am]aC
2859 shows up with the same length of 2 as the
2861 sequence produces a zero width, but a register
2864 was not found and the type classified as string.
2866 Other diagnostics consist of usage statements and are self explanatory.
2867 .Sh GROFF, TROFF AND NROFF
2870 package does not need compatibility mode with
2873 The package inhibits page breaks, and the headers and footers
2874 which normally occur at those breaks with
2876 to make the manual more efficient for viewing on-line.
2881 does eject the imaginary remainder of the page at end of file.
2882 The inhibiting of the page breaks makes
2884 files unsuitable for hardcopy.
2885 There is a register named
2887 which can be set to zero in the site dependent style file
2888 .Pa /usr/src/share/tmac/doc-nroff
2889 to restore the old style behavior.
2891 .Bl -tag -width /usr/share/misc/mdoc.template -compact
2892 .It Pa /usr/share/tmac/tmac.doc
2893 manual macro package
2894 .It Pa /usr/share/misc/mdoc.template
2895 template for writing a man page
2902 Undesirable hyphenation on the dash of a flag
2903 argument is not yet resolved, and causes
2904 occasional mishaps in the
2907 (line break on the hyphen).
2909 Predefined strings are not declared in documentation.
2911 Section 3f has not been added to the header routines.
2914 font should be changed in
2919 needs to have a check to prevent splitting up
2920 if the line length is too short.
2922 separates the last parenthesis, and sometimes
2923 looks ridiculous if a line is in fill mode.
2925 The method used to prevent header and footer page
2926 breaks (other than the initial header and footer) when using
2928 occasionally places an unsightly partially filled line (blank)
2929 at the would be bottom of the page.
2931 If the outer-most list definition doesn't have a
2935 elements of inner lists may not work (producing a list where
2936 each successive element
2940 The list and display macros to not do any keeps
2941 and certainly should be able to.
2942 .\" Note what happens if the parameter list overlaps a newline
2944 .\" to make sure a line boundary is crossed:
2946 .\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[]
2949 .\" produces, nudge nudge,
2950 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
2951 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
2953 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] .
2955 .\" If double quotes are used, for example:
2957 .\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q
2960 .\" produces, nudge nudge,
2961 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
2963 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
2965 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" .
2967 .\" Not a pretty sight...
2968 .\" In a paragraph, a long parameter containing unpaddable spaces as
2969 .\" in the former example will cause
2971 .\" to break the line and spread
2972 .\" the remaining words out.
2973 .\" The latter example will adjust nicely to
2974 .\" justified margins, but may break in between an argument and its
2978 .\" the right margin adjustment is normally ragged and the problem is