Annotation of src/usr.bin/mandoc/mdoc.7, Revision 1.42
1.42 ! schwarze 1: .\" $Id: mdoc.7,v 1.41 2010/07/25 18:05:54 schwarze Exp $
1.1 kristaps 2: .\"
1.39 schwarze 3: .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
4: .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
1.1 kristaps 5: .\"
6: .\" Permission to use, copy, modify, and distribute this software for any
1.2 schwarze 7: .\" purpose with or without fee is hereby granted, provided that the above
8: .\" copyright notice and this permission notice appear in all copies.
1.1 kristaps 9: .\"
1.2 schwarze 10: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.9 schwarze 17: .\"
1.42 ! schwarze 18: .Dd $Mdocdate: July 25 2010 $
1.2 schwarze 19: .Dt MDOC 7
1.1 kristaps 20: .Os
21: .Sh NAME
1.15 schwarze 22: .Nm mdoc
23: .Nd mdoc language reference
1.1 kristaps 24: .Sh DESCRIPTION
25: The
1.15 schwarze 26: .Nm mdoc
1.9 schwarze 27: language is used to format
1.15 schwarze 28: .Bx
29: .Ux
1.41 schwarze 30: manuals.
31: In this reference document, we describe its syntax, structure, and
32: usage.
33: Our reference implementation is mandoc; the
1.15 schwarze 34: .Sx COMPATIBILITY
1.26 schwarze 35: section describes compatibility with other troff \-mdoc implementations.
1.15 schwarze 36: .Pp
1.1 kristaps 37: An
1.15 schwarze 38: .Nm
1.34 schwarze 39: document follows simple rules: lines beginning with the control
1.9 schwarze 40: character
1.15 schwarze 41: .Sq \.
1.41 schwarze 42: are parsed for macros.
43: Other lines are interpreted within the scope of
1.1 kristaps 44: prior macros:
1.15 schwarze 45: .Bd -literal -offset indent
1.1 kristaps 46: \&.Sh Macro lines change control state.
47: Other lines are interpreted within the current state.
1.15 schwarze 48: .Ed
1.9 schwarze 49: .Sh LANGUAGE SYNTAX
1.15 schwarze 50: .Nm
1.1 kristaps 51: documents may contain only graphable 7-bit ASCII characters, the space
1.41 schwarze 52: character, and, in certain circumstances, the tab character.
53: All manuals must have
1.15 schwarze 54: .Ux
1.9 schwarze 55: line terminators.
1.15 schwarze 56: .Ss Comments
1.8 schwarze 57: Text following a
1.41 schwarze 58: .Sq \e\*q ,
1.8 schwarze 59: whether in a macro or free-form text line, is ignored to the end of
1.41 schwarze 60: line.
61: A macro line with only a control character and comment escape,
62: .Sq \&.\e\*q ,
63: is also ignored.
64: Macro lines with only a control character and optionally whitespace are
65: stripped from input.
1.15 schwarze 66: .Ss Reserved Characters
1.1 kristaps 67: Within a macro line, the following characters are reserved:
1.17 schwarze 68: .Pp
1.15 schwarze 69: .Bl -tag -width Ds -offset indent -compact
70: .It \&.
71: .Pq period
72: .It \&,
73: .Pq comma
74: .It \&:
75: .Pq colon
76: .It \&;
77: .Pq semicolon
78: .It \&(
79: .Pq left-parenthesis
80: .It \&)
81: .Pq right-parenthesis
82: .It \&[
83: .Pq left-bracket
84: .It \&]
85: .Pq right-bracket
86: .It \&?
87: .Pq question
88: .It \&!
89: .Pq exclamation
90: .It \&|
91: .Pq vertical bar
92: .El
93: .Pp
1.1 kristaps 94: Use of reserved characters is described in
1.15 schwarze 95: .Sx MACRO SYNTAX .
1.42 ! schwarze 96: For general use in macro lines, these characters can either be escaped
1.8 schwarze 97: with a non-breaking space
1.15 schwarze 98: .Pq Sq \e&
1.42 ! schwarze 99: or, if applicable, an appropriate escape sequence can be used.
1.15 schwarze 100: .Ss Special Characters
1.8 schwarze 101: Special characters may occur in both macro and free-form lines.
102: Sequences begin with the escape character
1.15 schwarze 103: .Sq \e
1.9 schwarze 104: followed by either an open-parenthesis
1.15 schwarze 105: .Sq \&(
1.1 kristaps 106: for two-character sequences; an open-bracket
1.15 schwarze 107: .Sq \&[
1.1 kristaps 108: for n-character sequences (terminated at a close-bracket
1.15 schwarze 109: .Sq \&] ) ;
1.27 schwarze 110: or a single one-character sequence.
111: See
1.15 schwarze 112: .Xr mandoc_char 7
1.27 schwarze 113: for a complete list.
114: Examples include
1.15 schwarze 115: .Sq \e(em
116: .Pq em-dash
1.9 schwarze 117: and
1.15 schwarze 118: .Sq \ee
119: .Pq back-slash .
120: .Ss Text Decoration
1.13 schwarze 121: Terms may be text-decorated using the
1.15 schwarze 122: .Sq \ef
1.20 schwarze 123: escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
1.22 schwarze 124: (revert to previous mode):
1.20 schwarze 125: .Pp
126: .D1 \efBbold\efR \efIitalic\efP
127: .Pp
128: A numerical representation 3, 2, or 1 (bold, italic, and Roman,
1.27 schwarze 129: respectively) may be used instead.
130: A text decoration is valid within
1.34 schwarze 131: the current font scope only: if a macro opens a font scope alongside
1.20 schwarze 132: its own scope, such as
133: .Sx \&Bf
134: .Cm \&Sy ,
135: in-scope invocations of
136: .Sq \ef
1.27 schwarze 137: are only valid within the font scope of the macro.
138: If
1.20 schwarze 139: .Sq \ef
140: is specified outside of any font scope, such as in unenclosed, free-form
141: text, it will affect the remainder of the document.
142: .Pp
143: Text may also be sized with the
144: .Sq \es
145: escape, whose syntax is one of
146: .Sq \es+-n
147: for one-digit numerals;
148: .Sq \es(+-nn
149: or
150: .Sq \es+-(nn
151: for two-digit numerals; and
152: .Sq \es[+-N] ,
153: .Sq \es+-[N] ,
154: .Sq \es'+-N' ,
155: or
156: .Sq \es+-'N'
157: for arbitrary-digit numerals:
158: .Pp
159: .D1 \es+1bigger\es-1
160: .D1 \es[+10]much bigger\es[-10]
161: .D1 \es+(10much bigger\es-(10
162: .D1 \es+'100'much much bigger\es-'100'
163: .Pp
1.22 schwarze 164: Note these forms are
1.20 schwarze 165: .Em not
1.22 schwarze 166: recommended for
1.15 schwarze 167: .Nm ,
1.20 schwarze 168: which encourages semantic annotation.
1.15 schwarze 169: .Ss Predefined Strings
1.22 schwarze 170: Historically,
1.15 schwarze 171: .Xr groff 1
1.22 schwarze 172: also defined a set of package-specific
1.15 schwarze 173: .Dq predefined strings ,
1.22 schwarze 174: which, like
1.15 schwarze 175: .Sx Special Characters ,
1.35 schwarze 176: mark special output characters and strings by way of input codes.
1.13 schwarze 177: Predefined strings are escaped with the slash-asterisk,
1.15 schwarze 178: .Sq \e* :
1.13 schwarze 179: single-character
1.15 schwarze 180: .Sq \e*X ,
1.13 schwarze 181: two-character
1.15 schwarze 182: .Sq \e*(XX ,
1.13 schwarze 183: and N-character
1.15 schwarze 184: .Sq \e*[N] .
1.13 schwarze 185: See
1.15 schwarze 186: .Xr mandoc_char 7
1.27 schwarze 187: for a complete list.
188: Examples include
1.15 schwarze 189: .Sq \e*(Am
190: .Pq ampersand
1.13 schwarze 191: and
1.15 schwarze 192: .Sq \e*(Ba
193: .Pq vertical bar .
194: .Ss Whitespace
1.26 schwarze 195: Whitespace consists of the space character.
196: In free-form lines, whitespace is preserved within a line; un-escaped
197: trailing spaces are stripped from input (unless in a literal context).
198: Blank free-form lines, which may include whitespace, are only permitted
199: within literal contexts.
1.15 schwarze 200: .Pp
1.27 schwarze 201: In macro lines, whitespace delimits arguments and is discarded.
202: If arguments are quoted, whitespace within the quotes is retained.
1.15 schwarze 203: .Ss Quotation
1.42 ! schwarze 204: Macro arguments may be quoted with double-quotes to group
1.27 schwarze 205: space-delimited terms or to retain blocks of whitespace.
206: A quoted argument begins with a double-quote preceded by whitespace.
207: The next double-quote not pair-wise adjacent to another double-quote
208: terminates the literal, regardless of surrounding whitespace.
1.15 schwarze 209: .Pp
1.42 ! schwarze 210: Note that any quoted text, even if it would cause a macro invocation
! 211: when unquoted, is considered literal text.
1.27 schwarze 212: Thus, the following produces
1.42 ! schwarze 213: .Sq Op "Fl a" :
1.15 schwarze 214: .Bd -literal -offset indent
1.42 ! schwarze 215: \&.Op "Fl a"
1.15 schwarze 216: .Ed
217: .Pp
1.9 schwarze 218: In free-form mode, quotes are regarded as opaque text.
1.17 schwarze 219: .Ss Dates
220: There are several macros in
221: .Nm
1.27 schwarze 222: that require a date argument.
223: The canonical form for dates is the American format:
1.17 schwarze 224: .Pp
225: .D1 Cm Month Day , Year
226: .Pp
227: The
228: .Cm Day
1.27 schwarze 229: value is an optionally zero-padded numeral.
230: The
1.17 schwarze 231: .Cm Month
1.27 schwarze 232: value is the full month name.
233: The
1.17 schwarze 234: .Cm Year
235: value is the full four-digit year.
236: .Pp
1.19 schwarze 237: Reduced form dates are broken-down canonical form dates:
1.17 schwarze 238: .Pp
1.19 schwarze 239: .D1 Cm Month , Year
240: .D1 Cm Year
1.17 schwarze 241: .Pp
242: Some examples of valid dates follow:
243: .Pp
244: .D1 "May, 2009" Pq reduced form
245: .D1 "2009" Pq reduced form
246: .D1 "May 20, 2009" Pq canonical form
247: .Ss Scaling Widths
248: Many macros support scaled widths for their arguments, such as
249: stipulating a two-inch list indentation with the following:
250: .Bd -literal -offset indent
251: \&.Bl -tag -width 2i
252: .Ed
253: .Pp
254: The syntax for scaled widths is
255: .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
256: where a decimal must be preceded or proceeded by at least one digit.
1.27 schwarze 257: Negative numbers, while accepted, are truncated to zero.
258: The following scaling units are accepted:
1.17 schwarze 259: .Pp
260: .Bl -tag -width Ds -offset indent -compact
261: .It c
262: centimetre
263: .It i
264: inch
265: .It P
266: pica (~1/6 inch)
267: .It p
268: point (~1/72 inch)
269: .It f
270: synonym for
271: .Sq u
272: .It v
273: default vertical span
274: .It m
275: width of rendered
276: .Sq m
277: .Pq em
278: character
279: .It n
280: width of rendered
281: .Sq n
282: .Pq en
283: character
284: .It u
285: default horizontal span
286: .It M
287: mini-em (~1/100 em)
288: .El
289: .Pp
290: Using anything other than
291: .Sq m ,
292: .Sq n ,
293: .Sq u ,
294: or
295: .Sq v
1.27 schwarze 296: is necessarily non-portable across output media.
297: See
1.17 schwarze 298: .Sx COMPATIBILITY .
1.28 schwarze 299: .Ss Sentence Spacing
300: When composing a manual, make sure that your sentences end at the end of
301: a line.
302: By doing so, front-ends will be able to apply the proper amount of
303: spacing after the end of sentence (unescaped) period, exclamation mark,
1.29 schwarze 304: or question mark followed by zero or more non-sentence closing
305: delimiters (
306: .Ns Sq \&) ,
307: .Sq \&] ,
308: .Sq \&' ,
309: .Sq \&" ) .
310: .Pp
311: The proper spacing is also intelligently preserved if a sentence ends at
312: the boundary of a macro line, e.g.,
313: .Pp
314: .D1 \&Xr mandoc 1 \.
315: .D1 \&Fl T \&Ns \&Cm ascii \.
1.8 schwarze 316: .Sh MANUAL STRUCTURE
1.17 schwarze 317: A well-formed
1.15 schwarze 318: .Nm
1.17 schwarze 319: document consists of a document prologue followed by one or more
320: sections.
321: .Pp
1.42 ! schwarze 322: The prologue, which consists of the
1.17 schwarze 323: .Sx \&Dd ,
324: .Sx \&Dt ,
325: and
326: .Sx \&Os
1.42 ! schwarze 327: macros in that order, is required for every document.
1.17 schwarze 328: .Pp
1.22 schwarze 329: The first section (sections are denoted by
1.17 schwarze 330: .Sx \&Sh )
331: must be the NAME section, consisting of at least one
332: .Sx \&Nm
1.9 schwarze 333: followed by
1.17 schwarze 334: .Sx \&Nd .
335: .Pp
1.35 schwarze 336: Following that, convention dictates specifying at least the
337: .Em SYNOPSIS
338: and
339: .Em DESCRIPTION
340: sections, although this varies between manual sections.
1.17 schwarze 341: .Pp
342: The following is a well-formed skeleton
343: .Nm
344: file:
1.15 schwarze 345: .Bd -literal -offset indent
1.8 schwarze 346: \&.Dd $\&Mdocdate$
347: \&.Dt mdoc 7
348: \&.Os
349: \&.Sh NAME
1.15 schwarze 350: \&.Nm foo
351: \&.Nd a description goes here
1.31 schwarze 352: \&.\e\*q The next is for sections 2, 3, & 9 only.
1.15 schwarze 353: \&.\e\*q .Sh LIBRARY
354: \&.Sh SYNOPSIS
355: \&.Nm foo
356: \&.Op Fl options
357: \&.Ar
358: \&.Sh DESCRIPTION
359: The
360: \&.Nm
361: utility processes files ...
362: \&.\e\*q .Sh IMPLEMENTATION NOTES
363: \&.\e\*q The next is for sections 2, 3, & 9 only.
364: \&.\e\*q .Sh RETURN VALUES
365: \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
366: \&.\e\*q .Sh ENVIRONMENT
367: \&.\e\*q .Sh FILES
1.27 schwarze 368: \&.\e\*q The next is for sections 1 & 8 only.
369: \&.\e\*q .Sh EXIT STATUS
1.15 schwarze 370: \&.\e\*q .Sh EXAMPLES
371: \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
372: \&.\e\*q .Sh DIAGNOSTICS
373: \&.\e\*q The next is for sections 2, 3, & 9 only.
374: \&.\e\*q .Sh ERRORS
375: \&.\e\*q .Sh SEE ALSO
376: \&.\e\*q .Xr foobar 1
377: \&.\e\*q .Sh STANDARDS
378: \&.\e\*q .Sh HISTORY
379: \&.\e\*q .Sh AUTHORS
380: \&.\e\*q .Sh CAVEATS
381: \&.\e\*q .Sh BUGS
382: \&.\e\*q .Sh SECURITY CONSIDERATIONS
383: .Ed
384: .Pp
1.17 schwarze 385: The sections in a
386: .Nm
1.27 schwarze 387: document are conventionally ordered as they appear above.
388: Sections should be composed as follows:
1.19 schwarze 389: .Bl -ohang -offset Ds
390: .It Em NAME
1.42 ! schwarze 391: The name(s) and a one-line description of the documented material.
1.27 schwarze 392: The syntax for this as follows:
1.19 schwarze 393: .Bd -literal -offset indent
394: \&.Nm name0
395: \&.Nm name1
396: \&.Nm name2
1.42 ! schwarze 397: \&.Nd a one-line description
1.19 schwarze 398: .Ed
399: .Pp
400: The
1.17 schwarze 401: .Sx \&Nm
1.19 schwarze 402: macro(s) must precede the
403: .Sx \&Nd
404: macro.
1.21 schwarze 405: .Pp
1.22 schwarze 406: See
1.21 schwarze 407: .Sx \&Nm
408: and
409: .Sx \&Nd .
1.19 schwarze 410: .It Em LIBRARY
411: The name of the library containing the documented material, which is
1.31 schwarze 412: assumed to be a function in a section 2, 3, or 9 manual.
1.27 schwarze 413: The syntax for this is as follows:
1.19 schwarze 414: .Bd -literal -offset indent
415: \&.Lb libarm
416: .Ed
417: .Pp
418: See
1.21 schwarze 419: .Sx \&Lb .
1.19 schwarze 420: .It Em SYNOPSIS
421: Documents the utility invocation syntax, function call syntax, or device
1.22 schwarze 422: configuration.
1.19 schwarze 423: .Pp
424: For the first, utilities (sections 1, 6, and 8), this is
425: generally structured as follows:
426: .Bd -literal -offset indent
427: \&.Nm foo
428: \&.Op Fl v
429: \&.Op Fl o Ar file
430: \&.Op Ar
431: \&.Nm bar
432: \&.Op Fl v
433: \&.Op Fl o Ar file
434: \&.Op Ar
435: .Ed
436: .Pp
437: For the second, function calls (sections 2, 3, 9):
438: .Bd -literal -offset indent
439: \&.Vt extern const char *global;
440: \&.In header.h
441: \&.Ft "char *"
442: \&.Fn foo "const char *src"
443: \&.Ft "char *"
444: \&.Fn bar "const char *src"
445: .Ed
446: .Pp
447: And for the third, configurations (section 4):
448: .Bd -literal -offset indent
449: \&.Cd \*qit* at isa? port 0x2e\*q
450: \&.Cd \*qit* at isa? port 0x4e\*q
451: .Ed
452: .Pp
1.22 schwarze 453: Manuals not in these sections generally don't need a
1.19 schwarze 454: .Em SYNOPSIS .
1.21 schwarze 455: .Pp
1.35 schwarze 456: Some macros are displayed differently in the
457: .Em SYNOPSIS
458: section, particularly
459: .Sx \&Nm ,
1.21 schwarze 460: .Sx \&Cd ,
1.35 schwarze 461: .Sx \&Fd ,
1.21 schwarze 462: .Sx \&Fn ,
1.35 schwarze 463: .Sx \&Fo ,
464: .Sx \&In ,
465: .Sx \&Vt ,
466: and
467: .Sx \&Ft .
1.41 schwarze 468: All of these macros are output on their own line.
469: If two such dissimilar macros are pair-wise invoked (except for
1.35 schwarze 470: .Sx \&Ft
471: before
472: .Sx \&Fo
473: or
474: .Sx \&Fn ) ,
475: they are separated by a vertical space, unless in the case of
476: .Sx \&Fo ,
477: .Sx \&Fn ,
478: and
1.21 schwarze 479: .Sx \&Ft ,
1.35 schwarze 480: which are always separated by vertical space.
1.38 schwarze 481: .Pp
482: When text and macros following an
483: .Sx \&Nm
484: macro starting an input line span multiple output lines,
485: all output lines but the first will be indented to align
486: with the text immediately following the
487: .Sx \&Nm
488: macro, up to the next
489: .Sx \&Nm ,
1.42 ! schwarze 490: .Sx \&Sh ,
1.38 schwarze 491: or
492: .Sx \&Ss
493: macro or the end of an enclosing block, whichever comes first.
1.19 schwarze 494: .It Em DESCRIPTION
1.22 schwarze 495: This expands upon the brief, one-line description in
1.19 schwarze 496: .Em NAME .
497: It usually contains a break-down of the options (if documenting a
498: command), such as:
499: .Bd -literal -offset indent
500: The arguments are as follows:
501: \&.Bl \-tag \-width Ds
502: \&.It Fl v
503: Print verbose information.
504: \&.El
505: .Ed
1.21 schwarze 506: .Pp
1.19 schwarze 507: Manuals not documenting a command won't include the above fragment.
508: .It Em IMPLEMENTATION NOTES
1.27 schwarze 509: Implementation-specific notes should be kept here.
510: This is useful when implementing standard functions that may have side
511: effects or notable algorithmic implications.
1.19 schwarze 512: .It Em RETURN VALUES
513: This section is the dual of
514: .Em EXIT STATUS ,
1.27 schwarze 515: which is used for commands.
516: It documents the return values of functions in sections 2, 3, and 9.
1.19 schwarze 517: .Pp
518: See
519: .Sx \&Rv .
520: .It Em ENVIRONMENT
1.42 ! schwarze 521: Lists the environment variables used by the utility,
! 522: and explains the syntax and semantics of their values.
! 523: The
! 524: .Xr environ 7
! 525: manual provides examples of typical content and formatting.
1.19 schwarze 526: .Pp
527: See
528: .Sx \&Ev .
529: .It Em FILES
1.27 schwarze 530: Documents files used.
1.42 ! schwarze 531: It's helpful to document both the file name and a short description of how
1.27 schwarze 532: the file is used (created, modified, etc.).
1.19 schwarze 533: .Pp
534: See
535: .Sx \&Pa .
1.27 schwarze 536: .It Em EXIT STATUS
537: Command exit status for section 1, 6, and 8 manuals.
538: This section is the dual of
539: .Em RETURN VALUES ,
540: which is used for functions.
541: Historically, this information was described in
542: .Em DIAGNOSTICS ,
543: a practise that is now discouraged.
544: .Pp
545: See
546: .Sx \&Ex .
1.19 schwarze 547: .It Em EXAMPLES
1.27 schwarze 548: Example usages.
549: This often contains snippets of well-formed, well-tested invocations.
550: Make doubly sure that your examples work properly!
1.19 schwarze 551: .It Em DIAGNOSTICS
1.27 schwarze 552: Documents error conditions.
553: This is most useful in section 4 manuals.
1.19 schwarze 554: Historically, this section was used in place of
555: .Em EXIT STATUS
556: for manuals in sections 1, 6, and 8; however, this practise is
557: discouraged.
558: .Pp
559: See
1.21 schwarze 560: .Sx \&Bl
561: .Fl diag .
1.19 schwarze 562: .It Em ERRORS
563: Documents error handling in sections 2, 3, and 9.
564: .Pp
565: See
566: .Sx \&Er .
567: .It Em SEE ALSO
1.27 schwarze 568: References other manuals with related topics.
569: This section should exist for most manuals.
570: Cross-references should conventionally be ordered first by section, then
571: alphabetically.
1.19 schwarze 572: .Pp
573: See
574: .Sx \&Xr .
575: .It Em STANDARDS
1.27 schwarze 576: References any standards implemented or used.
577: If not adhering to any standards, the
1.19 schwarze 578: .Em HISTORY
579: section should be used instead.
580: .Pp
581: See
582: .Sx \&St .
583: .It Em HISTORY
584: The history of any manual without a
585: .Em STANDARDS
586: section should be described in this section.
587: .It Em AUTHORS
588: Credits to authors, if applicable, should appear in this section.
1.42 ! schwarze 589: Authors should generally be noted by both name and email address.
1.19 schwarze 590: .Pp
591: See
592: .Sx \&An .
593: .It Em CAVEATS
1.42 ! schwarze 594: Common misuses and misunderstandings should be explained
1.19 schwarze 595: in this section.
596: .It Em BUGS
1.42 ! schwarze 597: Known bugs, limitations and work-arounds should be described
! 598: in this section.
1.19 schwarze 599: .It Em SECURITY CONSIDERATIONS
600: Documents any security precautions that operators should consider.
1.17 schwarze 601: .El
1.8 schwarze 602: .Sh MACRO SYNTAX
1.14 schwarze 603: Macros are one to three three characters in length and begin with a
1.42 ! schwarze 604: control character,
1.15 schwarze 605: .Sq \&. ,
1.27 schwarze 606: at the beginning of the line.
607: An arbitrary amount of whitespace may sit between the control character
608: and the macro name.
609: Thus, the following are equivalent:
1.17 schwarze 610: .Bd -literal -offset indent
611: \&.Pp
612: \&.\ \ \ \&Pp
613: .Ed
1.15 schwarze 614: .Pp
1.27 schwarze 615: The syntax of a macro depends on its classification.
616: In this section,
1.15 schwarze 617: .Sq \-arg
1.8 schwarze 618: refers to macro arguments, which may be followed by zero or more
1.15 schwarze 619: .Sq parm
1.8 schwarze 620: parameters;
1.15 schwarze 621: .Sq \&Yo
1.8 schwarze 622: opens the scope of a macro; and if specified,
1.15 schwarze 623: .Sq \&Yc
1.8 schwarze 624: closes it out.
1.15 schwarze 625: .Pp
1.8 schwarze 626: The
1.15 schwarze 627: .Em Callable
1.8 schwarze 628: column indicates that the macro may be called subsequent to the initial
1.27 schwarze 629: line-macro.
630: If a macro is not callable, then its invocation after the initial line
631: macro is interpreted as opaque text, such that
1.16 schwarze 632: .Sq \&.Fl \&Sh
1.14 schwarze 633: produces
1.16 schwarze 634: .Sq Fl \&Sh .
1.15 schwarze 635: .Pp
1.14 schwarze 636: The
1.42 ! schwarze 637: .Em Parsed
1.8 schwarze 638: column indicates whether the macro may be followed by further
1.27 schwarze 639: (ostensibly callable) macros.
1.42 ! schwarze 640: If a macro is not parsed, subsequent macro invocations on the line
1.27 schwarze 641: will be interpreted as opaque text.
1.15 schwarze 642: .Pp
1.14 schwarze 643: The
1.15 schwarze 644: .Em Scope
1.8 schwarze 645: column, if applicable, describes closure rules.
1.15 schwarze 646: .Ss Block full-explicit
1.27 schwarze 647: Multi-line scope closed by an explicit closing macro.
648: All macros contains bodies; only
1.17 schwarze 649: .Sx \&Bf
1.8 schwarze 650: contains a head.
1.15 schwarze 651: .Bd -literal -offset indent
1.9 schwarze 652: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
653: \(lBbody...\(rB
1.1 kristaps 654: \&.Yc
1.15 schwarze 655: .Ed
656: .Pp
1.42 ! schwarze 657: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXX"
! 658: .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
1.17 schwarze 659: .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
660: .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
661: .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
662: .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
663: .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
664: .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
665: .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
666: .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
1.15 schwarze 667: .El
668: .Ss Block full-implicit
1.8 schwarze 669: Multi-line scope closed by end-of-file or implicitly by another macro.
1.9 schwarze 670: All macros have bodies; some
1.15 schwarze 671: .Po
1.17 schwarze 672: .Sx \&It Fl bullet ,
673: .Fl hyphen ,
674: .Fl dash ,
675: .Fl enum ,
676: .Fl item
1.15 schwarze 677: .Pc
1.17 schwarze 678: don't have heads; only one
679: .Po
1.42 ! schwarze 680: .Sx \&It
! 681: in
! 682: .Sx \&Bl Fl column
1.22 schwarze 683: .Pc
1.17 schwarze 684: has multiple heads.
1.15 schwarze 685: .Bd -literal -offset indent
1.9 schwarze 686: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
687: \(lBbody...\(rB
1.15 schwarze 688: .Ed
689: .Pp
1.42 ! schwarze 690: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX"
! 691: .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
1.17 schwarze 692: .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
693: .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
1.38 schwarze 694: .It Sx \&Nm Ta \&No Ta Yes Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
1.17 schwarze 695: .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
696: .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
1.15 schwarze 697: .El
1.38 schwarze 698: .Pp
699: Note that the
700: .Sx \&Nm
701: macro is a
702: .Sx Block full-implicit
703: macro only when invoked as the first macro
704: in a
705: .Em SYNOPSIS
706: section line, else it is
707: .Sx In-line .
1.15 schwarze 708: .Ss Block partial-explicit
1.27 schwarze 709: Like block full-explicit, but also with single-line scope.
710: Each has at least a body and, in limited circumstances, a head
1.17 schwarze 711: .Po
712: .Sx \&Fo ,
713: .Sx \&Eo
714: .Pc
1.9 schwarze 715: and/or tail
1.17 schwarze 716: .Pq Sx \&Ec .
1.15 schwarze 717: .Bd -literal -offset indent
1.9 schwarze 718: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
719: \(lBbody...\(rB
720: \&.Yc \(lBtail...\(rB
1.8 schwarze 721:
722: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
1.9 schwarze 723: \(lBbody...\(rB \&Yc \(lBtail...\(rB
1.15 schwarze 724: .Ed
725: .Pp
1.42 ! schwarze 726: .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -compact -offset indent
! 727: .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
1.17 schwarze 728: .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
729: .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
730: .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
731: .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
732: .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
733: .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
734: .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
735: .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
736: .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
737: .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
738: .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
739: .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
740: .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
741: .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
742: .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
743: .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
744: .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
745: .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
746: .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
747: .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
748: .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
749: .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
750: .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
751: .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
1.15 schwarze 752: .El
753: .Ss Block partial-implicit
1.9 schwarze 754: Like block full-implicit, but with single-line scope closed by
1.15 schwarze 755: .Sx Reserved Characters
1.8 schwarze 756: or end of line.
1.15 schwarze 757: .Bd -literal -offset indent
1.8 schwarze 758: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
1.15 schwarze 759: .Ed
760: .Pp
1.42 ! schwarze 761: .Bl -column "MacroX" "CallableX" "ParsedX" -compact -offset indent
! 762: .It Em Macro Ta Em Callable Ta Em Parsed
1.17 schwarze 763: .It Sx \&Aq Ta Yes Ta Yes
764: .It Sx \&Bq Ta Yes Ta Yes
765: .It Sx \&Brq Ta Yes Ta Yes
766: .It Sx \&D1 Ta \&No Ta \&Yes
767: .It Sx \&Dl Ta \&No Ta Yes
768: .It Sx \&Dq Ta Yes Ta Yes
769: .It Sx \&Op Ta Yes Ta Yes
770: .It Sx \&Pq Ta Yes Ta Yes
771: .It Sx \&Ql Ta Yes Ta Yes
772: .It Sx \&Qq Ta Yes Ta Yes
773: .It Sx \&Sq Ta Yes Ta Yes
1.22 schwarze 774: .It Sx \&Vt Ta Yes Ta Yes
1.15 schwarze 775: .El
1.22 schwarze 776: .Pp
777: Note that the
778: .Sx \&Vt
779: macro is a
780: .Sx Block partial-implicit
781: only when invoked as the first macro
1.33 schwarze 782: in a
783: .Em SYNOPSIS
784: section line, else it is
1.22 schwarze 785: .Sx In-line .
1.15 schwarze 786: .Ss In-line
1.9 schwarze 787: Closed by
1.15 schwarze 788: .Sx Reserved Characters ,
1.27 schwarze 789: end of line, fixed argument lengths, and/or subsequent macros.
790: In-line macros have only text children.
791: If a number (or inequality) of arguments is
1.15 schwarze 792: .Pq n ,
1.1 kristaps 793: then the macro accepts an arbitrary number of arguments.
1.15 schwarze 794: .Bd -literal -offset indent
1.8 schwarze 795: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
796:
797: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
798:
799: \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
1.15 schwarze 800: .Ed
801: .Pp
1.42 ! schwarze 802: .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -compact -offset indent
! 803: .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
1.17 schwarze 804: .It Sx \&%A Ta \&No Ta \&No Ta >0
805: .It Sx \&%B Ta \&No Ta \&No Ta >0
806: .It Sx \&%C Ta \&No Ta \&No Ta >0
807: .It Sx \&%D Ta \&No Ta \&No Ta >0
808: .It Sx \&%I Ta \&No Ta \&No Ta >0
809: .It Sx \&%J Ta \&No Ta \&No Ta >0
810: .It Sx \&%N Ta \&No Ta \&No Ta >0
811: .It Sx \&%O Ta \&No Ta \&No Ta >0
812: .It Sx \&%P Ta \&No Ta \&No Ta >0
1.18 schwarze 813: .It Sx \&%Q Ta \&No Ta \&No Ta >0
1.17 schwarze 814: .It Sx \&%R Ta \&No Ta \&No Ta >0
815: .It Sx \&%T Ta \&No Ta \&No Ta >0
1.18 schwarze 816: .It Sx \&%U Ta \&No Ta \&No Ta >0
1.17 schwarze 817: .It Sx \&%V Ta \&No Ta \&No Ta >0
818: .It Sx \&Ad Ta Yes Ta Yes Ta n
819: .It Sx \&An Ta Yes Ta Yes Ta n
820: .It Sx \&Ap Ta Yes Ta Yes Ta 0
821: .It Sx \&Ar Ta Yes Ta Yes Ta n
822: .It Sx \&At Ta Yes Ta Yes Ta 1
823: .It Sx \&Bsx Ta Yes Ta Yes Ta n
824: .It Sx \&Bt Ta \&No Ta \&No Ta 0
825: .It Sx \&Bx Ta Yes Ta Yes Ta n
826: .It Sx \&Cd Ta Yes Ta Yes Ta >0
827: .It Sx \&Cm Ta Yes Ta Yes Ta n
828: .It Sx \&Db Ta \&No Ta \&No Ta 1
1.42 ! schwarze 829: .It Sx \&Dd Ta \&No Ta \&No Ta n
1.17 schwarze 830: .It Sx \&Dt Ta \&No Ta \&No Ta n
831: .It Sx \&Dv Ta Yes Ta Yes Ta n
832: .It Sx \&Dx Ta Yes Ta Yes Ta n
833: .It Sx \&Em Ta Yes Ta Yes Ta >0
834: .It Sx \&En Ta \&No Ta \&No Ta 0
835: .It Sx \&Er Ta Yes Ta Yes Ta >0
836: .It Sx \&Es Ta \&No Ta \&No Ta 0
837: .It Sx \&Ev Ta Yes Ta Yes Ta n
838: .It Sx \&Ex Ta \&No Ta \&No Ta n
839: .It Sx \&Fa Ta Yes Ta Yes Ta n
840: .It Sx \&Fd Ta \&No Ta \&No Ta >0
841: .It Sx \&Fl Ta Yes Ta Yes Ta n
842: .It Sx \&Fn Ta Yes Ta Yes Ta >0
843: .It Sx \&Fr Ta \&No Ta \&No Ta n
844: .It Sx \&Ft Ta Yes Ta Yes Ta n
845: .It Sx \&Fx Ta Yes Ta Yes Ta n
846: .It Sx \&Hf Ta \&No Ta \&No Ta n
847: .It Sx \&Ic Ta Yes Ta Yes Ta >0
848: .It Sx \&In Ta \&No Ta \&No Ta n
849: .It Sx \&Lb Ta \&No Ta \&No Ta 1
850: .It Sx \&Li Ta Yes Ta Yes Ta n
851: .It Sx \&Lk Ta Yes Ta Yes Ta n
852: .It Sx \&Lp Ta \&No Ta \&No Ta 0
853: .It Sx \&Ms Ta Yes Ta Yes Ta >0
854: .It Sx \&Mt Ta Yes Ta Yes Ta >0
855: .It Sx \&Nm Ta Yes Ta Yes Ta n
856: .It Sx \&No Ta Yes Ta Yes Ta 0
857: .It Sx \&Ns Ta Yes Ta Yes Ta 0
858: .It Sx \&Nx Ta Yes Ta Yes Ta n
859: .It Sx \&Os Ta \&No Ta \&No Ta n
860: .It Sx \&Ot Ta \&No Ta \&No Ta n
861: .It Sx \&Ox Ta Yes Ta Yes Ta n
862: .It Sx \&Pa Ta Yes Ta Yes Ta n
1.25 schwarze 863: .It Sx \&Pf Ta Yes Ta Yes Ta 1
1.17 schwarze 864: .It Sx \&Pp Ta \&No Ta \&No Ta 0
865: .It Sx \&Rv Ta \&No Ta \&No Ta n
866: .It Sx \&Sm Ta \&No Ta \&No Ta 1
867: .It Sx \&St Ta \&No Ta Yes Ta 1
868: .It Sx \&Sx Ta Yes Ta Yes Ta >0
869: .It Sx \&Sy Ta Yes Ta Yes Ta >0
870: .It Sx \&Tn Ta Yes Ta Yes Ta >0
871: .It Sx \&Ud Ta \&No Ta \&No Ta 0
872: .It Sx \&Ux Ta Yes Ta Yes Ta n
873: .It Sx \&Va Ta Yes Ta Yes Ta n
874: .It Sx \&Vt Ta Yes Ta Yes Ta >0
1.22 schwarze 875: .It Sx \&Xr Ta Yes Ta Yes Ta >0
1.17 schwarze 876: .It Sx \&br Ta \&No Ta \&No Ta 0
877: .It Sx \&sp Ta \&No Ta \&No Ta 1
1.22 schwarze 878: .El
1.17 schwarze 879: .Sh REFERENCE
880: This section is a canonical reference of all macros, arranged
1.27 schwarze 881: alphabetically.
882: For the scoping of individual macros, see
1.17 schwarze 883: .Sx MACRO SYNTAX .
884: .Ss \&%A
885: Author name of an
886: .Sx \&Rs
1.41 schwarze 887: block.
888: Multiple authors should each be accorded their own
1.17 schwarze 889: .Sx \%%A
1.41 schwarze 890: line.
891: Author names should be ordered with full or abbreviated forename(s)
892: first, then full surname.
1.17 schwarze 893: .Ss \&%B
894: Book title of an
895: .Sx \&Rs
1.41 schwarze 896: block.
897: This macro may also be used in a non-bibliographic context when
1.17 schwarze 898: referring to book titles.
899: .Ss \&%C
900: Publication city or location of an
901: .Sx \&Rs
902: block.
903: .Pp
904: .Em Remarks :
905: this macro is not implemented in
906: .Xr groff 1 .
907: .Ss \&%D
908: Publication date of an
909: .Sx \&Rs
1.41 schwarze 910: block.
911: This should follow the reduced or canonical form syntax described in
1.17 schwarze 912: .Sx Dates .
913: .Ss \&%I
914: Publisher or issuer name of an
915: .Sx \&Rs
916: block.
917: .Ss \&%J
918: Journal name of an
919: .Sx \&Rs
920: block.
921: .Ss \&%N
922: Issue number (usually for journals) of an
923: .Sx \&Rs
924: block.
925: .Ss \&%O
926: Optional information of an
927: .Sx \&Rs
928: block.
929: .Ss \&%P
930: Book or journal page number of an
931: .Sx \&Rs
932: block.
933: .Ss \&%Q
934: Institutional author (school, government, etc.) of an
935: .Sx \&Rs
1.41 schwarze 936: block.
937: Multiple institutional authors should each be accorded their own
1.17 schwarze 938: .Sx \&%Q
939: line.
940: .Ss \&%R
941: Technical report name of an
942: .Sx \&Rs
943: block.
944: .Ss \&%T
945: Article title of an
946: .Sx \&Rs
1.41 schwarze 947: block.
948: This macro may also be used in a non-bibliographical context when
949: referring to article titles.
1.18 schwarze 950: .Ss \&%U
951: URI of reference document.
1.17 schwarze 952: .Ss \&%V
953: Volume number of an
954: .Sx \&Rs
955: block.
956: .Ss \&Ac
1.42 ! schwarze 957: Close an
1.17 schwarze 958: .Sx \&Ao
1.41 schwarze 959: block.
960: Does not have any tail arguments.
1.17 schwarze 961: .Ss \&Ad
1.42 ! schwarze 962: Memory address.
! 963: Do not use this for postal addresses.
1.17 schwarze 964: .Pp
965: Examples:
1.25 schwarze 966: .D1 \&.Ad [0,$]
967: .D1 \&.Ad 0x00000000
1.17 schwarze 968: .Ss \&An
1.27 schwarze 969: Author name.
1.42 ! schwarze 970: Requires either the name of an author or one of the following arguments:
1.41 schwarze 971: .Pp
972: .Bl -tag -width "-nosplitX" -offset indent -compact
1.17 schwarze 973: .It Fl split
1.42 ! schwarze 974: Start a new output line before each subsequent invocation of
! 975: .Sx \&An .
1.17 schwarze 976: .It Fl nosplit
977: The opposite of
978: .Fl split .
979: .El
980: .Pp
1.42 ! schwarze 981: The default is
! 982: .Fl nosplit .
! 983: The effect of selecting either of the
! 984: .Fl split
! 985: modes ends at the beginning of the
! 986: .Em AUTHORS
! 987: section.
1.41 schwarze 988: In the
989: .Em AUTHORS
1.42 ! schwarze 990: section, the default is
! 991: .Fl nosplit
! 992: for the first author listing and
1.17 schwarze 993: .Fl split
1.42 ! schwarze 994: for all other author listings.
1.17 schwarze 995: .Pp
996: Examples:
1.25 schwarze 997: .D1 \&.An -nosplit
1.42 ! schwarze 998: .D1 \&.An Kristaps Dzonsons \&Aq kristaps@bsd.lv
1.17 schwarze 999: .Ss \&Ao
1.42 ! schwarze 1000: Begin a block enclosed by angle brackets.
1.27 schwarze 1001: Does not have any head arguments.
1.17 schwarze 1002: .Pp
1003: Examples:
1.25 schwarze 1004: .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
1.17 schwarze 1005: .Pp
1006: See also
1007: .Sx \&Aq .
1008: .Ss \&Ap
1.41 schwarze 1009: Inserts an apostrophe without any surrounding whitespace.
1.35 schwarze 1010: This is generally used as a grammatical device when referring to the verb
1.41 schwarze 1011: form of a function.
1012: .Pp
1013: Examples:
1014: .D1 \&.Fn execve \&Ap d
1.17 schwarze 1015: .Ss \&Aq
1.42 ! schwarze 1016: Encloses its arguments in angle brackets.
1.17 schwarze 1017: .Pp
1018: Examples:
1.25 schwarze 1019: .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
1.17 schwarze 1020: .Pp
1021: .Em Remarks :
1022: this macro is often abused for rendering URIs, which should instead use
1023: .Sx \&Lk
1024: or
1025: .Sx \&Mt ,
1026: or to note pre-processor
1027: .Dq Li #include
1028: statements, which should use
1029: .Sx \&In .
1030: .Pp
1031: See also
1032: .Sx \&Ao .
1033: .Ss \&Ar
1.27 schwarze 1034: Command arguments.
1035: If an argument is not provided, the string
1.42 ! schwarze 1036: .Dq file ...\&
1.17 schwarze 1037: is used as a default.
1038: .Pp
1039: Examples:
1.25 schwarze 1040: .D1 \&.Fl o \&Ns \&Ar file1
1041: .D1 \&.Ar
1042: .D1 \&.Ar arg1 , arg2 .
1.17 schwarze 1043: .Ss \&At
1.27 schwarze 1044: Formats an AT&T version.
1.42 ! schwarze 1045: Accepts one optional argument:
1.41 schwarze 1046: .Pp
1047: .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact
1.17 schwarze 1048: .It Cm v[1-7] | 32v
1049: A version of
1050: .At .
1051: .It Cm V[.[1-4]]?
1.42 ! schwarze 1052: A version of
! 1053: .At V .
1.17 schwarze 1054: .El
1055: .Pp
1.42 ! schwarze 1056: Note that these arguments do not begin with a hyphen.
1.17 schwarze 1057: .Pp
1058: Examples:
1.25 schwarze 1059: .D1 \&.At
1060: .D1 \&.At V.1
1.17 schwarze 1061: .Pp
1062: See also
1063: .Sx \&Bsx ,
1064: .Sx \&Bx ,
1065: .Sx \&Dx ,
1066: .Sx \&Fx ,
1067: .Sx \&Nx ,
1068: .Sx \&Ox ,
1069: and
1070: .Sx \&Ux .
1071: .Ss \&Bc
1.42 ! schwarze 1072: Close a
1.17 schwarze 1073: .Sx \&Bo
1.41 schwarze 1074: block.
1075: Does not have any tail arguments.
1.17 schwarze 1076: .Ss \&Bd
1.42 ! schwarze 1077: Begin a display block.
1.39 schwarze 1078: Its syntax is as follows:
1079: .Bd -ragged -offset indent
1080: .Pf \. Sx \&Bd
1.42 ! schwarze 1081: .Fl Ns Ar type
1.39 schwarze 1082: .Op Fl offset Ar width
1083: .Op Fl compact
1084: .Ed
1085: .Pp
1.42 ! schwarze 1086: Display blocks are used to select a different indentation and
! 1087: justification than the one used by the surrounding text.
! 1088: They may contain both macro lines and free-form text lines.
! 1089: By default, a display block is preceded by a vertical space.
1.17 schwarze 1090: .Pp
1.42 ! schwarze 1091: The
! 1092: .Ar type
! 1093: must be one of the following:
! 1094: .Bl -tag -width 13n -offset indent
! 1095: .It Fl centered
! 1096: Centre-justify each line.
! 1097: Using this display type is not recommended; many
! 1098: .Nm
! 1099: implementations render it poorly.
! 1100: .It Fl filled
! 1101: Left- and right-justify the block.
! 1102: .It Fl literal
! 1103: Do not justify the block at all.
! 1104: Preserve white space as it appears in the input.
1.17 schwarze 1105: .It Fl ragged
1106: Only left-justify the block.
1107: .It Fl unfilled
1.42 ! schwarze 1108: An alias for
! 1109: .Fl literal .
1.17 schwarze 1110: .El
1111: .Pp
1.42 ! schwarze 1112: The
! 1113: .Ar type
! 1114: must be provided first.
! 1115: Additional arguments may follow:
! 1116: .Bl -tag -width 13n -offset indent
! 1117: .It Fl offset Ar width
! 1118: Indent the display by the
! 1119: .Ar width ,
! 1120: which may be one of the following:
1.17 schwarze 1121: .Bl -item
1122: .It
1.42 ! schwarze 1123: One of the pre-defined strings
! 1124: .Cm indent ,
1.17 schwarze 1125: the width of standard indentation;
1.42 ! schwarze 1126: .Cm indent-two ,
1.17 schwarze 1127: twice
1.42 ! schwarze 1128: .Cm indent ;
! 1129: .Cm left ,
1.39 schwarze 1130: which has no effect;
1.42 ! schwarze 1131: .Cm right ,
! 1132: which justifies to the right margin; or
! 1133: .Cm center ,
1.17 schwarze 1134: which aligns around an imagined centre axis.
1135: .It
1.42 ! schwarze 1136: A macro invocation, which selects a predefined width
! 1137: associated with that macro.
1.27 schwarze 1138: The most popular is the imaginary macro
1.18 schwarze 1139: .Ar \&Ds ,
1.17 schwarze 1140: which resolves to
1.42 ! schwarze 1141: .Sy 6n .
1.17 schwarze 1142: .It
1.42 ! schwarze 1143: A width using the syntax described in
1.17 schwarze 1144: .Sx Scaling Widths .
1145: .It
1.42 ! schwarze 1146: An arbitrary string, which indents by the length of this string.
1.17 schwarze 1147: .El
1148: .Pp
1.42 ! schwarze 1149: When the argument is missing,
! 1150: .Fl offset
! 1151: is ignored.
1.17 schwarze 1152: .It Fl compact
1.42 ! schwarze 1153: Do not assert vertical space before the display.
1.17 schwarze 1154: .El
1155: .Pp
1156: Examples:
1157: .Bd -literal -offset indent
1.42 ! schwarze 1158: \&.Bd \-literal \-offset indent \-compact
1.17 schwarze 1159: Hello world.
1160: \&.Ed
1161: .Ed
1162: .Pp
1163: See also
1164: .Sx \&D1
1165: and
1166: .Sx \&Dl .
1167: .Ss \&Bf
1.39 schwarze 1168: Change the font mode for a scoped block of text.
1169: Its syntax is as follows:
1170: .Bd -ragged -offset indent
1171: .Pf \. Sx \&Bf
1172: .Oo
1173: .Fl emphasis | literal | symbolic |
1174: .Cm \&Em | \&Li | \&Sy
1175: .Oc
1176: .Ed
1177: .Pp
1178: The
1179: .Fl emphasis
1180: and
1181: .Cm \&Em
1182: argument are equivalent, as are
1183: .Fl symbolic
1184: and
1185: .Cm \&Sy,
1186: and
1187: .Fl literal
1188: and
1189: .Cm \&Li .
1190: Without an argument, this macro does nothing.
1191: The font mode continues until broken by a new font mode in a nested
1192: scope or
1193: .Sx \&Ef
1194: is encountered.
1195: .Pp
1196: See also
1197: .Sx \&Li ,
1198: .Sx \&Ef ,
1.42 ! schwarze 1199: .Sx \&Em ,
1.39 schwarze 1200: and
1201: .Sx \&Sy .
1.17 schwarze 1202: .Ss \&Bk
1.42 ! schwarze 1203: Keep the output generated from each macro input line together
! 1204: on one single output line.
! 1205: Line breaks in free-form text lines are unaffected.
! 1206: The syntax is as follows:
1.39 schwarze 1207: .Pp
1208: .D1 Pf \. Sx \&Bk Fl words
1209: .Pp
1210: The
1211: .Fl words
1.42 ! schwarze 1212: argument is required; additional arguments are ignored.
1.37 schwarze 1213: .Pp
1.42 ! schwarze 1214: The following example will not break within each
1.39 schwarze 1215: .Sx \&Op
1216: macro line:
1.37 schwarze 1217: .Bd -literal -offset indent
1218: \&.Bk \-words
1.39 schwarze 1219: \&.Op Fl f Ar flags
1220: \&.Op Fl o Ar output
1.37 schwarze 1221: \&.Ek
1222: .Ed
1.39 schwarze 1223: .Pp
1224: Be careful in using over-long lines within a keep block!
1225: Doing so will clobber the right margin.
1.17 schwarze 1226: .Ss \&Bl
1.42 ! schwarze 1227: Begin a list.
! 1228: Lists consist of items started by the
! 1229: .Sx \&It
! 1230: macro, containing a head or a body or both.
! 1231: The list syntax is as follows:
1.39 schwarze 1232: .Bd -ragged -offset indent
1233: .Pf \. Sx \&Bl
1.42 ! schwarze 1234: .Fl Ns Ar type
1.39 schwarze 1235: .Op Fl width Ar val
1236: .Op Fl offset Ar val
1237: .Op Fl compact
1238: .Op HEAD ...
1239: .Ed
1240: .Pp
1.42 ! schwarze 1241: The list
! 1242: .Ar type
! 1243: is mandatory and must be specified first.
! 1244: The
! 1245: .Fl width
! 1246: and
! 1247: .Fl offset
! 1248: arguments accept
1.32 schwarze 1249: .Sx Scaling Widths
1.42 ! schwarze 1250: or use the length of the given string.
! 1251: The
! 1252: .Fl offset
! 1253: is a global indentation for the whole list, affecting both item heads
! 1254: and bodies.
! 1255: For those list types supporting it, the
! 1256: .Fl width
! 1257: argument requests an additional indentation of item bodies,
! 1258: to be added to the
! 1259: .Fl offset .
! 1260: Unless the
! 1261: .Fl compact
! 1262: argument is specified, list entries are separated by vertical space.
! 1263: .Pp
1.32 schwarze 1264: A list must specify one of the following list types:
1265: .Bl -tag -width 12n -offset indent
1266: .It Fl bullet
1.42 ! schwarze 1267: No item heads can be specified, but a bullet will be printed at the head
! 1268: of each item.
! 1269: Item bodies start on the same output line as the bullet
! 1270: and are indented according to the
1.32 schwarze 1271: .Fl width
1.42 ! schwarze 1272: argument.
1.32 schwarze 1273: .It Fl column
1274: A columnated list.
1275: The
1276: .Fl width
1.42 ! schwarze 1277: argument has no effect; instead, each argument specifies the width
! 1278: of one column, using either the
1.32 schwarze 1279: .Sx Scaling Widths
1.42 ! schwarze 1280: syntax or the string length of the argument.
! 1281: If the first line of the body of a
1.34 schwarze 1282: .Fl column
1283: list is not an
1284: .Sx \&It
1.42 ! schwarze 1285: macro line,
! 1286: .Sx \&It
! 1287: contexts spanning one input line each are implied until an
1.34 schwarze 1288: .Sx \&It
1.42 ! schwarze 1289: macro line is encountered, at which point items start being interpreted as
1.34 schwarze 1290: described in the
1291: .Sx \&It
1292: documentation.
1.32 schwarze 1293: .It Fl dash
1.42 ! schwarze 1294: Like
! 1295: .Fl bullet ,
! 1296: except that dashes are used in place of bullets.
1.32 schwarze 1297: .It Fl diag
1298: Like
1299: .Fl inset ,
1.42 ! schwarze 1300: except that item heads are not parsed for macro invocations.
! 1301: .\" but with additional formatting to the head.
1.32 schwarze 1302: .It Fl enum
1.42 ! schwarze 1303: A numbered list.
! 1304: Formatted like
! 1305: .Fl bullet ,
! 1306: except that cardinal numbers are used in place of bullets,
! 1307: starting at 1.
1.32 schwarze 1308: .It Fl hang
1309: Like
1310: .Fl tag ,
1.42 ! schwarze 1311: except that the first lines of item bodies are not indented, but follow
! 1312: the item heads like in
! 1313: .Fl inset
! 1314: lists.
1.32 schwarze 1315: .It Fl hyphen
1316: Synonym for
1317: .Fl dash .
1318: .It Fl inset
1.42 ! schwarze 1319: Item bodies follow items heads on the same line, using normal inter-word
! 1320: spacing.
! 1321: Bodies are not indented, and the
1.32 schwarze 1322: .Fl width
1323: argument is ignored.
1324: .It Fl item
1.42 ! schwarze 1325: No item heads can be specified, and none are printed.
! 1326: Bodies are not indented, and the
1.32 schwarze 1327: .Fl width
1328: argument is ignored.
1329: .It Fl ohang
1.42 ! schwarze 1330: Item bodies start on the line following item heads and are not indented.
1.32 schwarze 1331: The
1332: .Fl width
1333: argument is ignored.
1334: .It Fl tag
1.42 ! schwarze 1335: Item bodies are indented according to the
1.32 schwarze 1336: .Fl width
1337: argument.
1.42 ! schwarze 1338: When an item head fits inside the indentation, the item body follows
! 1339: this head on the same output line.
! 1340: Otherwise, the body starts on the output line following the head.
1.32 schwarze 1341: .El
1.34 schwarze 1342: .Pp
1343: See also
1.42 ! schwarze 1344: .Sx \&El
! 1345: and
1.34 schwarze 1346: .Sx \&It .
1.17 schwarze 1347: .Ss \&Bo
1.42 ! schwarze 1348: Begin a block enclosed by square brackets.
1.27 schwarze 1349: Does not have any head arguments.
1.17 schwarze 1350: .Pp
1351: Examples:
1.41 schwarze 1352: .Bd -literal -offset indent -compact
1.17 schwarze 1353: \&.Bo 1 ,
1.25 schwarze 1354: \&.Dv BUFSIZ \&Bc
1.17 schwarze 1355: .Ed
1356: .Pp
1357: See also
1358: .Sx \&Bq .
1359: .Ss \&Bq
1.22 schwarze 1360: Encloses its arguments in square brackets.
1.17 schwarze 1361: .Pp
1362: Examples:
1.25 schwarze 1363: .D1 \&.Bq 1 , \&Dv BUFSIZ
1.17 schwarze 1364: .Pp
1365: .Em Remarks :
1366: this macro is sometimes abused to emulate optional arguments for
1367: commands; the correct macros to use for this purpose are
1368: .Sx \&Op ,
1369: .Sx \&Oo ,
1370: and
1371: .Sx \&Oc .
1372: .Pp
1373: See also
1374: .Sx \&Bo .
1375: .Ss \&Brc
1.42 ! schwarze 1376: Close a
1.17 schwarze 1377: .Sx \&Bro
1.41 schwarze 1378: block.
1379: Does not have any tail arguments.
1.17 schwarze 1380: .Ss \&Bro
1.42 ! schwarze 1381: Begin a block enclosed by curly braces.
1.27 schwarze 1382: Does not have any head arguments.
1.17 schwarze 1383: .Pp
1384: Examples:
1.41 schwarze 1385: .Bd -literal -offset indent -compact
1.17 schwarze 1386: \&.Bro 1 , ... ,
1.25 schwarze 1387: \&.Va n \&Brc
1.17 schwarze 1388: .Ed
1389: .Pp
1390: See also
1391: .Sx \&Brq .
1392: .Ss \&Brq
1393: Encloses its arguments in curly braces.
1394: .Pp
1395: Examples:
1.25 schwarze 1396: .D1 \&.Brq 1 , ... , \&Va n
1.17 schwarze 1397: .Pp
1398: See also
1399: .Sx \&Bro .
1400: .Ss \&Bsx
1401: Format the BSD/OS version provided as an argument, or a default value if
1402: no argument is provided.
1403: .Pp
1404: Examples:
1.25 schwarze 1405: .D1 \&.Bsx 1.0
1406: .D1 \&.Bsx
1.17 schwarze 1407: .Pp
1408: See also
1409: .Sx \&At ,
1410: .Sx \&Bx ,
1411: .Sx \&Dx ,
1412: .Sx \&Fx ,
1413: .Sx \&Nx ,
1414: .Sx \&Ox ,
1415: and
1416: .Sx \&Ux .
1417: .Ss \&Bt
1418: Prints
1419: .Dq is currently in beta test.
1420: .Ss \&Bx
1421: Format the BSD version provided as an argument, or a default value if no
1422: argument is provided.
1423: .Pp
1424: Examples:
1.25 schwarze 1425: .D1 \&.Bx 4.4
1426: .D1 \&.Bx
1.17 schwarze 1427: .Pp
1428: See also
1429: .Sx \&At ,
1430: .Sx \&Bsx ,
1431: .Sx \&Dx ,
1432: .Sx \&Fx ,
1433: .Sx \&Nx ,
1434: .Sx \&Ox ,
1435: and
1436: .Sx \&Ux .
1437: .Ss \&Cd
1.42 ! schwarze 1438: Kernel configuration declaration.
1.27 schwarze 1439: This denotes strings accepted by
1.17 schwarze 1440: .Xr config 8 .
1441: .Pp
1442: Examples:
1.25 schwarze 1443: .D1 \&.Cd device le0 at scode?
1.17 schwarze 1444: .Pp
1445: .Em Remarks :
1446: this macro is commonly abused by using quoted literals to retain
1.41 schwarze 1447: whitespace and align consecutive
1.17 schwarze 1448: .Sx \&Cd
1.27 schwarze 1449: declarations.
1450: This practise is discouraged.
1.17 schwarze 1451: .Ss \&Cm
1.27 schwarze 1452: Command modifiers.
1453: Useful when specifying configuration options or keys.
1.17 schwarze 1454: .Pp
1455: Examples:
1.25 schwarze 1456: .D1 \&.Cm ControlPath
1457: .D1 \&.Cm ControlMaster
1.17 schwarze 1458: .Pp
1459: See also
1460: .Sx \&Fl .
1461: .Ss \&D1
1.27 schwarze 1462: One-line indented display.
1463: This is formatted by the default rules and is useful for simple indented
1464: statements.
1465: It is followed by a newline.
1.17 schwarze 1466: .Pp
1467: Examples:
1.25 schwarze 1468: .D1 \&.D1 \&Fl abcdefgh
1.17 schwarze 1469: .Pp
1470: See also
1471: .Sx \&Bd
1472: and
1473: .Sx \&Dl .
1474: .Ss \&Db
1.42 ! schwarze 1475: Switch debugging mode.
1.34 schwarze 1476: Its syntax is as follows:
1477: .Pp
1478: .D1 Pf \. Sx \&Db Cm on | off
1.42 ! schwarze 1479: .Pp
! 1480: This macro is ignored by
! 1481: .Xr mandoc 1 .
1.17 schwarze 1482: .Ss \&Dc
1.42 ! schwarze 1483: Close a
1.17 schwarze 1484: .Sx \&Do
1.41 schwarze 1485: block.
1486: Does not have any tail arguments.
1.17 schwarze 1487: .Ss \&Dd
1.27 schwarze 1488: Document date.
1489: This is the mandatory first macro of any
1.17 schwarze 1490: .Nm
1.27 schwarze 1491: manual.
1.34 schwarze 1492: Its syntax is as follows:
1.17 schwarze 1493: .Pp
1.42 ! schwarze 1494: .D1 Pf \. Sx \&Dd Op Ar date
1.17 schwarze 1495: .Pp
1.22 schwarze 1496: The
1.42 ! schwarze 1497: .Ar date
! 1498: may be either
1.17 schwarze 1499: .Ar $\&Mdocdate$ ,
1500: which signifies the current manual revision date dictated by
1.19 schwarze 1501: .Xr cvs 1 ,
1.17 schwarze 1502: or instead a valid canonical date as specified by
1503: .Sx Dates .
1.42 ! schwarze 1504: If a date does not conform or is empty, the current date is used.
1.17 schwarze 1505: .Pp
1506: Examples:
1.25 schwarze 1507: .D1 \&.Dd $\&Mdocdate$
1508: .D1 \&.Dd $\&Mdocdate: July 21 2007$
1509: .D1 \&.Dd July 21, 2007
1.17 schwarze 1510: .Pp
1511: See also
1512: .Sx \&Dt
1513: and
1514: .Sx \&Os .
1515: .Ss \&Dl
1.27 schwarze 1516: One-line intended display.
1517: This is formatted as literal text and is useful for commands and
1518: invocations.
1519: It is followed by a newline.
1.17 schwarze 1520: .Pp
1521: Examples:
1.41 schwarze 1522: .D1 \&.Dl % mandoc mdoc.7 \e(ba less
1.17 schwarze 1523: .Pp
1524: See also
1525: .Sx \&Bd
1526: and
1527: .Sx \&D1 .
1528: .Ss \&Do
1.42 ! schwarze 1529: Begin a block enclosed by double quotes.
1.41 schwarze 1530: Does not have any head arguments.
1.17 schwarze 1531: .Pp
1532: Examples:
1.41 schwarze 1533: .Bd -literal -offset indent -compact
1534: \&.Do
1535: April is the cruellest month
1536: \&.Dc
1537: \e(em T.S. Eliot
1538: .Ed
1.17 schwarze 1539: .Pp
1540: See also
1541: .Sx \&Dq .
1542: .Ss \&Dq
1.41 schwarze 1543: Encloses its arguments in
1544: .Dq typographic
1545: double-quotes.
1.17 schwarze 1546: .Pp
1547: Examples:
1.25 schwarze 1548: .Bd -literal -offset indent -compact
1.17 schwarze 1549: \&.Dq April is the cruellest month
1550: \e(em T.S. Eliot
1551: .Ed
1552: .Pp
1553: See also
1.41 schwarze 1554: .Sx \&Qq ,
1555: .Sx \&Sq ,
1556: and
1.17 schwarze 1557: .Sx \&Do .
1558: .Ss \&Dt
1.27 schwarze 1559: Document title.
1560: This is the mandatory second macro of any
1.17 schwarze 1561: .Nm
1.27 schwarze 1562: file.
1.34 schwarze 1563: Its syntax is as follows:
1564: .Bd -ragged -offset indent
1565: .Pf \. Sx \&Dt
1566: .Oo
1.42 ! schwarze 1567: .Ar title
1.34 schwarze 1568: .Oo
1.42 ! schwarze 1569: .Ar section
! 1570: .Op Ar volume | arch
1.34 schwarze 1571: .Oc
1572: .Oc
1573: .Ed
1.17 schwarze 1574: .Pp
1575: Its arguments are as follows:
1576: .Bl -tag -width Ds -offset Ds
1.42 ! schwarze 1577: .It Ar title
1.34 schwarze 1578: The document's title (name), defaulting to
1.41 schwarze 1579: .Dq UNKNOWN
1.34 schwarze 1580: if unspecified.
1581: It should be capitalised.
1.42 ! schwarze 1582: .It Ar section
1.27 schwarze 1583: The manual section.
1584: This may be one of
1.17 schwarze 1585: .Ar 1
1586: .Pq utilities ,
1587: .Ar 2
1588: .Pq system calls ,
1589: .Ar 3
1590: .Pq libraries ,
1591: .Ar 3p
1592: .Pq Perl libraries ,
1593: .Ar 4
1594: .Pq devices ,
1595: .Ar 5
1596: .Pq file formats ,
1597: .Ar 6
1598: .Pq games ,
1599: .Ar 7
1600: .Pq miscellaneous ,
1601: .Ar 8
1602: .Pq system utilities ,
1603: .Ar 9
1604: .Pq kernel functions ,
1605: .Ar X11
1606: .Pq X Window System ,
1607: .Ar X11R6
1608: .Pq X Window System ,
1609: .Ar unass
1610: .Pq unassociated ,
1611: .Ar local
1612: .Pq local system ,
1613: .Ar draft
1614: .Pq draft manual ,
1615: or
1616: .Ar paper
1617: .Pq paper .
1.34 schwarze 1618: It should correspond to the manual's filename suffix and defaults to
1.41 schwarze 1619: .Dq 1
1.34 schwarze 1620: if unspecified.
1.42 ! schwarze 1621: .It Ar volume
1.17 schwarze 1622: This overrides the volume inferred from
1623: .Ar section .
1624: This field is optional, and if specified, must be one of
1625: .Ar USD
1626: .Pq users' supplementary documents ,
1627: .Ar PS1
1628: .Pq programmers' supplementary documents ,
1629: .Ar AMD
1630: .Pq administrators' supplementary documents ,
1631: .Ar SMM
1632: .Pq system managers' manuals ,
1633: .Ar URM
1634: .Pq users' reference manuals ,
1635: .Ar PRM
1636: .Pq programmers' reference manuals ,
1637: .Ar KM
1638: .Pq kernel manuals ,
1639: .Ar IND
1640: .Pq master index ,
1641: .Ar MMI
1642: .Pq master index ,
1643: .Ar LOCAL
1644: .Pq local manuals ,
1645: .Ar LOC
1646: .Pq local manuals ,
1647: or
1648: .Ar CON
1649: .Pq contributed manuals .
1.42 ! schwarze 1650: .It Ar arch
1.27 schwarze 1651: This specifies a specific relevant architecture.
1652: If
1.42 ! schwarze 1653: .Ar volume
1.17 schwarze 1654: is not provided, it may be used in its place, else it may be used
1.27 schwarze 1655: subsequent that.
1656: It, too, is optional.
1657: It must be one of
1.17 schwarze 1658: .Ar alpha ,
1659: .Ar amd64 ,
1660: .Ar amiga ,
1661: .Ar arc ,
1662: .Ar arm ,
1663: .Ar armish ,
1664: .Ar aviion ,
1665: .Ar hp300 ,
1666: .Ar hppa ,
1667: .Ar hppa64 ,
1668: .Ar i386 ,
1669: .Ar landisk ,
1.23 schwarze 1670: .Ar loongson ,
1.17 schwarze 1671: .Ar luna88k ,
1672: .Ar mac68k ,
1673: .Ar macppc ,
1674: .Ar mvme68k ,
1675: .Ar mvme88k ,
1676: .Ar mvmeppc ,
1677: .Ar pmax ,
1678: .Ar sgi ,
1679: .Ar socppc ,
1680: .Ar sparc ,
1681: .Ar sparc64 ,
1682: .Ar sun3 ,
1683: .Ar vax ,
1684: or
1685: .Ar zaurus .
1686: .El
1687: .Pp
1688: Examples:
1.25 schwarze 1689: .D1 \&.Dt FOO 1
1690: .D1 \&.Dt FOO 4 KM
1691: .D1 \&.Dt FOO 9 i386
1.17 schwarze 1692: .Pp
1693: See also
1694: .Sx \&Dd
1695: and
1696: .Sx \&Os .
1697: .Ss \&Dv
1698: Defined variables such as preprocessor constants.
1699: .Pp
1700: Examples:
1.25 schwarze 1701: .D1 \&.Dv BUFSIZ
1702: .D1 \&.Dv STDOUT_FILENO
1.17 schwarze 1703: .Pp
1704: See also
1705: .Sx \&Er .
1706: .Ss \&Dx
1.19 schwarze 1707: Format the DragonFly BSD version provided as an argument, or a default
1.17 schwarze 1708: value if no argument is provided.
1709: .Pp
1710: Examples:
1.25 schwarze 1711: .D1 \&.Dx 2.4.1
1712: .D1 \&.Dx
1.17 schwarze 1713: .Pp
1714: See also
1715: .Sx \&At ,
1716: .Sx \&Bsx ,
1717: .Sx \&Bx ,
1718: .Sx \&Fx ,
1719: .Sx \&Nx ,
1720: .Sx \&Ox ,
1721: and
1722: .Sx \&Ux .
1723: .Ss \&Ec
1.39 schwarze 1724: Close a scope started by
1725: .Sx \&Eo .
1726: Its syntax is as follows:
1727: .Pp
1.42 ! schwarze 1728: .D1 Pf \. Sx \&Ec Op Ar TERM
1.39 schwarze 1729: .Pp
1730: The
1.42 ! schwarze 1731: .Ar TERM
1.39 schwarze 1732: argument is used as the enclosure tail, for example, specifying \e(rq
1733: will emulate
1734: .Sx \&Dc .
1.17 schwarze 1735: .Ss \&Ed
1.39 schwarze 1736: End a display context started by
1737: .Sx \&Bd .
1.17 schwarze 1738: .Ss \&Ef
1.42 ! schwarze 1739: End a font mode context started by
1.39 schwarze 1740: .Sx \&Bf .
1.17 schwarze 1741: .Ss \&Ek
1.42 ! schwarze 1742: End a keep context started by
1.37 schwarze 1743: .Sx \&Bk .
1.17 schwarze 1744: .Ss \&El
1.42 ! schwarze 1745: End a list context started by
1.34 schwarze 1746: .Sx \&Bl .
1747: .Pp
1748: See also
1749: .Sx \&Bl
1750: and
1751: .Sx \&It .
1.17 schwarze 1752: .Ss \&Em
1.27 schwarze 1753: Denotes text that should be emphasised.
1754: Note that this is a presentation term and should not be used for
1755: stylistically decorating technical terms.
1.17 schwarze 1756: .Pp
1757: Examples:
1.25 schwarze 1758: .D1 \&.Em Warnings!
1759: .D1 \&.Em Remarks :
1.41 schwarze 1760: .Pp
1761: See also
1762: .Sx \&Bf ,
1763: .Sx \&Sy ,
1764: and
1765: .Sx \&Li .
1.17 schwarze 1766: .Ss \&En
1.42 ! schwarze 1767: This macro is obsolete and not implemented in
! 1768: .Xr mandoc 1 .
1.17 schwarze 1769: .Ss \&Eo
1.39 schwarze 1770: An arbitrary enclosure.
1771: Its syntax is as follows:
1772: .Pp
1.42 ! schwarze 1773: .D1 Pf \. Sx \&Eo Op Ar TERM
1.39 schwarze 1774: .Pp
1775: The
1.42 ! schwarze 1776: .Ar TERM
1.39 schwarze 1777: argument is used as the enclosure head, for example, specifying \e(lq
1778: will emulate
1779: .Sx \&Do .
1.17 schwarze 1780: .Ss \&Er
1.25 schwarze 1781: Display error constants.
1.17 schwarze 1782: .Pp
1783: Examples:
1.25 schwarze 1784: .D1 \&.Er EPERM
1785: .D1 \&.Er ENOENT
1.17 schwarze 1786: .Pp
1787: See also
1788: .Sx \&Dv .
1789: .Ss \&Es
1.39 schwarze 1790: This macro is obsolete and not implemented.
1.17 schwarze 1791: .Ss \&Ev
1792: Environmental variables such as those specified in
1793: .Xr environ 7 .
1794: .Pp
1795: Examples:
1.25 schwarze 1796: .D1 \&.Ev DISPLAY
1797: .D1 \&.Ev PATH
1.17 schwarze 1798: .Ss \&Ex
1.42 ! schwarze 1799: Insert a standard sentence regarding exit values.
! 1800: Its syntax is as follows:
! 1801: .Pp
! 1802: .D1 Pf \. Sx \&Ex Fl std Op Ar utility
! 1803: .Pp
! 1804: When
1.17 schwarze 1805: .Ar utility
1.42 ! schwarze 1806: is not specified, the document's name set by
1.17 schwarze 1807: .Sx \&Nm
1.42 ! schwarze 1808: is used.
1.41 schwarze 1809: .Pp
1810: See also
1811: .Sx \&Rv .
1.17 schwarze 1812: .Ss \&Fa
1.34 schwarze 1813: Function argument.
1814: Its syntax is as follows:
1815: .Bd -ragged -offset indent
1816: .Pf \. Sx \&Fa
1817: .Op Cm argtype
1818: .Cm argname
1819: .Ed
1820: .Pp
1821: This may be invoked for names with or without the corresponding type.
1822: It is also used to specify the field name of a structure.
1823: Most often, the
1824: .Sx \&Fa
1825: macro is used in the
1826: .Em SYNOPSIS
1827: within
1828: .Sx \&Fo
1829: section when documenting multi-line function prototypes.
1830: If invoked with multiple arguments, the arguments are separated by a
1831: comma.
1832: Furthermore, if the following macro is another
1833: .Sx \&Fa ,
1834: the last argument will also have a trailing comma.
1835: .Pp
1836: Examples:
1837: .D1 \&.Fa \(dqconst char *p\(dq
1838: .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1839: .D1 \&.Fa foo
1840: .Pp
1841: See also
1842: .Sx \&Fo .
1.17 schwarze 1843: .Ss \&Fc
1.42 ! schwarze 1844: End a function context started by
1.39 schwarze 1845: .Sx \&Fo .
1.17 schwarze 1846: .Ss \&Fd
1.34 schwarze 1847: Historically used to document include files.
1848: This usage has been deprecated in favour of
1849: .Sx \&In .
1850: Do not use this macro.
1851: .Pp
1852: See also
1.35 schwarze 1853: .Sx MANUAL STRUCTURE
1854: and
1.34 schwarze 1855: .Sx \&In .
1.17 schwarze 1856: .Ss \&Fl
1.27 schwarze 1857: Command-line flag.
1858: Used when listing arguments to command-line utilities.
1859: Prints a fixed-width hyphen
1.21 schwarze 1860: .Sq \-
1.27 schwarze 1861: directly followed by each argument.
1862: If no arguments are provided, a hyphen is printed followed by a space.
1863: If the argument is a macro, a hyphen is prefixed to the subsequent macro
1864: output.
1.21 schwarze 1865: .Pp
1866: Examples:
1.25 schwarze 1867: .D1 \&.Fl a b c
1868: .D1 \&.Fl \&Pf a b
1869: .D1 \&.Fl
1870: .D1 \&.Op \&Fl o \&Ns \&Ar file
1.21 schwarze 1871: .Pp
1872: See also
1873: .Sx \&Cm .
1.17 schwarze 1874: .Ss \&Fn
1.34 schwarze 1875: A function name.
1876: Its syntax is as follows:
1877: .Bd -ragged -offset indent
1878: .Pf \. Ns Sx \&Fn
1879: .Op Cm functype
1880: .Cm funcname
1881: .Op Oo Cm argtype Oc Cm argname
1882: .Ed
1883: .Pp
1.35 schwarze 1884: Function arguments are surrounded in parenthesis and
1.34 schwarze 1885: are delimited by commas.
1886: If no arguments are specified, blank parenthesis are output.
1887: .Pp
1888: Examples:
1889: .D1 \&.Fn "int funcname" "int arg0" "int arg1"
1890: .D1 \&.Fn funcname "int arg0"
1891: .D1 \&.Fn funcname arg0
1892: .Bd -literal -offset indent -compact
1893: \&.Ft functype
1894: \&.Fn funcname
1895: .Ed
1896: .Pp
1897: See also
1.35 schwarze 1898: .Sx MANUAL STRUCTURE
1.34 schwarze 1899: and
1900: .Sx \&Ft .
1.17 schwarze 1901: .Ss \&Fo
1.34 schwarze 1902: Begin a function block.
1903: This is a multi-line version of
1904: .Sx \&Fn .
1905: Its syntax is as follows:
1906: .Pp
1907: .D1 Pf \. Sx \&Fo Cm funcname
1908: .Pp
1909: Invocations usually occur in the following context:
1910: .Bd -ragged -offset indent
1911: .Pf \. Sx \&Ft Cm functype
1912: .br
1913: .Pf \. Sx \&Fo Cm funcname
1914: .br
1915: .Pf \. Sx \&Fa Oo Cm argtype Oc Cm argname
1916: .br
1917: \.\.\.
1918: .br
1919: .Pf \. Sx \&Fc
1920: .Ed
1921: .Pp
1922: A
1923: .Sx \&Fo
1924: scope is closed by
1925: .Pp
1926: See also
1.35 schwarze 1927: .Sx MANUAL STRUCTURE ,
1.34 schwarze 1928: .Sx \&Fa ,
1929: .Sx \&Fc ,
1930: and
1.41 schwarze 1931: .Sx \&Ft .
1.17 schwarze 1932: .Ss \&Ft
1.34 schwarze 1933: A function type.
1934: Its syntax is as follows:
1935: .Pp
1936: .D1 Pf \. Sx \&Ft Cm functype
1937: .Pp
1938: Examples:
1939: .D1 \&.Ft int
1940: .Bd -literal -offset indent -compact
1941: \&.Ft functype
1942: \&.Fn funcname
1943: .Ed
1944: .Pp
1945: See also
1.35 schwarze 1946: .Sx MANUAL STRUCTURE ,
1947: .Sx \&Fn ,
1.34 schwarze 1948: and
1.35 schwarze 1949: .Sx \&Fo .
1.17 schwarze 1950: .Ss \&Fx
1951: Format the FreeBSD version provided as an argument, or a default value
1952: if no argument is provided.
1953: .Pp
1954: Examples:
1.25 schwarze 1955: .D1 \&.Fx 7.1
1956: .D1 \&.Fx
1.17 schwarze 1957: .Pp
1958: See also
1959: .Sx \&At ,
1960: .Sx \&Bsx ,
1961: .Sx \&Bx ,
1962: .Sx \&Dx ,
1963: .Sx \&Nx ,
1964: .Sx \&Ox ,
1965: and
1966: .Sx \&Ux .
1967: .Ss \&Hf
1.39 schwarze 1968: This macro is obsolete and not implemented.
1.17 schwarze 1969: .Ss \&Ic
1.39 schwarze 1970: Designate an internal or interactive command.
1971: This is similar to
1972: .Sx \&Cm
1973: but used for instructions rather than values.
1974: .Pp
1975: Examples:
1976: .D1 \&.Ic hash
1977: .D1 \&.Ic alias
1978: .Pp
1979: Note that using
1980: .Sx \&Bd No Fl literal
1981: or
1982: .Sx \&D1
1983: is preferred for displaying code; the
1984: .Sx \&Ic
1985: macro is used when referring to specific instructions.
1.17 schwarze 1986: .Ss \&In
1.34 schwarze 1987: An
1.41 schwarze 1988: .Dq include
1.34 schwarze 1989: file.
1990: In the
1991: .Em SYNOPSIS
1992: section (only if invoked as the line macro), the first argument is
1993: preceded by
1.41 schwarze 1994: .Dq #include ,
1.42 ! schwarze 1995: the arguments is enclosed in angle brackets.
1.34 schwarze 1996: .Pp
1.35 schwarze 1997: Examples:
1.34 schwarze 1998: .D1 \&.In sys/types
1.35 schwarze 1999: .Pp
2000: See also
2001: .Sx MANUAL STRUCTURE .
1.17 schwarze 2002: .Ss \&It
1.34 schwarze 2003: A list item.
2004: The syntax of this macro depends on the list type.
2005: .Pp
2006: Lists
2007: of type
2008: .Fl hang ,
2009: .Fl ohang ,
2010: .Fl inset ,
2011: and
2012: .Fl diag
2013: have the following syntax:
2014: .Pp
2015: .D1 Pf \. Sx \&It Cm args
2016: .Pp
2017: Lists of type
2018: .Fl bullet ,
2019: .Fl dash ,
2020: .Fl enum ,
2021: .Fl hyphen
2022: and
2023: .Fl item
2024: have the following syntax:
2025: .Pp
2026: .D1 Pf \. Sx \&It
2027: .Pp
2028: with subsequent lines interpreted within the scope of the
2029: .Sx \&It
2030: until either a closing
2031: .Sx \&El
2032: or another
2033: .Sx \&It .
2034: .Pp
2035: The
2036: .Fl tag
2037: list has the following syntax:
2038: .Pp
2039: .D1 Pf \. Sx \&It Op Cm args
2040: .Pp
2041: Subsequent lines are interpreted as with
2042: .Fl bullet
2043: and family.
2044: The line arguments correspond to the list's left-hand side; body
2045: arguments correspond to the list's contents.
2046: .Pp
2047: The
2048: .Fl column
2049: list is the most complicated.
2050: Its syntax is as follows:
2051: .Pp
2052: .D1 Pf \. Sx \&It Op Cm args
2053: .Pp
2054: The
2055: .Cm args
2056: are phrases, a mix of macros and text corresponding to a line column,
2057: delimited by tabs or the special
2058: .Sq \&Ta
2059: pseudo-macro.
2060: Lines subsequent the
2061: .Sx \&It
2062: are interpreted within the scope of the last phrase.
2063: Calling the pseudo-macro
2064: .Sq \&Ta
2065: will open a new phrase scope (this must occur on a macro line to be
1.41 schwarze 2066: interpreted as a macro).
2067: Note that the tab phrase delimiter may only be used within the
1.34 schwarze 2068: .Sx \&It
2069: line itself.
2070: Subsequent this, only the
2071: .Sq \&Ta
2072: pseudo-macro may be used to delimit phrases.
1.35 schwarze 2073: Furthermore, note that quoted sections propagate over tab-delimited
1.34 schwarze 2074: phrases on an
2075: .Sx \&It ,
2076: for example,
2077: .Pp
1.35 schwarze 2078: .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1.34 schwarze 2079: .Pp
2080: will preserve the semicolon whitespace except for the last.
2081: .Pp
2082: See also
2083: .Sx \&Bl .
1.17 schwarze 2084: .Ss \&Lb
1.33 schwarze 2085: Specify a library.
1.34 schwarze 2086: The syntax is as follows:
1.33 schwarze 2087: .Pp
1.34 schwarze 2088: .D1 Pf \. Sx \&Lb Cm library
1.33 schwarze 2089: .Pp
2090: The
2091: .Cm library
2092: parameter may be a system library, such as
2093: .Cm libz
2094: or
2095: .Cm libpam ,
2096: in which case a small library description is printed next to the linker
2097: invocation; or a custom library, in which case the library name is
2098: printed in quotes.
2099: This is most commonly used in the
2100: .Em SYNOPSIS
2101: section as described in
2102: .Sx MANUAL STRUCTURE .
2103: .Pp
2104: Examples:
2105: .D1 \&.Lb libz
2106: .D1 \&.Lb mdoc
1.17 schwarze 2107: .Ss \&Li
1.39 schwarze 2108: Denotes text that should be in a literal font mode.
2109: Note that this is a presentation term and should not be used for
2110: stylistically decorating technical terms.
1.41 schwarze 2111: .Pp
2112: See also
2113: .Sx \&Bf ,
2114: .Sx \&Sy ,
2115: and
2116: .Sx \&Em .
1.17 schwarze 2117: .Ss \&Lk
1.27 schwarze 2118: Format a hyperlink.
1.34 schwarze 2119: Its syntax is as follows:
1.18 schwarze 2120: .Pp
1.34 schwarze 2121: .D1 Pf \. Sx \&Lk Cm uri Op Cm name
1.18 schwarze 2122: .Pp
2123: Examples:
1.25 schwarze 2124: .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
2125: .D1 \&.Lk http://bsd.lv
1.18 schwarze 2126: .Pp
2127: See also
2128: .Sx \&Mt .
1.17 schwarze 2129: .Ss \&Lp
1.39 schwarze 2130: Synonym for
2131: .Sx \&Pp .
1.17 schwarze 2132: .Ss \&Ms
1.41 schwarze 2133: Display a mathematical symbol.
2134: Its syntax is as follows:
2135: .Pp
2136: .D1 Pf \. Sx \&Ms Cm symbol
2137: .Pp
2138: Examples:
2139: .D1 \&.Ms sigma
2140: .D1 \&.Ms aleph
1.17 schwarze 2141: .Ss \&Mt
1.34 schwarze 2142: Format a
1.41 schwarze 2143: .Dq mailto:
1.34 schwarze 2144: hyperlink.
2145: Its syntax is as follows:
2146: .Pp
2147: .D1 Pf \. Sx \&Mt Cm address
2148: .Pp
2149: Examples:
2150: .D1 \&.Mt discuss@manpages.bsd.lv
1.17 schwarze 2151: .Ss \&Nd
1.39 schwarze 2152: A one-line description of the manual's content.
2153: This may only be invoked in the
2154: .Em SYNOPSIS
2155: section subsequent the
2156: .Sx \&Nm
2157: macro.
2158: .Pp
2159: Examples:
2160: .D1 \&.Sx \&Nd mdoc language reference
2161: .D1 \&.Sx \&Nd format and display UNIX manuals
2162: .Pp
2163: The
2164: .Sx \&Nd
2165: macro technically accepts child macros and terminates with a subsequent
2166: .Sx \&Sh
2167: invocation.
2168: Do not assume this behaviour: some
2169: .Xr whatis 1
2170: database generators are not smart enough to parse more than the line
2171: arguments and will display macros verbatim.
2172: .Pp
2173: See also
2174: .Sx \&Nm .
1.17 schwarze 2175: .Ss \&Nm
1.38 schwarze 2176: The name of the manual page, or \(em in particular in section 1, 6,
2177: and 8 pages \(em of an additional command or feature documented in
2178: the manual page.
2179: When first invoked, the
2180: .Sx \&Nm
2181: macro expects a single argument, the name of the manual page.
2182: Usually, the first invocation happens in the
2183: .Em NAME
2184: section of the page.
2185: The specified name will be remembered and used whenever the macro is
2186: called again without arguments later in the page.
2187: The
2188: .Sx \&Nm
2189: macro uses
2190: .Sx Block full-implicit
2191: semantics when invoked as the first macro on an input line in the
2192: .Em SYNOPSIS
2193: section; otherwise, it uses ordinary
2194: .Sx In-line
2195: semantics.
2196: .Pp
2197: Examples:
2198: .Bd -literal -offset indent
2199: \&.Sh SYNOPSIS
2200: \&.Nm cat
2201: \&.Op Fl benstuv
2202: \&.Op Ar
2203: .Ed
2204: .Pp
2205: In the
2206: .Em SYNOPSIS
2207: of section 2, 3 and 9 manual pages, use the
2208: .Sx \&Fn
2209: macro rather than
2210: .Sx \&Nm
2211: to mark up the name of the manual page.
1.17 schwarze 2212: .Ss \&No
1.39 schwarze 2213: A
1.41 schwarze 2214: .Dq noop
1.39 schwarze 2215: macro used to terminate prior macro contexts.
2216: .Pp
2217: Examples:
2218: .D1 \&.Sx \&Fl ab \&No cd \&Fl ef
1.17 schwarze 2219: .Ss \&Ns
1.41 schwarze 2220: Suppress a space.
2221: Following invocation, text is interpreted as free-form text until a
2222: macro is encountered.
2223: .Pp
2224: Examples:
2225: .D1 \&.Fl o \&Ns \&Ar output
2226: .Pp
2227: See also
2228: .Sx \&No
2229: and
2230: .Sx \&Sm .
1.17 schwarze 2231: .Ss \&Nx
2232: Format the NetBSD version provided as an argument, or a default value if
2233: no argument is provided.
2234: .Pp
2235: Examples:
1.25 schwarze 2236: .D1 \&.Nx 5.01
2237: .D1 \&.Nx
1.17 schwarze 2238: .Pp
2239: See also
2240: .Sx \&At ,
2241: .Sx \&Bsx ,
2242: .Sx \&Bx ,
2243: .Sx \&Dx ,
2244: .Sx \&Fx ,
2245: .Sx \&Ox ,
2246: and
2247: .Sx \&Ux .
2248: .Ss \&Oc
1.42 ! schwarze 2249: Close multi-line
1.39 schwarze 2250: .Sx \&Oo
2251: context.
1.17 schwarze 2252: .Ss \&Oo
1.39 schwarze 2253: Multi-line version of
2254: .Sx \&Op .
2255: .Pp
2256: Examples:
1.41 schwarze 2257: .Bd -literal -offset indent -compact
1.39 schwarze 2258: \&.Oo
2259: \&.Op Fl flag Ns Ar value
2260: \&.Oc
2261: .Ed
1.17 schwarze 2262: .Ss \&Op
1.39 schwarze 2263: Command-line option.
2264: Used when listing options to command-line utilities.
2265: Prints the argument(s) in brackets.
2266: .Pp
2267: Examples:
2268: .D1 \&.Op \&Fl a \&Ar b
2269: .D1 \&.Op \&Ar a | b
2270: .Pp
2271: See also
2272: .Sx \&Oo .
1.17 schwarze 2273: .Ss \&Os
1.27 schwarze 2274: Document operating system version.
2275: This is the mandatory third macro of
1.17 schwarze 2276: any
2277: .Nm
1.34 schwarze 2278: file.
2279: Its syntax is as follows:
1.17 schwarze 2280: .Pp
1.34 schwarze 2281: .D1 Pf \. Sx \&Os Op Cm system
1.17 schwarze 2282: .Pp
2283: The optional
2284: .Cm system
1.27 schwarze 2285: parameter specifies the relevant operating system or environment.
2286: Left unspecified, it defaults to the local operating system version.
2287: This is the suggested form.
1.17 schwarze 2288: .Pp
2289: Examples:
1.25 schwarze 2290: .D1 \&.Os
2291: .D1 \&.Os KTH/CSC/TCS
2292: .D1 \&.Os BSD 4.3
1.17 schwarze 2293: .Pp
2294: See also
2295: .Sx \&Dd
2296: and
2297: .Sx \&Dt .
2298: .Ss \&Ot
2299: Unknown usage.
2300: .Pp
2301: .Em Remarks :
2302: this macro has been deprecated.
2303: .Ss \&Ox
2304: Format the OpenBSD version provided as an argument, or a default value
2305: if no argument is provided.
2306: .Pp
2307: Examples:
1.25 schwarze 2308: .D1 \&.Ox 4.5
2309: .D1 \&.Ox
1.17 schwarze 2310: .Pp
2311: See also
2312: .Sx \&At ,
2313: .Sx \&Bsx ,
2314: .Sx \&Bx ,
2315: .Sx \&Dx ,
2316: .Sx \&Fx ,
2317: .Sx \&Nx ,
2318: and
2319: .Sx \&Ux .
2320: .Ss \&Pa
1.39 schwarze 2321: A file-system path.
2322: .Pp
2323: Examples:
2324: .D1 \&.Pa /usr/bin/mandoc
2325: .D1 \&.Pa /usr/share/man/man7/mdoc.7
2326: .Pp
2327: See also
2328: .Sx \&Lk .
1.17 schwarze 2329: .Ss \&Pc
1.39 schwarze 2330: Close parenthesised context opened by
2331: .Sx \&Po .
1.17 schwarze 2332: .Ss \&Pf
1.39 schwarze 2333: Removes the space
1.41 schwarze 2334: .Pq Dq prefix
1.39 schwarze 2335: between its arguments.
2336: Its syntax is as follows:
2337: .Pp
2338: .D1 Pf \. \&Pf Cm prefix suffix
2339: .Pp
2340: The
2341: .Cm suffix
2342: argument may be a macro.
2343: .Pp
2344: Examples:
2345: .D1 \&.Pf \e. \&Sx \&Pf \&Cm prefix suffix
1.17 schwarze 2346: .Ss \&Po
1.39 schwarze 2347: Multi-line version of
2348: .Sx \&Pq .
1.17 schwarze 2349: .Ss \&Pp
1.39 schwarze 2350: Break a paragraph.
2351: This will assert vertical space between prior and subsequent macros
2352: and/or text.
1.17 schwarze 2353: .Ss \&Pq
1.39 schwarze 2354: Parenthesised enclosure.
2355: .Pp
2356: See also
2357: .Sx \&Po .
1.17 schwarze 2358: .Ss \&Qc
1.41 schwarze 2359: Close quoted context opened by
2360: .Sx \&Qo .
1.17 schwarze 2361: .Ss \&Ql
1.41 schwarze 2362: Format a single-quoted literal.
2363: See also
2364: .Sx \&Qq
2365: and
2366: .Sx \&Sq .
1.17 schwarze 2367: .Ss \&Qo
1.41 schwarze 2368: Multi-line version of
2369: .Sx \&Qq .
1.17 schwarze 2370: .Ss \&Qq
1.41 schwarze 2371: Encloses its arguments in
2372: .Dq typewriter
2373: double-quotes.
2374: Consider using
2375: .Sx \&Dq .
2376: .Pp
2377: See also
2378: .Sx \&Dq ,
2379: .Sx \&Sq ,
2380: and
2381: .Sx \&Qo .
1.17 schwarze 2382: .Ss \&Re
1.42 ! schwarze 2383: Close an
1.17 schwarze 2384: .Sx \&Rs
1.27 schwarze 2385: block.
2386: Does not have any tail arguments.
1.17 schwarze 2387: .Ss \&Rs
1.42 ! schwarze 2388: Begin a bibliographic
1.17 schwarze 2389: .Pq Dq reference
1.27 schwarze 2390: block.
2391: Does not have any head arguments.
2392: The block macro may only contain
1.17 schwarze 2393: .Sx \&%A ,
2394: .Sx \&%B ,
2395: .Sx \&%C ,
2396: .Sx \&%D ,
2397: .Sx \&%I ,
2398: .Sx \&%J ,
2399: .Sx \&%N ,
2400: .Sx \&%O ,
2401: .Sx \&%P ,
2402: .Sx \&%Q ,
2403: .Sx \&%R ,
2404: .Sx \&%T ,
1.34 schwarze 2405: .Sx \&%U ,
1.17 schwarze 2406: and
2407: .Sx \&%V
2408: child macros (at least one must be specified).
2409: .Pp
2410: Examples:
1.25 schwarze 2411: .Bd -literal -offset indent -compact
1.17 schwarze 2412: \&.Rs
2413: \&.%A J. E. Hopcroft
2414: \&.%A J. D. Ullman
2415: \&.%B Introduction to Automata Theory, Languages, and Computation
2416: \&.%I Addison-Wesley
2417: \&.%C Reading, Massachusettes
2418: \&.%D 1979
2419: \&.Re
2420: .Ed
2421: .Pp
2422: If an
2423: .Sx \&Rs
2424: block is used within a SEE ALSO section, a vertical space is asserted
2425: before the rendered output, else the block continues on the current
2426: line.
2427: .Ss \&Rv
1.41 schwarze 2428: Inserts text regarding a function call's return value.
2429: This macro must consist of the
2430: .Fl std
2431: argument followed by an optional
2432: .Ar function .
2433: If
2434: .Ar function
2435: is not provided, the document's name as stipulated by the first
2436: .Sx \&Nm
2437: is provided.
2438: .Pp
2439: See also
2440: .Sx \&Ex .
1.17 schwarze 2441: .Ss \&Sc
1.41 schwarze 2442: Close single-quoted context opened by
2443: .Sx \&So .
1.17 schwarze 2444: .Ss \&Sh
1.41 schwarze 2445: Begin a new section.
2446: For a list of conventional manual sections, see
2447: .Sx MANUAL STRUCTURE .
2448: These sections should be used unless it's absolutely necessary that
2449: custom sections be used.
2450: .Pp
2451: Section names should be unique so that they may be keyed by
2452: .Sx \&Sx .
2453: .Pp
2454: See also
2455: .Sx \&Pp ,
2456: .Sx \&Ss ,
2457: and
2458: .Sx \&Sx .
1.17 schwarze 2459: .Ss \&Sm
1.40 schwarze 2460: Switches the spacing mode for output generated from macros.
2461: Its syntax is as follows:
2462: .Pp
2463: .D1 Pf \. Sx \&Sm Cm on | off
2464: .Pp
2465: By default, spacing is
2466: .Cm on .
2467: When switched
2468: .Cm off ,
2469: no white space is inserted between macro arguments and between the
2470: output generated from adjacent macros, but free-form text lines
2471: still get normal spacing between words and sentences.
1.17 schwarze 2472: .Ss \&So
1.41 schwarze 2473: Multi-line version of
2474: .Sx \&Sq .
1.17 schwarze 2475: .Ss \&Sq
1.41 schwarze 2476: Encloses its arguments in
2477: .Dq typewriter
2478: single-quotes.
2479: .Pp
2480: See also
2481: .Sx \&Dq ,
2482: .Sx \&Qq ,
2483: and
2484: .Sx \&So .
1.17 schwarze 2485: .Ss \&Ss
1.41 schwarze 2486: Begin a new sub-section.
2487: Unlike with
2488: .Sx \&Sh ,
2489: there's no convention for sub-sections.
2490: Conventional sections, as described in
2491: .Sx MANUAL STRUCTURE ,
2492: rarely have sub-sections.
2493: .Pp
2494: Sub-section names should be unique so that they may be keyed by
2495: .Sx \&Sx .
2496: .Pp
2497: See also
2498: .Sx \&Pp ,
2499: .Sx \&Sh ,
2500: and
2501: .Sx \&Sx .
1.17 schwarze 2502: .Ss \&St
1.41 schwarze 2503: Replace an abbreviation for a standard with the full form.
2504: The following standards are recognised:
2505: .Pp
2506: .Bl -tag -width "-p1003.1g-2000X" -compact
2507: .It \-p1003.1-88
2508: .St -p1003.1-88
2509: .It \-p1003.1-90
2510: .St -p1003.1-90
2511: .It \-p1003.1-96
2512: .St -p1003.1-96
2513: .It \-p1003.1-2001
2514: .St -p1003.1-2001
2515: .It \-p1003.1-2004
2516: .St -p1003.1-2004
2517: .It \-p1003.1-2008
2518: .St -p1003.1-2008
2519: .It \-p1003.1
2520: .St -p1003.1
2521: .It \-p1003.1b
2522: .St -p1003.1b
2523: .It \-p1003.1b-93
2524: .St -p1003.1b-93
2525: .It \-p1003.1c-95
2526: .St -p1003.1c-95
2527: .It \-p1003.1g-2000
2528: .St -p1003.1g-2000
2529: .It \-p1003.1i-95
2530: .St -p1003.1i-95
2531: .It \-p1003.2-92
2532: .St -p1003.2-92
2533: .It \-p1003.2a-92
2534: .St -p1003.2a-92
2535: .It \-p1387.2-95
2536: .St -p1387.2-95
2537: .It \-p1003.2
2538: .St -p1003.2
2539: .It \-p1387.2
2540: .St -p1387.2
2541: .It \-isoC
2542: .St -isoC
2543: .It \-isoC-90
2544: .St -isoC-90
2545: .It \-isoC-amd1
2546: .St -isoC-amd1
2547: .It \-isoC-tcor1
2548: .St -isoC-tcor1
2549: .It \-isoC-tcor2
2550: .St -isoC-tcor2
2551: .It \-isoC-99
2552: .St -isoC-99
2553: .It \-iso9945-1-90
2554: .St -iso9945-1-90
2555: .It \-iso9945-1-96
2556: .St -iso9945-1-96
2557: .It \-iso9945-2-93
2558: .St -iso9945-2-93
2559: .It \-ansiC
2560: .St -ansiC
2561: .It \-ansiC-89
2562: .St -ansiC-89
2563: .It \-ansiC-99
2564: .St -ansiC-99
2565: .It \-ieee754
2566: .St -ieee754
2567: .It \-iso8802-3
2568: .St -iso8802-3
2569: .It \-ieee1275-94
2570: .St -ieee1275-94
2571: .It \-xpg3
2572: .St -xpg3
2573: .It \-xpg4
2574: .St -xpg4
2575: .It \-xpg4.2
2576: .St -xpg4.2
2577: .St -xpg4.3
2578: .It \-xbd5
2579: .St -xbd5
2580: .It \-xcu5
2581: .St -xcu5
2582: .It \-xsh5
2583: .St -xsh5
2584: .It \-xns5
2585: .St -xns5
2586: .It \-xns5.2
2587: .St -xns5.2
2588: .It \-xns5.2d2.0
2589: .St -xns5.2d2.0
2590: .It \-xcurses4.2
2591: .St -xcurses4.2
2592: .It \-susv2
2593: .St -susv2
2594: .It \-susv3
2595: .St -susv3
2596: .It \-svid4
2597: .St -svid4
2598: .El
1.17 schwarze 2599: .Ss \&Sx
1.41 schwarze 2600: Reference a section or sub-section.
2601: The referenced section or sub-section name must be identical to the
2602: enclosed argument, including whitespace.
2603: .Pp
2604: Examples:
2605: .D1 \&.Sx MANUAL STRUCTURE
1.17 schwarze 2606: .Ss \&Sy
1.41 schwarze 2607: Format enclosed arguments in symbolic
2608: .Pq Dq boldface .
2609: Note that this is a presentation term and should not be used for
2610: stylistically decorating technical terms.
2611: .Pp
2612: See also
2613: .Sx \&Bf ,
2614: .Sx \&Li ,
2615: and
2616: .Sx \&Em .
1.17 schwarze 2617: .Ss \&Tn
1.41 schwarze 2618: Format a tradename.
2619: .Pp
2620: Examples:
2621: .D1 \&.Tn IBM
1.17 schwarze 2622: .Ss \&Ud
1.33 schwarze 2623: Prints out
2624: .Dq currently under development.
1.17 schwarze 2625: .Ss \&Ux
1.27 schwarze 2626: Format the UNIX name.
2627: Accepts no argument.
1.17 schwarze 2628: .Pp
2629: Examples:
1.25 schwarze 2630: .D1 \&.Ux
1.17 schwarze 2631: .Pp
2632: See also
2633: .Sx \&At ,
2634: .Sx \&Bsx ,
2635: .Sx \&Bx ,
2636: .Sx \&Dx ,
2637: .Sx \&Fx ,
2638: .Sx \&Nx ,
2639: and
2640: .Sx \&Ox .
2641: .Ss \&Va
1.39 schwarze 2642: A variable name.
2643: .Pp
2644: Examples:
2645: .D1 \&.Va foo
2646: .D1 \&.Va const char *bar ;
1.17 schwarze 2647: .Ss \&Vt
1.27 schwarze 2648: A variable type.
1.35 schwarze 2649: This is also used for indicating global variables in the
2650: .Em SYNOPSIS
1.27 schwarze 2651: section, in which case a variable name is also specified.
2652: Note that it accepts
1.22 schwarze 2653: .Sx Block partial-implicit
1.35 schwarze 2654: syntax when invoked as the first macro in the
2655: .Em SYNOPSIS
2656: section, else it accepts ordinary
1.22 schwarze 2657: .Sx In-line
2658: syntax.
2659: .Pp
2660: Note that this should not be confused with
2661: .Sx \&Ft ,
2662: which is used for function return types.
2663: .Pp
2664: Examples:
1.25 schwarze 2665: .D1 \&.Vt unsigned char
1.35 schwarze 2666: .D1 \&.Vt extern const char * const sys_signame[] \&;
1.22 schwarze 2667: .Pp
2668: See also
1.35 schwarze 2669: .Sx MANUAL STRUCTURE
1.22 schwarze 2670: and
2671: .Sx \&Va .
1.17 schwarze 2672: .Ss \&Xc
1.24 schwarze 2673: Close a scope opened by
2674: .Sx \&Xo .
1.17 schwarze 2675: .Ss \&Xo
1.27 schwarze 2676: Open an extension scope.
2677: This macro originally existed to extend the 9-argument limit of troff;
2678: since this limit has been lifted, the macro has been deprecated.
1.17 schwarze 2679: .Ss \&Xr
1.22 schwarze 2680: Link to another manual
2681: .Pq Qq cross-reference .
1.34 schwarze 2682: Its syntax is as follows:
1.22 schwarze 2683: .Pp
1.34 schwarze 2684: .D1 Pf \. Sx \&Xr Cm name section
1.22 schwarze 2685: .Pp
2686: The
2687: .Cm name
2688: and
2689: .Cm section
1.27 schwarze 2690: are the name and section of the linked manual.
2691: If
1.22 schwarze 2692: .Cm section
2693: is followed by non-punctuation, an
2694: .Sx \&Ns
1.27 schwarze 2695: is inserted into the token stream.
2696: This behaviour is for compatibility with
1.22 schwarze 2697: .Xr groff 1 .
2698: .Pp
2699: Examples:
1.25 schwarze 2700: .D1 \&.Xr mandoc 1
1.35 schwarze 2701: .D1 \&.Xr mandoc 1 \&;
1.25 schwarze 2702: .D1 \&.Xr mandoc 1 \&Ns s behaviour
1.17 schwarze 2703: .Ss \&br
1.41 schwarze 2704: Emits a line-break.
2705: This macro should not be used; it is implemented for compatibility with
2706: historical manuals.
2707: .Pp
2708: Consider using
2709: .Sx \&Pp
2710: in the event of natural paragraph breaks.
1.17 schwarze 2711: .Ss \&sp
1.41 schwarze 2712: Emits vertical space.
2713: This macro should not be used; it is implemented for compatibility with
2714: historical manuals.
2715: Its syntax is as follows:
2716: .Pp
2717: .D1 Pf \. Sx \&sp Op Cm height
2718: .Pp
2719: The
2720: .Cm height
2721: argument must be formatted as described in
2722: .Sx Scaling Widths .
2723: If unspecified,
2724: .Sx \&sp
2725: asserts a single vertical space.
1.1 kristaps 2726: .Sh COMPATIBILITY
1.26 schwarze 2727: This section documents compatibility between mandoc and other other
2728: troff implementations, at this time limited to GNU troff
2729: .Pq Qq groff .
1.9 schwarze 2730: The term
1.15 schwarze 2731: .Qq historic groff
1.26 schwarze 2732: refers to groff versions before the
1.15 schwarze 2733: .Pa doc.tmac
1.9 schwarze 2734: file re-write
1.15 schwarze 2735: .Pq somewhere between 1.15 and 1.19 .
1.26 schwarze 2736: .Pp
2737: Heirloom troff, the other significant troff implementation accepting
2738: \-mdoc, is similar to historic groff.
1.15 schwarze 2739: .Pp
2740: .Bl -dash -compact
1.42 ! schwarze 2741: .It
! 2742: An empty
! 2743: .Sq \&Dd
! 2744: macro in groff prints
! 2745: .Dq Epoch .
! 2746: In mandoc, it resolves to the current date.
1.15 schwarze 2747: .It
1.36 schwarze 2748: Old groff fails to assert a newline before
2749: .Sx \&Bd Fl ragged compact .
2750: .It
1.34 schwarze 2751: groff behaves inconsistently when encountering
2752: .Pf non- Sx \&Fa
2753: children of
2754: .Sx \&Fo
2755: regarding spacing between arguments.
2756: In mandoc, this is not the case: each argument is consistently followed
2757: by a single space and the trailing
2758: .Sq \&)
2759: suppresses prior spacing.
2760: .It
2761: groff behaves inconsistently when encountering
2762: .Sx \&Ft
2763: and
2764: .Sx \&Fn
2765: in the
2766: .Em SYNOPSIS :
1.35 schwarze 2767: at times newline(s) are suppressed depending on whether a prior
1.34 schwarze 2768: .Sx \&Fn
2769: has been invoked.
2770: In mandoc, this is not the case.
2771: See
2772: .Sx \&Ft
2773: and
2774: .Sx \&Fn
2775: for the normalised behaviour.
2776: .It
2777: Historic groff does not break before an
2778: .Sx \&Fn
2779: when not invoked as the line macro in the
2780: .Em SYNOPSIS
2781: section.
2782: .It
2783: Historic groff formats the
2784: .Sx \&In
2785: badly: trailing arguments are trashed and
2786: .Em SYNOPSIS
2787: is not specially treated.
2788: .It
2789: groff does not accept the
2790: .Sq \&Ta
2791: pseudo-macro as a line macro.
2792: mandoc does.
2793: .It
1.21 schwarze 2794: The comment syntax
2795: .Sq \e."
2796: is no longer accepted.
2797: .It
1.26 schwarze 2798: In groff, the
1.21 schwarze 2799: .Sx \&Pa
2800: macro does not format its arguments when used in the FILES section under
1.27 schwarze 2801: certain list types.
2802: mandoc does.
1.21 schwarze 2803: .It
1.26 schwarze 2804: Historic groff does not print a dash for empty
1.21 schwarze 2805: .Sx \&Fl
1.27 schwarze 2806: arguments.
2807: mandoc and newer groff implementations do.
1.21 schwarze 2808: .It
1.26 schwarze 2809: groff behaves irregularly when specifying
1.20 schwarze 2810: .Sq \ef
1.26 schwarze 2811: .Sx Text Decoration
1.27 schwarze 2812: within line-macro scopes.
2813: mandoc follows a consistent system.
1.20 schwarze 2814: .It
1.26 schwarze 2815: In mandoc, negative scaling units are truncated to zero; groff would
1.27 schwarze 2816: move to prior lines.
2817: Furthermore, the
1.17 schwarze 2818: .Sq f
2819: scaling unit, while accepted, is rendered as the default unit.
1.15 schwarze 2820: .It
1.9 schwarze 2821: In quoted literals, groff allowed pair-wise double-quotes to produce a
1.27 schwarze 2822: standalone double-quote in formatted output.
2823: This idiosyncratic behaviour is not applicable in mandoc.
1.15 schwarze 2824: .It
1.36 schwarze 2825: Display offsets
1.20 schwarze 2826: .Sx \&Bd
1.36 schwarze 2827: .Fl offset Ar center
1.17 schwarze 2828: and
1.36 schwarze 2829: .Fl offset Ar right
2830: are disregarded in mandoc.
1.39 schwarze 2831: Furthermore, troff specifies a
1.17 schwarze 2832: .Fl file Ar file
1.39 schwarze 2833: argument that is not supported in mandoc.
1.27 schwarze 2834: Lastly, since text is not right-justified in mandoc (or even groff),
1.17 schwarze 2835: .Fl ragged
2836: and
2837: .Fl filled
2838: are aliases, as are
2839: .Fl literal
2840: and
2841: .Fl unfilled .
1.15 schwarze 2842: .It
1.27 schwarze 2843: Historic groff has many un-callable macros.
2844: Most of these (excluding some block-level macros) are now callable.
1.15 schwarze 2845: .It
1.9 schwarze 2846: The vertical bar
1.15 schwarze 2847: .Sq \(ba
1.3 schwarze 2848: made historic groff
1.15 schwarze 2849: .Qq go orbital
1.26 schwarze 2850: but has been a proper delimiter since then.
1.15 schwarze 2851: .It
1.26 schwarze 2852: .Sx \&It Fl nested
1.3 schwarze 2853: is assumed for all lists (it wasn't in historic groff): any list may be
2854: nested and
1.17 schwarze 2855: .Fl enum
1.1 kristaps 2856: lists will restart the sequence only for the sub-list.
1.15 schwarze 2857: .It
1.1 kristaps 2858: Some manuals use
1.17 schwarze 2859: .Sx \&Li
1.1 kristaps 2860: incorrectly by following it with a reserved character and expecting the
1.27 schwarze 2861: delimiter to render.
2862: This is not supported in mandoc.
1.26 schwarze 2863: .It
2864: In groff, the
2865: .Sx \&Cd ,
2866: .Sx \&Er ,
1.30 schwarze 2867: .Sx \&Ex ,
1.26 schwarze 2868: and
1.30 schwarze 2869: .Sx \&Rv
1.27 schwarze 2870: macros were stipulated only to occur in certain manual sections.
2871: mandoc does not have these restrictions.
1.30 schwarze 2872: .It
2873: Newer groff and mandoc print
2874: .Qq AT&T UNIX
2875: prior to unknown arguments of
2876: .Sx \&At ;
2877: older groff did nothing.
1.15 schwarze 2878: .El
1.1 kristaps 2879: .Sh SEE ALSO
1.15 schwarze 2880: .Xr mandoc 1 ,
2881: .Xr mandoc_char 7
1.1 kristaps 2882: .Sh AUTHORS
2883: The
1.15 schwarze 2884: .Nm
1.9 schwarze 2885: reference was written by
1.26 schwarze 2886: .An Kristaps Dzonsons Aq kristaps@bsd.lv .