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