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