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