1 .\" $NetBSD: mdoc.samples.7,v 1.21 1999/08/23 21:54:20 ross 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. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgement:
16 .\" This product includes software developed by the University of
17 .\" California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93
36 .\" This tutorial sampler invokes every macro in the package several
37 .\" times and is guaranteed to give a worst case performance
38 .\" for an already extremely slow package.
45 .Nd tutorial sampler for writing
52 A tutorial sampler for writing
57 .Em content Ns \-based
66 addressed page layout leaving the
67 manipulation of fonts and other
68 typesetting details to the individual author.
73 .Em "page structure domain"
74 which consists of macros for titles, section headers, displays
75 and lists. Essentially items which affect the physical position
76 of text on a formatted page.
77 In addition to the page structure domain, there are two more domains,
78 the manual domain and the general text domain.
79 The general text domain is defined as macros which
80 perform tasks such as quoting or emphasizing pieces of text.
81 The manual domain is defined as macros that are a subset of the
82 day to day informal language used to describe commands, routines
86 Macros in the manual domain handle
87 command names, command line arguments and options, function names,
88 function parameters, pathnames, variables, cross
89 references to other manual pages, and so on.
92 for both the author and the future user of the manual page.
93 It is hoped the consistency gained
94 across the manual set will provide easier
95 translation to future documentation tools.
99 manual pages, a manual entry
101 to as a man page, regardless of actual length and without
104 Since a tutorial document is normally read when a person
105 desires to use the material immediately, the assumption has
106 been made that the user of this document may be impatient.
107 The material presented in the remained of this document is
109 .Bl -enum -offset indent
111 .Tn "TROFF IDIOSYNCRASIES"
112 .Bl -tag -width flag -compact -offset indent
114 .It "Passing Space Characters in an Argument" .
115 .It "Trailing Blank Space Characters (a warning)" .
116 .It "Escaping Special Characters" .
119 .Tn "THE ANATOMY OF A MAN PAGE"
120 .Bl -tag -width flag -compact -offset indent
121 .It "A manual page template" .
124 .Tn "INTRODUCTION OF TITLE MACROS" .
126 .Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS" .
127 .Bl -tag -width flag -compact -offset indent
128 .It "What's in a name..." .
129 .It "General Syntax" .
133 .Bl -tag -width flag -compact -offset indent
136 .It "Configuration Declarations (section four only)" .
137 .It "Command Modifier" .
138 .It "Defined Variables" .
139 .It "Errno's (Section two only)" .
140 .It "Environment Variables" .
141 .It "Function Argument" .
142 .It "Function Declaration" .
144 .It "Functions (library routines)" .
145 .It "Function Types" .
146 .\" .It "Header File (including source code)" .
147 .It "Interactive Commands" .
153 .It "Cross References" .
156 .Tn "GENERAL TEXT DOMAIN"
157 .Bl -tag -width flag -compact -offset indent
161 .It "Emphasis Macro" .
162 .It "Enclosure/Quoting Macros"
163 .Bl -tag -width flag -compact -offset indent
164 .It "Angle Bracket Quote/Enclosure" .
165 .It "Bracket Quotes/Enclosure" .
166 .It "Double Quote macro/Enclosure" .
167 .It "Parenthesis Quote/Enclosure" .
168 .It "Single Quotes/Enclosure" .
171 .It "Extended Arguments" .
172 .It "No\-Op or Normal Text Macro" .
173 .It "No Space Macro" .
174 .It "Section Cross References" .
175 .It "Symbolic Macro" .
176 .It "References and Citations" .
177 .It "Trade Names (Acronyms and Type Names)" .
180 .Tn "PAGE STRUCTURE DOMAIN"
181 .Bl -tag -width flag -compact -offset indent
182 .It "Section Headers" .
183 .It "Paragraphs and Line Spacing" .
186 .It "Lists and Columns" .
189 .Tn "PREDEFINED STRINGS"
193 .Tn "FORMATTING WITH GROFF, TROFF AND NROFF"
198 .Sh TROFF IDIOSYNCRASIES
201 package attempts to simplify the process of writing a man page.
202 Theoretically, one should not have to learn the dirty details of
206 however, there are a few
207 limitations which are unavoidable and best gotten out
209 And, too, be forewarned, this package is
215 a macro is called by placing a
219 a line followed by the two character name for the macro.
220 Arguments may follow the macro separated by spaces.
221 It is the dot character at the beginning of the line which causes
223 to interpret the next two characters as a macro name.
227 at the beginning of a line in some context other than
228 a macro invocation, precede the
235 translates literally to a zero width space, and is never displayed in the
240 macros accept up to nine arguments, any
241 extra arguments are ignored.
244 accept nine arguments and,
245 in limited cases, arguments may be continued or extended
248 .Sx Extended Arguments ) .
249 A few macros handle quoted arguments (see
250 .Sx Passing Space Characters in an Argument
255 general text domain and manual domain macros are special
256 in that their argument lists are
258 for callable macro names.
259 This means an argument on the argument list which matches
260 a general text or manual domain macro name and is determined
261 to be callable will be executed
262 or called when it is processed.
264 the argument, although the name of a macro,
268 It is in this manner that many macros are nested; for
274 the flag and argument macros,
278 to specify an optional flag with an argument:
279 .Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent
282 .Li \&.Op \&Fl s \&Ar bytes
285 To prevent a two character
286 string from being interpreted as a macro name, precede
290 .Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent
291 .It Op \&Fl s \&Ar bytes
293 .Li \&.Op \e&Fl s \e&Ar bytes
300 are not interpreted as macros.
301 Macros whose argument lists are parsed for callable arguments
303 as parsed and macros which may be called from an argument
304 list are referred to as callable
305 throughout this document and in the companion quick reference
310 as almost all of the macros in
312 are parsed, but as it was cumbersome to constantly refer to macros
313 as being callable and being able to call other macros,
314 the term parsed has been used.
315 .Ss Passing Space Characters in an Argument
316 Sometimes it is desirable to give as one argument a string
317 containing one or more blank space characters.
318 This may be necessary
319 to defeat the nine argument limit or to specify arguments to macros
320 which expect particular arrangement of items in the argument list.
324 expects the first argument to be the name of a function and any
325 remaining arguments to be function parameters.
328 stipulates the declaration of function parameters in the
329 parenthesized parameter list, each parameter is guaranteed
330 to be at minimum a two word string.
334 There are two possible ways to pass an argument which contains
336 .Em Implementation note :
337 Unfortunately, the most convenient way
338 of passing spaces in between quotes by reassigning individual
339 arguments before parsing was fairly expensive speed wise
340 and space wise to implement in all the macros for
343 It is not expensive for
345 but for the sake of portability, has been limited
346 to the following macros which need
349 .Bl -tag -width 4n -offset indent -compact
351 Configuration declaration (section 4
354 Begin list (for the width specifier).
358 Functions (sections two and four).
370 Optional notes for a reference.
372 Report title (in a reference).
374 Title of article in a book or journal.
377 One way of passing a string
378 containing blank spaces is to use the hard or unpaddable space character
380 that is, a blank space preceded by the escape character
382 This method may be used with any macro but has the side effect
383 of interfering with the adjustment of text
384 over the length of a line.
386 sees the hard space as if it were any other printable character and
387 cannot split the string into blank or newline separated pieces as one
389 The method is useful for strings which are not expected
390 to overlap a line boundary.
392 .Bl -tag -width "fetch(char *str)" -offset indent
393 .It Fn fetch char\ *str
395 .Ql \&.Fn fetch char\e *str
396 .It Fn fetch "char *str"
397 can also be created by
398 .Ql \&.Fn fetch "\\*q*char *str\\*q"
406 would see three arguments and
409 .Dl Fn fetch char *str
411 For an example of what happens when the parameter list overlaps
412 a newline boundary, see the
415 .Ss Trailing Blank Space Characters
417 can be confused by blank space characters at the end of a line.
419 is a wise preventive measure to globally remove all blank spaces
420 from <blank-space><end-of-line> character sequences.
422 arise to force a blank character at the end of a line,
423 it may be forced with an unpaddable space and the
428 .Ss Escaping Special Characters
430 like the newline character
432 are handled by replacing the
440 .Sh THE ANATOMY OF A MAN PAGE
441 The body of a man page is easily constructed from a basic
442 template found in the file:
443 .Bd -literal -offset indent
444 \&.\e" /usr/share/misc/mdoc.template:
445 \&.\e" The following six lines are required.
446 \&.Dd Month day, year
447 \&.Os OPERATING_SYSTEM [version/release]
448 \&.Dt DOCUMENT_TITLE [section number] [volume]
452 \&.\e" The following requests should be uncommented and
453 \&.\e" used where appropriate. This next request is
454 \&.\e" for sections 2 and 3 function return values only.
455 \&.\e" .Sh RETURN VALUES
456 \&.\e" This next request is for sections 1, 6, 7 & 8 only
457 \&.\e" .Sh ENVIRONMENT
460 \&.\e" This next request is for sections 1, 6, 7 & 8 only
461 \&.\e" (command return values (to shell) and
462 \&.\e" fprintf/stderr type diagnostics)
463 \&.\e" .Sh DIAGNOSTICS
464 \&.\e" The next request is for sections 2 and 3 error
465 \&.\e" and signal handling only.
474 The first items in the template are the macros
475 .Pq Li \&.Dd , \&.Os , \&.Dt ;
477 the operating system the man page or subject source is developed
479 and the man page title
481 along with the section of the manual the page
483 These macros identify the page,
484 and are discussed below in
487 The remaining items in the template are section headers
498 .Sx PAGE STRUCTURE DOMAIN ,
502 Several content macros are used to demonstrate page layout macros;
503 reading about content macros before page layout macros is
506 The title macros are the first portion of the page structure
507 domain, but are presented first and separate for someone who
508 wishes to start writing a man page yesterday.
509 Three header macros designate the document title or manual page title,
510 the operating system,
511 and the date of authorship.
512 These macros are one called once at the very beginning of the document
513 and are used to construct the headers and footers only.
515 .It Li \&.Dt DOCUMENT_TITLE section# [volume]
516 The document title is the
517 subject of the man page and must be in
521 The section number may be 1,\ ...,\ 9,
522 and if it is specified,
523 the volume title may be omitted.
524 A volume title may be arbitrary or one of the following:
526 .\" USD UNIX User's Supplementary Documents
528 .\" PS1 UNIX Programmer's Supplementary Documents
530 .Bl -column SMM -offset indent -compact
531 .It Li AMD NetBSD Ancestral Manual Documents
532 .It Li SMM NetBSD System Manager's Manual
533 .It Li URM NetBSD Reference Manual
534 .It Li PRM NetBSD Programmer's Manual
535 .It Li KM NetBSD Kernel Manual
538 The default volume labeling is
540 for sections 1, 6, and 7;
544 for sections 2, 3, 4, and 5;
548 .\" MMI UNIX Manual Master Index
550 .\" CON UNIX Contributed Software Manual
552 .\" LOC UNIX Local Manual
553 .It Li \&.Os operating_system release#
554 The name of the operating system
555 should be the common acronym, e.g.
559 The release should be the standard release
560 nomenclature for the system specified, e.g. 4.3, 4.3+Tahoe, V.3,
562 Unrecognized arguments are displayed as given in the page footer.
563 For instance, a typical footer might be:
567 or for a locally produced set
569 .Dl \&.Os CS Department
571 The Berkeley default,
573 without an argument, has been defined as
575 in the site specific file
576 .Pa /usr/share/tmac/tmac.doc-common .
579 macro is not present, the bottom left corner of the page
581 .It Li \&.Dd month day, year
582 The date should be written formally:
587 Note that the date must not be placed in quotes!
590 .Ss What's in a name...
591 The manual domain macro names are derived from the day to day
592 informal language used to describe commands, subroutines and related
595 different variations of this language are used to describe
596 the three different aspects of writing a man page.
597 First, there is the description of
600 Second is the description of a
607 description of a command to a user in the verbal sense;
608 that is, discussion of a command in the text of a man page.
612 macros are themselves a type of command;
613 the general syntax for a troff command is:
614 .Bd -filled -offset indent
615 \&.Va argument1 argument2 ... argument9
620 is a macro command or request, and anything following it is an argument to
625 command using the content macros is a
629 command line might be displayed as:
630 .Bd -filled -offset indent
638 is the command name and the
643 argument designated as optional by the option brackets.
653 The macros which formatted the above example:
654 .Bd -literal -offset indent
660 In the third case, discussion of commands and command syntax
661 includes both examples above, but may add more detail.
667 from the example above might be referred to as
671 Some command line argument lists are quite long:
672 .Bl -tag -width make -offset indent
679 .Op Fl I Ar directory
682 .Op Ar variable=value
688 Here one might talk about the command
690 and qualify the argument
692 as an argument to the flag,
694 or discuss the optional
698 In the verbal context, such detail can prevent confusion,
702 does not have a macro for an argument
707 argument macro is used for an operand or file argument like
709 as well as an argument to a flag like
711 The make command line was produced from:
712 .Bd -literal -offset indent
715 \&.Op Fl D Ar variable
717 \&.Op Fl f Ar makefile
718 \&.Op Fl I Ar directory
719 \&.Op Fl j Ar max_jobs
720 \&.Op Ar variable=value
730 macros are explained in
733 The manual domain and general text domain macros share a similar
734 syntax with a few minor deviations:
740 differ only when called without arguments;
744 impose an order on their argument lists
750 have nesting limitations.
752 are capable of recognizing and properly handling punctuation,
753 provided each punctuation character is separated by a leading space.
754 If an request is given:
756 .Dl \&.Li sptr, ptr),
762 The punctuation is not recognized and all is output in the
763 literal font. If the punctuation is separated by a leading
766 .Dl \&.Li "sptr , ptr ) ,"
770 .Dl Li sptr , ptr ) ,
772 The punctuation is now recognized and is output in the
773 default font distinguishing it from the strings in literal font.
775 To remove the special meaning from a punctuation character
779 is limited as a macro language, and has difficulty
780 when presented with a string containing
781 a member of the mathematical, logical or
783 .Bd -literal -offset indent-two
784 \&{+,\-,/,*,\&%,<,>,<=,>=,=,==,&,`,',"}
789 may assume it is supposed to actually perform the operation
790 or evaluation suggested by the characters. To prevent
791 the accidental evaluation of these characters,
794 Typical syntax is shown in the first content macro displayed
798 The address macro identifies an address construct
799 of the form addr1[,addr2[,addr3]].
801 .Dl Usage: .Ad address ... \*(Pu
802 .Bl -tag -width ".Ad f1 , f2 , f3 :" -compact -offset 14n
805 .It Li \&.Ad addr1\ .
807 .It Li \&.Ad addr1\ , file2
809 .It Li \&.Ad f1\ , f2\ , f3\ :
811 .It Li \&.Ad addr\ )\ )\ ,
815 It is an error to call
819 is callable by other macros and is parsed.
823 argument macro may be used whenever
824 a command line argument is referenced.
826 .Dl Usage: .Ar argument ... \*(Pu
827 .Bl -tag -width ".Ar file1 file2" -compact -offset 15n
832 .It Li \&.Ar file1\ .
834 .It Li \&.Ar file1 file2
836 .It Li \&.Ar f1 f2 f3\ :
838 .It Li \&.Ar file\ )\ )\ ,
844 is called without arguments
849 macro is parsed and is callable.
850 .Ss Configuration Declaration (section four only)
853 macro is used to demonstrate a
855 declaration for a device interface in a section four manual.
856 This macro accepts quoted arguments (double quotes only).
858 .Bl -tag -width "device le0 at scode?" -offset indent
859 .It Cd "device le0 at scode?"
861 .Ql ".Cd device le0 at scode?" .
864 The command modifier is identical to the
866 (flag) command with the exception
869 macro does not assert a dash
870 in front of every argument.
871 Traditionally flags are marked by the
872 preceding dash, some commands or subsets of commands do not use them.
873 Command modifiers may also be specified in conjunction with interactive
874 commands such as editor commands.
877 .Ss Defined Variables
878 A variable which is defined in an include file is specified
882 .Dl Usage: .Dv defined_variable ... \*(Pu
883 .Bl -tag -width ".Dv MAXHOSTNAMELEN" -compact -offset 14n
884 .It Li ".Dv MAXHOSTNAMELEN"
886 .It Li ".Dv TIOCGPGRP )"
890 It is an error to call
894 is parsed and is callable.
895 .Ss Errno's (Section two only)
898 errno macro specifies the error return value
899 for section two library routines.
905 general text domain macro, as it would be used in
906 a section two manual page.
908 .Dl Usage: .Er ERRNOTYPE ... \*(Pu
909 .Bl -tag -width ".Bq Er ENOTDIR" -compact -offset 14n
912 .It Li \&.Er ENOENT\ )\ ;
914 .It Li \&.Bq \&Er ENOTDIR
918 It is an error to call
923 macro is parsed and is callable.
924 .Ss Environment Variables
927 macro specifies an environment variable.
929 .Dl Usage: .Ev argument ... \*(Pu
930 .Bl -tag -width ".Ev PRINTER ) ) ," -compact -offset 14n
935 .It Li \&.Ev PRINTER\ )\ )\ ,
939 It is an error to call
944 macro is parsed and is callable.
945 .Ss Function Argument
948 macro is used to refer to function arguments (parameters)
951 section of the manual or inside
954 section should a parameter list be too
957 macro and the enclosure macros
963 may also be used to refer to structure members.
965 .Dl Usage: .Fa function_argument ... \*(Pu
966 .Bl -tag -width ".Fa d_namlen\ )\ )\ ," -compact -offset 14n
967 .It Li \&.Fa d_namlen\ )\ )\ ,
973 It is an error to call
977 is parsed and is callable.
978 .Ss Function Declaration
983 section with section two or three
987 macro does not call other macros and is not callable by other
990 .Dl Usage: .Fd include_file (or defined variable)
996 request causes a line break if a function has already been presented
997 and a break has not occurred.
998 This leaves a nice vertical space
999 in between the previous function call and the declaration for the
1004 macro handles command line flags.
1009 For interactive command flags, which
1010 are not prepended with a dash, the
1013 macro is identical, but without the dash.
1015 .Dl Usage: .Fl argument ... \*(Pu
1016 .Bl -tag -width ".Fl \-s \-t \-v" -compact -offset 14n
1027 .It Li \&.Fl xyz\ )\ ,
1033 macro without any arguments results
1034 in a dash representing stdin/stdout.
1037 a single dash, will result in two dashes.
1040 macro is parsed and is callable.
1041 .Ss Functions (library routines)
1042 The .Fn macro is modeled on ANSI C conventions.
1044 Usage: .Fn [type] function [[type] parameters ... \*(Pu]
1046 .Bl -tag -width ".Fn .int align. .const * char *sptrsxx" -compact
1047 .It Li "\&.Fn getchar"
1049 .It Li "\&.Fn strlen ) ,"
1051 .It Li \&.Fn "\\*qint align\\*q" "\\*qconst * char *sptrs\\*q" ,
1052 .Fn "int align" "const * char *sptrs" ,
1055 It is an error to call
1057 without any arguments.
1061 is parsed and is callable,
1062 note that any call to another macro signals the end of
1065 call (it will close-parenthesis at that point).
1067 For functions that have more than eight parameters (and this
1078 to get around the limitation. For example:
1079 .Bd -literal -offset indent
1080 \&.Fo "int res_mkquery"
1087 \&.Fa "struct rrec *newrr"
1094 .Bd -filled -offset indent
1095 .Fo "int res_mkquery"
1102 .Fa "struct rrec *newrr"
1112 macros are parsed and are callable.
1115 section, the function will always begin at
1116 the beginning of line.
1117 If there is more than one function
1120 section and a function type has not been
1121 given, a line break will occur, leaving a nice vertical space
1122 between the current function name and the one prior.
1125 does not check its word boundaries
1126 against troff line lengths and may split across a newline
1128 This will be fixed in the near future.
1130 This macro is intended for the
1134 anywhere else in the man page without problems, but its main purpose
1135 is to present the function type in kernel normal form for the
1137 of sections two and three
1138 (it causes a page break allowing the function name to appear
1141 .Dl Usage: .Ft type ... \*(Pu
1142 .Bl -tag -width "\&.Ft struct stat" -offset 14n -compact
1143 .It Li \&.Ft struct stat
1149 request is not callable by other macros.
1150 .Ss Interactive Commands
1153 macro designates an interactive or internal command.
1155 .Dl Usage: .Li argument ... \*(Pu
1156 .Bl -tag -width ".Ic setenv , unsetenvxx" -compact -offset 14n
1159 .It Li \&.Ic do while {...}
1161 .It Li \&.Ic setenv\ , unsetenv
1162 .Ic setenv , unsetenv
1165 It is an error to call
1170 macro is parsed and is callable.
1174 literal macro may be used for special characters,
1175 variable constants, anything which should be displayed as it
1178 .Dl Usage: .Li argument ... \*(Pu
1179 .Bl -tag -width ".Li cntrl-D ) ," -compact -offset 14n
1182 .It Li \&.Li M1 M2 M3\ ;
1184 .It Li \&.Li cntrl-D\ )\ ,
1186 .It Li \&.Li 1024\ ...
1192 macro is parsed and is callable.
1196 macro is used for the document title or subject name.
1197 It has the peculiarity of remembering the first
1198 argument it was called with, which should
1199 always be the subject name of the page.
1203 regurgitates this initial name for the sole purpose
1204 of making less work for the author.
1205 If trailing punctuation is required with this feature,
1208 as a first argument to
1212 or three document function name is addressed with the
1220 and remaining sections.
1221 For interactive commands, such as the
1227 macro should be used.
1233 it can not recall the first argument it was invoked with.
1235 .Dl Usage: .Nm argument ... \*(Pu
1236 .Bl -tag -width ".Nm mdoc.samples" -compact -offset 14n
1237 .It Li \&.Nm mdoc.samples
1239 .It Li \&.Nm \e-mdoc
1241 .It Li \&.Nm foo\ )\ )\ ,
1245 .It Li \&.Nm \&"\&"\ :
1251 macro is parsed and is callable.
1256 places option brackets around the any remaining arguments on the command
1257 line, and places any
1258 trailing punctuation outside the brackets.
1263 may be used across one or more lines.
1265 .Dl Usage: .Op options ... \*(Pu
1266 .Bl -tag -width ".Op Fl c Ar objfil Op Ar corfil ," -compact -offset indent
1271 .It Li ".Op Fl k ) ."
1273 .It Li ".Op Fl k Ar kookfile"
1274 .Op Fl k Ar kookfile
1275 .It Li ".Op Fl k Ar kookfile ,"
1276 .Op Fl k Ar kookfile ,
1277 .It Li ".Op Ar objfil Op Ar corfil"
1278 .Op Ar objfil Op Ar corfil
1279 .It Li ".Op Fl c Ar objfil Op Ar corfil ,"
1280 .Op Fl c Ar objfil Op Ar corfil ,
1281 .It Li \&.Op word1 word2
1290 .Bd -literal -offset indent
1292 \&.Op \&Fl k \&Ar kilobytes
1293 \&.Op \&Fl i \&Ar interval
1294 \&.Op \&Fl c \&Ar count
1300 .Op Fl k Ar kilobytes
1301 .Op Fl i Ar interval
1310 are parsed and are callable.
1314 macro formats path or file names.
1316 .Dl Usage: .Pa pathname \*(Pu
1317 .Bl -tag -width ".Pa /tmp/fooXXXXX ) ." -compact -offset 14n
1318 .It Li \&.Pa /usr/share
1320 .It Li \&.Pa /tmp/fooXXXXX\ )\ .
1321 .Pa /tmp/fooXXXXX ) .
1326 macro is parsed and is callable.
1328 Generic variable reference:
1330 .Dl Usage: .Va variable ... \*(Pu
1331 .Bl -tag -width ".Va char s ] ) ) ," -compact -offset 14n
1334 .It Li \&.Va settimer ,
1336 .It Li \&.Va int\ *prt\ )\ :
1338 .It Li \&.Va char\ s\ ]\ )\ )\ ,
1342 It is an error to call
1344 without any arguments.
1347 macro is parsed and is callable.
1348 .Ss Manual Page Cross References
1351 macro expects the first argument to be
1352 a manual page name, and the second argument, if it exists,
1353 to be either a section page number or punctuation.
1355 remaining arguments are assumed to be punctuation.
1357 .Dl Usage: .Xr man_page [1,...,9] \*(Pu
1358 .Bl -tag -width ".Xr mdoc 7 ) ) ," -compact -offset 14n
1361 .It Li \&.Xr mdoc\ ,
1365 .It Li \&.Xr mdoc 7\ )\ )\ ,
1371 macro is parsed and is callable.
1372 It is an error to call
1376 .Sh GENERAL TEXT DOMAIN
1378 .Bd -literal -offset indent -compact
1379 Usage: .At [v1 .. v7 | 32v | V.1 | V.4] ... \*(Pu
1381 .Bl -tag -width ".At v6 ) ," -compact -offset 14n
1394 callable. It accepts at most two arguments.
1396 .Dl Usage: .Bx [Version/release] ... \*(Pu
1397 .Bl -tag -width ".Bx 4.3 ) ," -compact -offset 14n
1406 macro is parsed and is callable.
1408 .Dl Usage: .Nx [Version/release] ... \*(Pu
1409 .Bl -tag -width ".Nx 1.4 ) ," -compact -offset 14n
1418 macro is parsed and is callable.
1420 .Dl Usage: .Fx [Version/release] ... \*(Pu
1421 .Bl -tag -width ".Fx 2.2 ) ," -compact -offset 14n
1430 macro is parsed and is callable.
1432 .Dl Usage: .Ux ... \*(Pu
1433 .Bl -tag -width ".Ux 4.3 ) ," -compact -offset 14n
1440 macro is parsed and is callable.
1442 Text may be stressed or emphasized with the
1445 The usual font for emphasis is italic.
1447 .Dl Usage: .Em argument ... \*(Pu
1448 .Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n
1449 .It Li ".Em does not"
1451 .It Li ".Em exceed 1024 ."
1453 .It Li ".Em vide infra ) ) ,"
1454 .Em vide infra ) ) ,
1457 .\" The emphasis can be forced across several lines of text by using
1460 .\" macro discussed in
1463 .\" .Sx PAGE STRUCTURE DOMAIN .
1466 .\" We are certain the reason most people desire a Harvard MBA
1467 .\" so they can become to be successful philanthropists. Only
1468 .\" mathematicians and physicists go to graduate school strictly
1469 .\" to acquire infinite wealthy and fame. Its that inifinity
1470 .\" word that does it to them. Ruins them.
1475 macro is parsed and is callable.
1476 It is an error to call
1479 .Ss Enclosure and Quoting Macros
1480 The concept of enclosure is similar to quoting.
1481 The object being to enclose one or more strings between
1482 a pair of characters like quotes or parentheses.
1483 The terms quoting and enclosure are used
1484 interchangeably throughout this document.
1486 one line enclosure macros end
1489 to give a hint of quoting, but there are a few irregularities.
1490 For each enclosure macro
1491 there is also a pair of open and close macros which end
1497 These can be used across one or more lines of text
1498 and while they have nesting limitations, the one line quote macros
1503 .Bd -filled -offset indent
1504 .Bl -column "quote " "close " "open " "Enclose Stringx(in XX) " XXstringXX
1505 .Em " Quote Close Open Function Result"
1506 \&.Aq .Ac .Ao Angle Bracket Enclosure <string>
1507 \&.Bq .Bc .Bo Bracket Enclosure [string]
1508 \&.Dq .Dc .Do Double Quote ``string''
1509 .Ec .Eo Enclose String (in XX) XXstringXX
1510 \&.Pq .Pc .Po Parenthesis Enclosure (string)
1511 \&.Ql Quoted Literal `st' or string
1512 \&.Qq .Qc .Qo Straight Double Quote "string"
1513 \&.Sq .Sc .So Single Quote `string'
1517 Except for the irregular macros noted below, all
1518 of the quoting macros are parsed and callable.
1519 All handle punctuation properly, as long as it
1520 is presented one character at a time and separated by spaces.
1521 The quoting macros examine opening and closing punctuation
1522 to determine whether it comes before or after the
1523 enclosing string. This makes some nesting possible.
1524 .Bl -tag -width xxx,xxxx
1525 .It Li \&.Ec , \&.Eo
1526 These macros expect the first argument to be the
1527 opening and closing strings respectively.
1529 The quoted literal macro behaves differently for
1535 a quoted literal is always quoted. If formatted with
1536 troff, an item is only quoted if the width
1537 of the item is less than three constant width characters.
1538 This is to make short strings more visible where the font change
1539 to literal (constant width) is less noticeable.
1541 The prefix macro is not callable, but it is parsed:
1542 .Bl -tag -width "(namexx" -offset indent
1543 .It Li ".Pf ( Fa name2"
1550 (no space) macro, which
1553 performs the analogous suffix function.
1555 The \&.Ap macro inserts an apostrophe and exits any special text modes,
1562 Examples of quoting:
1563 .Bl -tag -width ".Aq Pa ctype.h ) ,xxxxxxxx" -compact -offset indent
1566 .It Li \&.Aq \&Ar ctype.h\ )\ ,
1570 .It Li \&.Bq \&Em Greek \&, French \&.
1571 .Bq Em Greek , French .
1574 .It Li ".Dq string abc ."
1576 .It Li ".Dq \'^[A-Z]\'"
1578 .It Li "\&.Ql man mdoc"
1582 .It Li "\&.Qq string ) ,"
1584 .It Li "\&.Qq string Ns ),"
1588 .It Li "\&.Sq string
1590 .It Li "\&.Em or Ap ing
1594 For a good example of nested enclosure macros, see the
1597 It was created from the same
1598 underlying enclosure macros as those presented in the list
1604 extended argument list macros
1605 were also built from the same underlying routines and are a good
1608 macro usage at its worst.
1609 .Ss No\-Op or Normal Text Macro
1613 a hack for words in a macro command line which should
1615 be formatted and follows the conventional syntax
1620 macro eliminates unwanted spaces in between macro requests.
1621 It is useful for old style argument lists where there is no space
1622 between the flag and argument:
1623 .Bl -tag -width ".Op Fl I Ns Ar directoryxx" -offset indent
1624 .It Li ".Op Fl I Ns Ar directory"
1626 .Op Fl I Ns Ar directory
1631 macro always invokes the
1633 macro after eliminating the space unless another macro name
1637 is parsed and is callable.
1638 .Ss Section Cross References
1641 macro designates a reference to a section header
1642 within the same document.
1643 It is parsed and is callable.
1645 .Bl -tag -width "Li \&.Sx FILES" -offset 14n
1650 The symbolic emphasis macro is generally a boldface macro in
1651 either the symbolic sense or the traditional English usage.
1653 .Dl Usage: .Sy symbol ... \*(Pu
1654 .Bl -tag -width ".Sy Important Noticex" -compact -offset 14n
1655 .It Li \&.Sy Important Notice
1656 .Sy Important Notice
1661 macro is parsed and is callable.
1665 .Ss References and Citations
1666 The following macros make a modest attempt to handle references.
1667 At best, the macros make it convenient to manually drop in a subset of
1668 refer style references.
1670 .Bl -tag -width 6n -offset indent -compact
1673 Causes a line break and begins collection
1674 of reference information until the
1675 reference end macro is read.
1678 The reference is printed.
1680 Reference author name, one name per invocation.
1692 Optional information.
1703 The macros beginning with
1705 are not callable, and are parsed only for the trade name macro which
1706 returns to its caller.
1707 (And not very predictably at the moment either.)
1708 The purpose is to allow trade names
1709 to be pretty printed in
1710 .Xr troff Ns / Ns Xr ditroff
1712 .Ss Trade Names (or Acronyms and Type Names)
1713 The trade name macro is generally a small caps macro for
1714 all upper case words longer than two characters.
1716 .Dl Usage: .Tn symbol ... \*(Pu
1717 .Bl -tag -width ".Tn ASCII" -compact -offset 14n
1727 is parsed and is callable by other macros.
1728 .Ss Extended Arguments
1733 macros allow one to extend an argument list
1734 on a macro boundary.
1735 Argument lists cannot
1736 be extended within a macro
1737 which expects all of its arguments on one line such
1741 Here is an example of
1743 using the space mode macro to turn spacing off:
1744 .Bd -literal -offset indent
1746 \&.It Xo Sy I Ar operation
1747 \&.No \een Ar count No \een
1753 .Bd -filled -offset indent
1754 .Bl -tag -width flag -compact
1756 .It Xo Sy I Ar operation
1757 .No \en Ar count No \en
1764 .Bd -literal -offset indent
1766 \&.It Cm S No \&/ Ar old_pattern Xo
1767 \&.No \&/ Ar new_pattern
1774 .Bd -filled -offset indent
1775 .Bl -tag -width flag -compact
1777 .It Cm S No \&/ Ar old_pattern Xo
1778 .No \&/ Ar new_pattern
1787 and using enclosure macros:
1788 Test the value of an variable.
1789 .Bd -literal -offset indent
1792 \&.Oo \e&! Oc Ns Ar variable
1793 \&.Op Ar operator variable ...
1798 .Bd -filled -offset indent
1799 .Bl -tag -width flag -compact
1802 .Oo \&! Oc Ns Ar variable
1803 .Op Ar operator variable ...
1808 All of the above examples have used the
1810 macro on the argument list of the
1814 The extend macros are not used very often, and when they are
1815 it is usually to extend the list-item argument list.
1816 Unfortunately, this is also where the extend macros are the
1818 In the first two examples, spacing was turned off;
1819 in the third, spacing was desired in part of the output but
1821 To make these macros work in this situation make sure
1826 macros are placed as shown in the third example.
1829 macro is not alone on the
1831 argument list, spacing will be unpredictable.
1835 must not occur as the first or last macro on a line
1837 Out of 900 manual pages (about 1500 actual pages)
1838 currently released with
1840 only fifteen use the
1843 .Sh PAGE STRUCTURE DOMAIN
1847 section header macros
1848 list below are required in every
1850 The remaining section headers
1851 are recommended at the discretion of the author
1852 writing the manual page.
1855 macro can take up to nine arguments.
1856 It is parsed and but is not callable.
1857 .Bl -tag -width ".Sh SYNOPSIS"
1863 the headers, footers and page layout defaults
1864 will not be set and things will be rather unpleasant.
1867 section consists of at least three items.
1870 name macro naming the subject of the man page.
1871 The second is the Name Description macro,
1873 which separates the subject
1874 name from the third item, which is the description.
1876 description should be the most terse and lucid possible,
1877 as the space available is small.
1881 section describes the typical usage of the
1882 subject of a man page.
1898 for manual page sections 2 and 3, the command and general
1901 is required for sections 1, 5, 6, 7, 8.
1902 Section 4 manuals require a
1906 configuration device usage macro.
1907 Several other macros may be necessary to produce
1908 the synopsis line as shown below:
1910 .Bd -filled -offset indent
1917 The following macros were used:
1920 .Dl \&.Op \&Fl benstuv
1930 recognize the pipe bar character
1932 so a command line such as:
1934 .Dl ".Op Fl a | Fl b"
1936 will not go orbital.
1938 normally interprets a \*(Ba as a special operator.
1940 .Sx PREDEFINED STRINGS
1942 character in other situations.
1943 .It \&.Sh DESCRIPTION
1944 In most cases the first text in the
1947 is a brief paragraph on the command, function or file,
1948 followed by a lexical list of options and respective
1950 To create such a list, the
1957 macros are used (see
1958 .Sx Lists and Columns
1964 section headers are part of the
1965 preferred manual page layout and must be used appropriately
1966 to maintain consistency.
1967 They are listed in the order
1968 in which they would be used.
1969 .Bl -tag -width SYNOPSIS
1970 .It \&.Sh ENVIRONMENT
1973 section should reveal any related
1975 variables and clues to their behavior and/or usage.
1977 There are several ways to create examples.
1984 Files which are used or created by the man page subject
1985 should be listed via the
1991 References to other material on the man page topic and
1992 cross references to other relevant man pages should
1997 are specified using the
2002 style references are not accommodated.
2004 It is recommended that the cross references are sorted on the section
2005 number, and then alphabetically on the names within a section.
2007 If the command, library function or file adheres to a
2008 specific implementation such as
2012 this should be noted here.
2014 command does not adhere to any standard, its history
2015 should be noted in the
2019 Any command which does not adhere to any specific standards
2020 should be outlined historically in this section.
2022 Credits, if need be, should be placed here.
2023 .It \&.Sh DIAGNOSTICS
2024 Diagnostics from a command should be placed in this section.
2026 Specific error handling, especially from library functions
2027 (man page sections 2 and 3) should go here.
2030 macro is used to specify an errno.
2032 Blatant problems with the topic go here...
2037 sections may be added,
2038 for example, this section was set with:
2039 .Bd -literal -offset 14n
2040 \&.Sh PAGE LAYOUT MACROS
2042 .Ss Paragraphs and Line Spacing.
2045 The \&.Pp paragraph command may
2046 be used to specify a line space where necessary.
2047 The macro is not necessary after a
2057 macro asserts a vertical distance unless the -compact flag is given).
2059 .\" This worked with version one, need to redo for version three
2062 .\" .Cw (ax+bx+c) \ is\ produced\ by\ \&
2063 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2080 .\" .Em is produced by
2096 .\" This example shows the same equation in a different format.
2100 .\" signs were forced with
2104 .\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
2105 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2116 .\" .Li \&.Cx \e\ +\e\ \e&
2127 .\" .Em is produced by
2135 .\" .Li \&.Cx \e\ +\e\ \e&
2146 .\" The incantation below was
2152 .\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
2154 .\" .Li \&.Cx Op Sy ?/
2164 .\" .Em is produced by
2166 .\" .Li \&.Ar \e\ b1 e1 f1
2178 The only keep that is implemented at this time is for words.
2185 The only option that
2189 and is useful for preventing line breaks in the middle of options.
2190 In the example for the make command line arguments (see
2191 .Sx What's in a name ) ,
2195 flag and the argument
2197 (Actually, the option macro used to prevent this from occurring,
2198 but was dropped when the decision (religious) was made to force
2199 right justified margins in
2201 as options in general look atrocious when spread across a sparse
2203 More work needs to be done with the keep macros, a
2205 option needs to be added.)
2206 .Ss Examples and Displays
2207 There are six types of displays, a quickie one line indented display
2209 a quickie one line literal display
2211 and block literal, block filled, block unfilled, and block ragged which use
2219 .Bl -tag -width \&.Dlxx
2221 (D-one) Display one line of indented text.
2222 This macro is parsed, but it is not callable.
2226 The above was produced by:
2227 .Li \&.Dl Fl ldghfstru .
2230 Display one line of indented
2235 example macro has been used throughout this
2238 the indent (display) of one line of text.
2239 Its default font is set to
2240 constant width (literal) however
2241 it is parsed and will recognized other macros.
2242 It is not callable however.
2244 .Dl % ls -ldg /usr/local/bin
2246 The above was produced by
2247 .Li \&.Dl % ls -ldg /usr/local/bin .
2252 display must be ended with the
2255 Displays may be nested within lists, but may
2257 contain other displays; this also prohibits nesting
2258 of .D1 and .Dl one-line displays.
2260 has the following syntax:
2262 .Dl ".Bd display-type [-offset offset_value] [-compact]"
2264 The display-type must be one of the following four types and
2265 may have an offset specifier for indentation:
2268 .Bl -tag -width "file file_name " -compact
2270 Fill, but do not adjust the right margin.
2272 Do not fill: display a block of text as typed, the
2273 right (and left) margin edges are left ragged.
2275 Display a filled (formatted) block.
2276 The block of text is formatted (the edges are filled \-
2277 not left unjustified).
2279 Display a literal block, useful for source code or
2280 simple tabbed or spaced text.
2281 .It Fl file Ar file_name
2282 The file name following the
2284 flag is read and displayed.
2286 asserted and tabs are set at 8 constant width character
2287 intervals, however any
2288 .Xr troff/ Ns Nm \-mdoc
2289 commands in file will be processed.
2290 .It Fl offset Ar string
2293 is specified with one of the following strings, the string
2294 is interpreted to indicate the level of indentation for the
2295 forthcoming block of text:
2297 .Bl -tag -width "indent-two" -compact
2299 Align block on the current left margin,
2300 this is the default mode of
2303 Supposedly center the block.
2305 unfortunately, the block merely gets
2306 left aligned about an imaginary center margin.
2308 Indents by one default indent value or tab.
2310 indent value is also used for the
2312 display so one is guaranteed the two types of displays
2314 This indent is normally set to 6n or about two
2315 thirds of an inch (six constant width characters).
2317 Indents two times the default indent value.
2321 aligns the block about two inches from
2322 the right side of the page.
2324 work and perhaps may never do the right thing by
2331 .Ss Tagged Lists and Columns
2332 There are several types of lists which may be initiated with the
2335 Items within the list
2336 are specified with the
2339 each list must end with the
2344 may be nested within themselves and within displays.
2345 The use of columns inside of lists or lists inside of columns
2348 In addition, several list attributes may be specified such as
2349 the width of a tag, the list offset, and compactness
2350 (blank lines between items allowed or disallowed).
2351 Most of this document has been formatted with a tag style list
2353 For a change of pace, the list-type used to present the list-types
2354 is an over-hanging list
2356 This type of list is quite popular with
2358 users, but might look a bit funny after having read many pages of
2360 The following list types are accepted by
2369 These five are the simplest types of lists.
2372 macro has been given, items in the list are merely
2373 indicated by a line consisting solely of the
2376 For example, the source text for a simple enumerated list
2378 .Bd -literal -offset indent-two
2379 \&.Bl -enum -compact
2381 \&Item one goes here.
2383 \&And item two here.
2385 \&Lastly item three goes here.
2391 .Bl -enum -offset indent-two -compact
2397 Lastly item three goes here.
2400 A simple bullet list construction:
2401 .Bd -literal -offset indent-two
2402 \&.Bl -bullet -compact
2404 \&Bullet one goes here.
2411 .Bl -bullet -offset indent-two -compact
2413 Bullet one goes here.
2423 These list-types collect arguments specified with the
2425 macro and create a label which may be
2427 into the forthcoming text,
2429 from the forthcoming text,
2431 from above and not indented or
2434 list was constructed with the
2439 macro is parsed only for the inset, hang
2440 and tag list-types and is not callable.
2441 Here is an example of inset labels:
2442 .Bl -inset -offset indent
2444 The tagged list (also called a tagged paragraph) is the
2445 most common type of list used in the Berkeley manuals. Use a
2447 attribute as described below.
2449 Diag lists create section four diagnostic lists
2450 and are similar to inset lists except callable
2453 Hanged labels are a matter of taste.
2455 Overhanging labels are nice when space is constrained.
2457 Inset labels are useful for controlling blocks of
2458 paragraphs and are valuable for converting
2460 manuals to other formats.
2463 Here is the source text which produced the above example:
2464 .Bd -literal -offset indent
2465 \&.Bl -inset -offset indent
2467 \&The tagged list (also called a tagged paragraph) is the
2468 \&most common type of list used in the Berkeley manuals.
2470 \&Diag lists create section four diagnostic lists
2471 \&and are similar to inset lists except callable
2472 \¯os are ignored.
2474 \&Hanged labels are a matter of taste.
2476 \&Overhanging labels are nice when space is constrained.
2478 \&Inset labels are useful for controlling blocks of
2479 \¶graphs and are valuable for converting
2481 \&manuals to other formats.
2485 Here is a hanged list with just one item:
2486 .Bl -hang -offset indent
2488 labels appear similar to tagged lists when the
2489 label is smaller than the label width.
2490 .It Em Longer hanged list labels
2491 blend in to the paragraph unlike
2492 tagged paragraph labels.
2495 And the unformatted text which created it:
2496 .Bd -literal -offset indent
2497 \&.Bl -hang -offset indent
2499 \&labels appear similar to tagged lists when the
2500 \&label is smaller than the label width.
2501 \&.It Em Longer hanged list labels
2502 \&blend in to the paragraph unlike
2503 \&tagged paragraph labels.
2507 The tagged list which follows uses a width specifier to control
2508 the width of the tag.
2510 .Bl -tag -width "PAGEIN" -compact -offset indent
2512 sleep time of the process (seconds blocked)
2516 resulting from references
2517 by the process to pages not loaded in core.
2519 numerical user-id of process owner
2521 numerical id of parent of process process priority
2522 (non-positive when in non-interruptible wait)
2526 .Bd -literal -offset indent
2527 \&.Bl -tag -width "PAGEIN" -compact -offset indent
2529 \&sleep time of the process (seconds blocked)
2533 \&resulting from references
2534 \&by the process to pages not loaded in core.
2536 \&numerical user-id of process owner
2538 \&numerical id of parent of process process priority
2539 \&(non-positive when in non-interruptible wait)
2543 Acceptable width specifiers:
2544 .Bl -tag -width Ar -offset indent
2545 .It Fl width Ar "\&Fl"
2546 sets the width to the default width for a flag.
2548 macros have a default width value.
2552 set to ten constant width characters or about five sixth of
2554 .It Fl width Ar "24n"
2555 sets the width to 24 constant width characters or about two
2559 is absolutely necessary for the scaling to work correctly.
2560 .It Fl width Ar "ENAMETOOLONG"
2561 sets width to the constant width length of the
2563 .It Fl width Ar "\\*qint mkfifo\\*q"
2564 again, the width is set to the constant width of the string
2568 If a width is not specified for the tag list type, the first
2571 is invoked, an attempt is made to determine an appropriate
2573 If the first argument to
2575 is a callable macro, the default width for that macro will be used
2576 as if the macro name had been supplied as the width.
2578 if another item in the list is given with a different callable
2579 macro name, a new and nested list is assumed. This effectively
2582 is required for the tag list type.
2585 This list type generates multiple columns.
2586 The number of columns and the width of each column is determined by
2587 the arguments to the
2592 argument is parsed to make a row, each column within the
2593 row is a separate argument separated by a tab or the
2598 .Bl -column "String" "Nroff" "Troff" -offset indent
2599 .It Sy "String" Ta Sy "Nroff" Ta Sy "Troff"
2600 .It Li "<=" Ta \&<\&= Ta \*(<=
2601 .It Li ">=" Ta \&>\&= Ta \*(>=
2605 .Bd -literal -offset indent
2606 \&.Bl -column "String" "Nroff" "Troff" -offset indent
2607 \&.It Sy "String" Ta Sy "Nroff" Ta Sy "Troff"
2608 \&.It Li "<=" Ta \&<\&= Ta \*(<=
2609 \&.It Li ">=" Ta \&>\&= Ta \*(>=
2612 .Sh PREDEFINED STRINGS
2613 The following strings are predefined as may be used by
2614 preceding with the troff string interpreting sequence
2618 is the name of the defined string or as
2622 is the name of the string.
2623 The interpreting sequence may be used any where in the text.
2625 .Bl -column "String " "Nroff " "Troff " -offset indent
2626 .It Sy "String Nroff Troff"
2627 .It Li "<=" Ta \&<\&= Ta \*(<=
2628 .It Li ">=" Ta \&>\&= Ta \*(>=
2629 .It Li "Rq" Ta "''" Ta \*(Rq
2630 .It Li "Lq" Ta "``" Ta \*(Lq
2631 .It Li "ua" Ta ^ Ta \*(ua
2632 .It Li "aa" Ta ' Ta \*(aa
2633 .It Li "ga" Ta \` Ta \*(ga
2634 .\" .It Li "sL" Ta ` Ta \*(sL
2635 .\" .It Li "sR" Ta ' Ta \*(sR
2636 .It Li "q" Ta \&" Ta \*q
2637 .It Li "Pi" Ta pi Ta \*(Pi
2638 .It Li "Ne" Ta != Ta \*(Ne
2639 .It Li "Le" Ta <= Ta \*(Le
2640 .It Li "Ge" Ta >= Ta \*(Ge
2641 .It Li "Lt" Ta < Ta \*(Gt
2642 .It Li "Gt" Ta > Ta \*(Lt
2643 .It Li "Pm" Ta +- Ta \*(Pm
2644 .It Li "If" Ta infinity Ta \*(If
2645 .It Li "Na" Ta \fINaN\fP Ta \*(Na
2646 .It Li "Ba" Ta \fR\&|\fP Ta \*(Ba
2652 should be written as
2654 since it is only one char.
2656 The debugging facilities for
2658 are limited, but can help detect subtle errors such
2659 as the collision of an argument name with an internal
2660 register or macro name.
2662 A register is an arithmetic storage class for
2664 with a one or two character name.
2665 All registers internal to
2671 are two characters and
2672 of the form <upper_case><lower_case> such as
2674 <lower_case><upper_case> as
2677 <upper or lower letter><digit> as
2679 And adding to the muddle,
2681 has its own internal registers all of which are either
2682 two lower case characters or a dot plus a letter or meta-character
2684 In one of the introduction examples, it was shown how to
2685 prevent the interpretation of a macro name with the escape sequence
2687 This is sufficient for the internal register names also.
2689 .\" Every callable macro name has a corresponding register
2690 .\" of the same name (<upper_case><lower_case>).
2691 .\" There are also specific registers which have
2692 .\" been used for stacks and arrays and are listed in the
2694 .\" .Bd -ragged -offset 4n
2695 .\" [A-Z][a-z] registers corresponding to macro names (example ``Ar'')
2696 .\" [a-z][A-Z] registers corresponding to macro names (example ``aR'')
2697 .\" C[0-9] argument types (example C1)
2698 .\" O[0-9] offset stack (displays)
2699 .\" h[0-9] horizontal spacing stack (lists)
2700 .\" o[0-9] offset (stack) (lists)
2701 .\" t[0-9] tag stack (lists)
2702 .\" v[0-9] vertical spacing stack (lists)
2703 .\" w[0-9] width tag/label stack
2706 If a non-escaped register name is given in the argument list of a request
2707 unpredictable behavior will occur.
2708 In general, any time huge portions
2709 of text do not appear where expected in the output, or small strings
2710 such as list tags disappear, chances are there is a misunderstanding
2711 about an argument type in the argument list.
2712 Your mother never intended for you to remember this evil stuff - so here
2713 is a way to find out whether or not your arguments are valid: The
2716 macro displays the interpretation of the argument list for most
2721 macro do not contain debugging information.
2722 All of the callable macros do,
2723 and it is strongly advised whenever in doubt,
2728 .Dl Usage: \&.Db [on | off]
2730 An example of a portion of text with
2731 the debug macro placed above and below an
2732 artificially created problem (a flag argument
2737 .Bd -literal -offset indent
2739 \&.Op Fl aC Ar file )
2743 The resulting output:
2744 .Bd -literal -offset indent
2746 DEBUG(argv) MACRO: `.Op' Line #: 2
2747 Argc: 1 Argv: `Fl' Length: 2
2748 Space: `' Class: Executable
2749 Argc: 2 Argv: `aC' Length: 2
2750 Space: `' Class: Executable
2751 Argc: 3 Argv: `Ar' Length: 2
2752 Space: `' Class: Executable
2753 Argc: 4 Argv: `file' Length: 4
2754 Space: ` ' Class: String
2755 Argc: 5 Argv: `)' Length: 1
2756 Space: ` ' Class: Closing Punctuation or suffix
2757 MACRO REQUEST: .Op Fl aC Ar file )
2761 The first line of information tells the name of the calling
2764 and the line number it appears on.
2765 If one or more files are involved
2766 (especially if text from another file is included) the line number
2768 If there is only one file, it should be accurate.
2769 The second line gives the argument count, the argument
2772 If the length of an argument is two characters, the
2773 argument is tested to see if it is executable (unfortunately, any
2774 register which contains a non-zero value appears executable).
2775 The third line gives the space allotted for a class, and the
2777 The problem here is the argument aC should not be
2779 The four types of classes are string, executable, closing
2780 punctuation and opening punctuation.
2781 The last line shows the entire
2782 argument list as it was read.
2783 In this next example, the offending
2786 .Bd -literal -offset indent
2788 \&.Em An escaped \e&aC
2791 .Bd -literal -offset indent
2793 DEBUG(fargv) MACRO: `.Em' Line #: 2
2794 Argc: 1 Argv: `An' Length: 2
2795 Space: ` ' Class: String
2796 Argc: 2 Argv: `escaped' Length: 7
2797 Space: ` ' Class: String
2798 Argc: 3 Argv: `aC' Length: 2
2799 Space: ` ' Class: String
2800 MACRO REQUEST: .Em An escaped &aC
2806 shows up with the same length of 2 as the
2808 sequence produces a zero width, but a register
2811 was not found and the type classified as string.
2813 Other diagnostics consist of usage statements and are self explanatory.
2814 .Sh GROFF, TROFF AND NROFF
2817 package does not need compatibility mode with
2820 The package inhibits page breaks, and the headers and footers
2821 which normally occur at those breaks with
2823 to make the manual more efficient for viewing on-line.
2828 does eject the imaginary remainder of the page at end of file.
2829 The inhibiting of the page breaks makes
2831 files unsuitable for hardcopy.
2832 There is a register named
2834 which can be set to zero in the site dependent style file
2835 .Pa /usr/src/share/tmac/doc-nroff
2836 to restore the old style behavior.
2838 .Bl -tag -width /usr/share/misc/mdoc.template -compact
2839 .It Pa /usr/share/tmac/tmac.doc
2840 manual macro package
2841 .It Pa /usr/share/misc/mdoc.template
2842 template for writing a man page
2849 Undesirable hyphenation on the dash of a flag
2850 argument is not yet resolved, and causes
2851 occasional mishaps in the
2854 (line break on the hyphen).
2856 Predefined strings are not declared in documentation.
2858 Section 3f has not been added to the header routines.
2861 font should be changed in
2866 needs to have a check to prevent splitting up
2867 if the line length is too short.
2869 separates the last parenthesis, and sometimes
2870 looks ridiculous if a line is in fill mode.
2872 The method used to prevent header and footer page
2873 breaks (other than the initial header and footer) when using
2874 nroff occasionally places an unsightly partially filled line (blank)
2875 at the would be bottom of the page.
2877 If the outer-most list definition doesn't have a
2881 elements of inner lists may not work (producing a list where
2882 each successive element
2886 The list and display macros to not do any keeps
2887 and certainly should be able to.
2888 .\" Note what happens if the parameter list overlaps a newline
2890 .\" to make sure a line boundary is crossed:
2892 .\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[]
2895 .\" produces, nudge nudge,
2896 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
2897 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
2899 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] .
2901 .\" If double quotes are used, for example:
2903 .\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q
2906 .\" produces, nudge nudge,
2907 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
2909 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
2911 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" .
2913 .\" Not a pretty sight...
2914 .\" In a paragraph, a long parameter containing unpaddable spaces as
2915 .\" in the former example will cause
2917 .\" to break the line and spread
2918 .\" the remaining words out.
2919 .\" The latter example will adjust nicely to
2920 .\" justified margins, but may break in between an argument and its
2924 .\" the right margin adjustment is normally ragged and the problem is