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