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