Annotation of mandoc/man.7, Revision 1.117
1.117 ! schwarze 1: .\" $Id: man.7,v 1.116 2012/06/02 20:16:23 schwarze Exp $
1.1 kristaps 2: .\"
1.115 schwarze 3: .\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
1.111 schwarze 4: .\" Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
1.1 kristaps 5: .\"
6: .\" Permission to use, copy, modify, and distribute this software for any
1.10 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.
9: .\"
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.1 kristaps 17: .\"
1.117 ! schwarze 18: .Dd $Mdocdate: June 2 2012 $
1.9 kristaps 19: .Dt MAN 7
1.1 kristaps 20: .Os
21: .Sh NAME
1.32 kristaps 22: .Nm man
1.111 schwarze 23: .Nd legacy formatting language for manual pages
1.1 kristaps 24: .Sh DESCRIPTION
1.111 schwarze 25: Traditionally, the
1.32 kristaps 26: .Nm man
1.111 schwarze 27: language has been used to write
1.32 kristaps 28: .Ux
1.111 schwarze 29: manuals for the
30: .Xr man 1
31: utility.
32: It supports limited control of presentational details like fonts,
33: indentation and spacing.
34: This reference document describes the structure of manual pages
35: and the syntax and usage of the man language.
1.32 kristaps 36: .Pp
37: .Bf -emphasis
1.20 kristaps 38: Do not use
1.32 kristaps 39: .Nm
1.111 schwarze 40: to write your manuals:
1.32 kristaps 41: .Ef
1.111 schwarze 42: It lacks support for semantic markup.
1.19 kristaps 43: Use the
1.32 kristaps 44: .Xr mdoc 7
1.1 kristaps 45: language, instead.
1.32 kristaps 46: .Pp
1.111 schwarze 47: In a
1.32 kristaps 48: .Nm
1.111 schwarze 49: document, lines beginning with the control character
1.32 kristaps 50: .Sq \&.
1.111 schwarze 51: are called
52: .Dq macro lines .
53: The first word is the macro name.
54: It usually consists of two capital letters.
55: For a list of available macros, see
56: .Sx MACRO OVERVIEW .
57: The words following the macro name are arguments to the macro.
58: .Pp
59: Lines not beginning with the control character are called
60: .Dq text lines .
61: They provide free-form text to be printed; the formatting of the text
62: depends on the respective processing context:
1.32 kristaps 63: .Bd -literal -offset indent
1.1 kristaps 64: \&.SH Macro lines change control state.
1.106 kristaps 65: Text lines are interpreted within the current state.
1.32 kristaps 66: .Ed
1.103 kristaps 67: .Pp
1.111 schwarze 68: Many aspects of the basic syntax of the
1.103 kristaps 69: .Nm
1.111 schwarze 70: language are based on the
71: .Xr roff 7
72: language; see the
73: .Em LANGUAGE SYNTAX
1.106 kristaps 74: and
1.111 schwarze 75: .Em MACRO SYNTAX
76: sections in the
77: .Xr roff 7
78: manual for details, in particular regarding
79: comments, escape sequences, whitespace, and quoting.
1.22 kristaps 80: .Sh MANUAL STRUCTURE
1.16 kristaps 81: Each
1.32 kristaps 82: .Nm
1.80 kristaps 83: document must contain the
1.39 kristaps 84: .Sx \&TH
1.68 kristaps 85: macro describing the document's section and title.
1.80 kristaps 86: It may occur anywhere in the document, although conventionally it
1.68 kristaps 87: appears as the first macro.
1.32 kristaps 88: .Pp
1.22 kristaps 89: Beyond
1.39 kristaps 90: .Sx \&TH ,
1.111 schwarze 91: at least one macro or text line must appear in the document.
1.100 kristaps 92: .Pp
93: The following is a well-formed skeleton
94: .Nm
95: file for a utility
96: .Qq progname :
1.32 kristaps 97: .Bd -literal -offset indent
1.100 kristaps 98: \&.TH PROGNAME 1 2009-10-10
1.22 kristaps 99: \&.SH NAME
1.100 kristaps 100: \efBprogname\efR \e(en a description goes here
1.106 kristaps 101: \&.\e\(dq .SH LIBRARY
102: \&.\e\(dq For sections 2 & 3 only.
103: \&.\e\(dq Not used in OpenBSD.
1.22 kristaps 104: \&.SH SYNOPSIS
1.100 kristaps 105: \efBprogname\efR [\efB\e-options\efR] arguments...
1.22 kristaps 106: \&.SH DESCRIPTION
1.33 kristaps 107: The \efBfoo\efR utility processes files...
1.106 kristaps 108: \&.\e\(dq .SH IMPLEMENTATION NOTES
109: \&.\e\(dq Not used in OpenBSD.
110: \&.\e\(dq .SH RETURN VALUES
111: \&.\e\(dq For sections 2, 3, & 9 only.
112: \&.\e\(dq .SH ENVIRONMENT
113: \&.\e\(dq For sections 1, 6, 7, & 8 only.
114: \&.\e\(dq .SH FILES
115: \&.\e\(dq .SH EXIT STATUS
116: \&.\e\(dq For sections 1, 6, & 8 only.
117: \&.\e\(dq .SH EXAMPLES
118: \&.\e\(dq .SH DIAGNOSTICS
119: \&.\e\(dq For sections 1, 4, 6, 7, & 8 only.
120: \&.\e\(dq .SH ERRORS
121: \&.\e\(dq For sections 2, 3, & 9 only.
122: \&.\e\(dq .SH SEE ALSO
123: \&.\e\(dq .BR foo ( 1 )
124: \&.\e\(dq .SH STANDARDS
125: \&.\e\(dq .SH HISTORY
126: \&.\e\(dq .SH AUTHORS
127: \&.\e\(dq .SH CAVEATS
128: \&.\e\(dq .SH BUGS
129: \&.\e\(dq .SH SECURITY CONSIDERATIONS
130: \&.\e\(dq Not used in OpenBSD.
1.32 kristaps 131: .Ed
1.41 kristaps 132: .Pp
133: The sections in a
134: .Nm
1.68 kristaps 135: document are conventionally ordered as they appear above.
136: Sections should be composed as follows:
1.42 kristaps 137: .Bl -ohang -offset indent
138: .It Em NAME
1.68 kristaps 139: The name(s) and a short description of the documented material.
140: The syntax for this is generally as follows:
1.41 kristaps 141: .Pp
142: .D1 \efBname\efR \e(en description
1.42 kristaps 143: .It Em LIBRARY
1.41 kristaps 144: The name of the library containing the documented material, which is
1.68 kristaps 145: assumed to be a function in a section 2 or 3 manual.
146: For functions in the C library, this may be as follows:
1.41 kristaps 147: .Pp
148: .D1 Standard C Library (libc, -lc)
1.42 kristaps 149: .It Em SYNOPSIS
1.41 kristaps 150: Documents the utility invocation syntax, function call syntax, or device
1.55 kristaps 151: configuration.
1.41 kristaps 152: .Pp
153: For the first, utilities (sections 1, 6, and 8), this is
154: generally structured as follows:
155: .Pp
156: .D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR...
157: .Pp
158: For the second, function calls (sections 2, 3, 9):
159: .Pp
1.44 kristaps 160: .D1 \&.B char *name(char *\efIarg\efR);
1.41 kristaps 161: .Pp
162: And for the third, configurations (section 4):
163: .Pp
1.44 kristaps 164: .D1 \&.B name* at cardbus ? function ?
1.41 kristaps 165: .Pp
1.55 kristaps 166: Manuals not in these sections generally don't need a
1.42 kristaps 167: .Em SYNOPSIS .
168: .It Em DESCRIPTION
1.55 kristaps 169: This expands upon the brief, one-line description in
1.42 kristaps 170: .Em NAME .
171: It usually contains a break-down of the options (if documenting a
172: command).
173: .It Em IMPLEMENTATION NOTES
1.68 kristaps 174: Implementation-specific notes should be kept here.
175: This is useful when implementing standard functions that may have side
176: effects or notable algorithmic implications.
1.42 kristaps 177: .It Em RETURN VALUES
1.80 kristaps 178: This section documents the return values of functions in sections 2, 3, and 9.
1.42 kristaps 179: .It Em ENVIRONMENT
180: Documents any usages of environment variables, e.g.,
181: .Xr environ 7 .
182: .It Em FILES
1.68 kristaps 183: Documents files used.
1.78 schwarze 184: It's helpful to document both the file name and a short description of how
1.68 kristaps 185: the file is used (created, modified, etc.).
1.67 kristaps 186: .It Em EXIT STATUS
1.80 kristaps 187: This section documents the command exit status for
188: section 1, 6, and 8 utilities.
1.68 kristaps 189: Historically, this information was described in
1.67 kristaps 190: .Em DIAGNOSTICS ,
191: a practise that is now discouraged.
1.42 kristaps 192: .It Em EXAMPLES
1.68 kristaps 193: Example usages.
194: This often contains snippets of well-formed,
195: well-tested invocations.
1.80 kristaps 196: Make sure that examples work properly!
1.42 kristaps 197: .It Em DIAGNOSTICS
1.68 kristaps 198: Documents error conditions.
199: This is most useful in section 4 manuals.
1.42 kristaps 200: Historically, this section was used in place of
201: .Em EXIT STATUS
202: for manuals in sections 1, 6, and 8; however, this practise is
203: discouraged.
204: .It Em ERRORS
205: Documents error handling in sections 2, 3, and 9.
206: .It Em SEE ALSO
1.68 kristaps 207: References other manuals with related topics.
208: This section should exist for most manuals.
1.44 kristaps 209: .Pp
210: .D1 \&.BR bar \&( 1 \&),
211: .Pp
212: Cross-references should conventionally be ordered
1.42 kristaps 213: first by section, then alphabetically.
214: .It Em STANDARDS
215: References any standards implemented or used, such as
216: .Pp
217: .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
218: .Pp
219: If not adhering to any standards, the
220: .Em HISTORY
221: section should be used.
222: .It Em HISTORY
1.81 schwarze 223: A brief history of the subject, including where support first appeared.
1.42 kristaps 224: .It Em AUTHORS
1.81 schwarze 225: Credits to the person or persons who wrote the code and/or documentation.
1.78 schwarze 226: Authors should generally be noted by both name and email address.
1.42 kristaps 227: .It Em CAVEATS
1.78 schwarze 228: Common misuses and misunderstandings should be explained
1.42 kristaps 229: in this section.
230: .It Em BUGS
1.80 kristaps 231: Known bugs, limitations, and work-arounds should be described
1.78 schwarze 232: in this section.
1.42 kristaps 233: .It Em SECURITY CONSIDERATIONS
234: Documents any security precautions that operators should consider.
1.41 kristaps 235: .El
1.110 schwarze 236: .Sh MACRO OVERVIEW
237: This overview is sorted such that macros of similar purpose are listed
238: together, to help find the best macro for any given purpose.
239: Deprecated macros are not included in the overview, but can be found
240: in the alphabetical reference below.
241: .Ss Page header and footer meta-data
242: .Bl -column "PP, LP, P" description
243: .It Sx TH Ta set the title: Ar title section date Op Ar source Op Ar volume
244: .It Sx AT Ta display AT&T UNIX version in the page footer (<= 1 argument)
245: .It Sx UC Ta display BSD version in the page footer (<= 1 argument)
246: .El
247: .Ss Sections and paragraphs
248: .Bl -column "PP, LP, P" description
249: .It Sx SH Ta section header (one line)
250: .It Sx SS Ta subsection header (one line)
251: .It Sx PP , LP , P Ta start an undecorated paragraph (no arguments)
252: .It Sx RS , RE Ta reset the left margin: Op Ar width
253: .It Sx IP Ta indented paragraph: Op Ar head Op Ar width
254: .It Sx TP Ta tagged paragraph: Op Ar width
255: .It Sx HP Ta hanged paragraph: Op Ar width
256: .It Sx \&br Ta force output line break in text mode (no arguments)
257: .It Sx \&sp Ta force vertical space: Op Ar height
258: .It Sx fi , nf Ta fill mode and no-fill mode (no arguments)
259: .It Sx in Ta additional indent: Op Ar width
260: .El
261: .Ss Physical markup
262: .Bl -column "PP, LP, P" description
263: .It Sx B Ta boldface font
264: .It Sx I Ta italic font
265: .It Sx R Ta roman (default) font
266: .It Sx SB Ta small boldface font
267: .It Sx SM Ta small roman font
268: .It Sx BI Ta alternate between boldface and italic fonts
269: .It Sx BR Ta alternate between boldface and roman fonts
270: .It Sx IB Ta alternate between italic and boldface fonts
271: .It Sx IR Ta alternate between italic and roman fonts
272: .It Sx RB Ta alternate between roman and boldface fonts
273: .It Sx RI Ta alternate between roman and italic fonts
274: .El
1.111 schwarze 275: .Sh MACRO REFERENCE
1.22 kristaps 276: This section is a canonical reference to all macros, arranged
1.68 kristaps 277: alphabetically.
278: For the scoping of individual macros, see
1.32 kristaps 279: .Sx MACRO SYNTAX .
1.72 joerg 280: .Ss \&AT
281: Sets the volume for the footer for compatibility with man pages from
282: .Tn AT&T UNIX
283: releases.
284: The optional arguments specify which release it is from.
1.39 kristaps 285: .Ss \&B
1.22 kristaps 286: Text is rendered in bold face.
1.44 kristaps 287: .Pp
288: See also
1.92 kristaps 289: .Sx \&I
1.44 kristaps 290: and
1.92 kristaps 291: .Sx \&R .
1.39 kristaps 292: .Ss \&BI
1.68 kristaps 293: Text is rendered alternately in bold face and italic.
294: Thus,
1.32 kristaps 295: .Sq .BI this word and that
1.22 kristaps 296: causes
1.32 kristaps 297: .Sq this
1.22 kristaps 298: and
1.32 kristaps 299: .Sq and
1.55 kristaps 300: to render in bold face, while
1.32 kristaps 301: .Sq word
1.22 kristaps 302: and
1.32 kristaps 303: .Sq that
1.68 kristaps 304: render in italics.
305: Whitespace between arguments is omitted in output.
1.44 kristaps 306: .Pp
307: Examples:
1.46 kristaps 308: .Pp
1.93 kristaps 309: .Dl \&.BI bold italic bold italic
1.44 kristaps 310: .Pp
311: The output of this example will be emboldened
312: .Dq bold
313: and italicised
314: .Dq italic ,
315: with spaces stripped between arguments.
316: .Pp
317: See also
318: .Sx \&IB ,
319: .Sx \&BR ,
320: .Sx \&RB ,
321: .Sx \&RI ,
322: and
323: .Sx \&IR .
1.39 kristaps 324: .Ss \&BR
1.22 kristaps 325: Text is rendered alternately in bold face and roman (the default font).
326: Whitespace between arguments is omitted in output.
1.44 kristaps 327: .Pp
328: See
329: .Sx \&BI
330: for an equivalent example.
331: .Pp
332: See also
333: .Sx \&BI ,
334: .Sx \&IB ,
335: .Sx \&RB ,
336: .Sx \&RI ,
337: and
338: .Sx \&IR .
1.39 kristaps 339: .Ss \&DT
1.68 kristaps 340: Has no effect.
341: Included for compatibility.
1.116 schwarze 342: .Ss \&EE
343: This is a non-standard GNU extension, included only for compatibility.
344: In
345: .Xr mandoc 1 ,
346: it does the same as
347: .Sx \&fi .
348: .Ss \&EX
349: This is a non-standard GNU extension, included only for compatibility.
350: In
351: .Xr mandoc 1 ,
352: it does the same as
353: .Sx \&nf .
1.39 kristaps 354: .Ss \&HP
1.23 kristaps 355: Begin a paragraph whose initial output line is left-justified, but
1.27 kristaps 356: subsequent output lines are indented, with the following syntax:
1.44 kristaps 357: .Bd -filled -offset indent
358: .Pf \. Sx \&HP
359: .Op Cm width
1.32 kristaps 360: .Ed
1.44 kristaps 361: .Pp
362: The
363: .Cm width
1.117 ! schwarze 364: argument is a
! 365: .Xr roff 7
! 366: scaling width.
1.44 kristaps 367: If specified, it's saved for later paragraph left-margins; if unspecified, the
368: saved or default width is used.
369: .Pp
370: See also
1.45 kristaps 371: .Sx \&IP ,
372: .Sx \&LP ,
373: .Sx \&P ,
374: .Sx \&PP ,
1.44 kristaps 375: and
1.45 kristaps 376: .Sx \&TP .
1.39 kristaps 377: .Ss \&I
1.22 kristaps 378: Text is rendered in italics.
1.44 kristaps 379: .Pp
380: See also
1.92 kristaps 381: .Sx \&B
1.44 kristaps 382: and
1.92 kristaps 383: .Sx \&R .
1.39 kristaps 384: .Ss \&IB
1.80 kristaps 385: Text is rendered alternately in italics and bold face.
386: Whitespace between arguments is omitted in output.
1.44 kristaps 387: .Pp
388: See
389: .Sx \&BI
390: for an equivalent example.
391: .Pp
392: See also
393: .Sx \&BI ,
394: .Sx \&BR ,
395: .Sx \&RB ,
396: .Sx \&RI ,
397: and
398: .Sx \&IR .
1.39 kristaps 399: .Ss \&IP
1.44 kristaps 400: Begin an indented paragraph with the following syntax:
401: .Bd -filled -offset indent
402: .Pf \. Sx \&IP
403: .Op Cm head Op Cm width
1.32 kristaps 404: .Ed
1.44 kristaps 405: .Pp
406: The
407: .Cm width
1.117 ! schwarze 408: argument is a
! 409: .Xr roff 7
! 410: scaling width defining the left margin.
1.44 kristaps 411: It's saved for later paragraph left-margins; if unspecified, the saved or
412: default width is used.
413: .Pp
414: The
415: .Cm head
1.68 kristaps 416: argument is used as a leading term, flushed to the left margin.
417: This is useful for bulleted paragraphs and so on.
1.44 kristaps 418: .Pp
419: See also
1.45 kristaps 420: .Sx \&HP ,
421: .Sx \&LP ,
422: .Sx \&P ,
423: .Sx \&PP ,
1.44 kristaps 424: and
1.45 kristaps 425: .Sx \&TP .
1.39 kristaps 426: .Ss \&IR
1.22 kristaps 427: Text is rendered alternately in italics and roman (the default font).
428: Whitespace between arguments is omitted in output.
1.44 kristaps 429: .Pp
430: See
431: .Sx \&BI
432: for an equivalent example.
433: .Pp
434: See also
435: .Sx \&BI ,
436: .Sx \&IB ,
437: .Sx \&BR ,
438: .Sx \&RB ,
439: and
440: .Sx \&RI .
1.39 kristaps 441: .Ss \&LP
1.68 kristaps 442: Begin an undecorated paragraph.
443: The scope of a paragraph is closed by a subsequent paragraph,
444: sub-section, section, or end of file.
1.78 schwarze 445: The saved paragraph left-margin width is reset to the default.
1.44 kristaps 446: .Pp
447: See also
1.45 kristaps 448: .Sx \&HP ,
449: .Sx \&IP ,
450: .Sx \&P ,
451: .Sx \&PP ,
1.44 kristaps 452: and
1.45 kristaps 453: .Sx \&TP .
1.113 kristaps 454: .Ss \&OP
455: Optional command-line argument.
1.114 schwarze 456: This is a non-standard GNU extension, included only for compatibility.
457: It has the following syntax:
1.113 kristaps 458: .Bd -filled -offset indent
459: .Pf \. Sx \&OP
460: .Cm key Op Cm value
461: .Ed
462: .Pp
463: The
464: .Cm key
465: is usually a command-line flag and
466: .Cm value
467: its argument.
1.39 kristaps 468: .Ss \&P
469: Synonym for
470: .Sx \&LP .
1.44 kristaps 471: .Pp
472: See also
1.45 kristaps 473: .Sx \&HP ,
474: .Sx \&IP ,
475: .Sx \&LP ,
476: .Sx \&PP ,
1.44 kristaps 477: and
1.45 kristaps 478: .Sx \&TP .
1.39 kristaps 479: .Ss \&PP
480: Synonym for
481: .Sx \&LP .
1.44 kristaps 482: .Pp
483: See also
1.45 kristaps 484: .Sx \&HP ,
485: .Sx \&IP ,
486: .Sx \&LP ,
487: .Sx \&P ,
1.44 kristaps 488: and
1.45 kristaps 489: .Sx \&TP .
1.39 kristaps 490: .Ss \&R
1.22 kristaps 491: Text is rendered in roman (the default font).
1.44 kristaps 492: .Pp
493: See also
1.92 kristaps 494: .Sx \&I
1.44 kristaps 495: and
1.92 kristaps 496: .Sx \&B .
1.39 kristaps 497: .Ss \&RB
1.22 kristaps 498: Text is rendered alternately in roman (the default font) and bold face.
499: Whitespace between arguments is omitted in output.
1.44 kristaps 500: .Pp
501: See
502: .Sx \&BI
503: for an equivalent example.
504: .Pp
505: See also
506: .Sx \&BI ,
507: .Sx \&IB ,
508: .Sx \&BR ,
509: .Sx \&RI ,
510: and
511: .Sx \&IR .
1.39 kristaps 512: .Ss \&RE
1.30 kristaps 513: Explicitly close out the scope of a prior
1.39 kristaps 514: .Sx \&RS .
1.102 kristaps 515: The default left margin is restored to the state of the original
516: .Sx \&RS
517: invocation.
1.39 kristaps 518: .Ss \&RI
1.22 kristaps 519: Text is rendered alternately in roman (the default font) and italics.
520: Whitespace between arguments is omitted in output.
1.44 kristaps 521: .Pp
522: See
523: .Sx \&BI
524: for an equivalent example.
525: .Pp
526: See also
527: .Sx \&BI ,
528: .Sx \&IB ,
529: .Sx \&BR ,
530: .Sx \&RB ,
531: and
532: .Sx \&IR .
1.39 kristaps 533: .Ss \&RS
1.102 kristaps 534: Temporarily reset the default left margin.
1.44 kristaps 535: This has the following syntax:
536: .Bd -filled -offset indent
1.102 kristaps 537: .Pf \. Sx \&RS
1.44 kristaps 538: .Op Cm width
1.32 kristaps 539: .Ed
1.44 kristaps 540: .Pp
541: The
542: .Cm width
1.117 ! schwarze 543: argument is a
! 544: .Xr roff 7
! 545: scaling width.
1.55 kristaps 546: If not specified, the saved or default width is used.
1.102 kristaps 547: .Pp
548: See also
549: .Sx \&RE .
1.39 kristaps 550: .Ss \&SB
1.22 kristaps 551: Text is rendered in small size (one point smaller than the default font)
552: bold face.
1.39 kristaps 553: .Ss \&SH
1.68 kristaps 554: Begin a section.
555: The scope of a section is only closed by another section or the end of
556: file.
1.78 schwarze 557: The paragraph left-margin width is reset to the default.
1.39 kristaps 558: .Ss \&SM
1.22 kristaps 559: Text is rendered in small size (one point smaller than the default
560: font).
1.39 kristaps 561: .Ss \&SS
1.68 kristaps 562: Begin a sub-section.
563: The scope of a sub-section is closed by a subsequent sub-section,
564: section, or end of file.
1.78 schwarze 565: The paragraph left-margin width is reset to the default.
1.39 kristaps 566: .Ss \&TH
1.22 kristaps 567: Sets the title of the manual page with the following syntax:
1.44 kristaps 568: .Bd -filled -offset indent
569: .Pf \. Sx \&TH
1.99 schwarze 570: .Ar title section date
571: .Op Ar source Op Ar volume
1.44 kristaps 572: .Ed
1.43 kristaps 573: .Pp
1.99 schwarze 574: Conventionally, the document
575: .Ar title
576: is given in all caps.
577: The recommended
578: .Ar date
579: format is
580: .Sy YYYY-MM-DD
581: as specified in the ISO-8601 standard;
582: if the argument does not conform, it is printed verbatim.
583: If the
584: .Ar date
585: is empty or not specified, the current date is used.
586: The optional
587: .Ar source
1.68 kristaps 588: string specifies the organisation providing the utility.
589: The
1.99 schwarze 590: .Ar volume
1.43 kristaps 591: string replaces the default rendered volume, which is dictated by the
592: manual section.
593: .Pp
594: Examples:
1.46 kristaps 595: .Pp
1.93 kristaps 596: .Dl \&.TH CVS 5 "1992-02-12" GNU
1.39 kristaps 597: .Ss \&TP
1.25 kristaps 598: Begin a paragraph where the head, if exceeding the indentation width, is
1.24 kristaps 599: followed by a newline; if not, the body follows on the same line after a
1.68 kristaps 600: buffer to the indentation width.
601: Subsequent output lines are indented.
1.44 kristaps 602: The syntax is as follows:
603: .Bd -filled -offset indent
604: .Pf \. Sx \&TP
605: .Op Cm width
1.32 kristaps 606: .Ed
607: .Pp
1.44 kristaps 608: The
609: .Cm width
1.117 ! schwarze 610: argument is a
! 611: .Xr roff 7
! 612: scaling width.
1.44 kristaps 613: If specified, it's saved for later paragraph left-margins; if
1.27 kristaps 614: unspecified, the saved or default width is used.
1.44 kristaps 615: .Pp
616: See also
1.45 kristaps 617: .Sx \&HP ,
618: .Sx \&IP ,
619: .Sx \&LP ,
620: .Sx \&P ,
1.44 kristaps 621: and
1.45 kristaps 622: .Sx \&PP .
1.72 joerg 623: .Ss \&UC
624: Sets the volume for the footer for compatibility with man pages from
625: BSD releases.
626: The optional first argument specifies which release it is from.
1.39 kristaps 627: .Ss \&br
1.68 kristaps 628: Breaks the current line.
629: Consecutive invocations have no further effect.
1.44 kristaps 630: .Pp
631: See also
632: .Sx \&sp .
1.39 kristaps 633: .Ss \&fi
1.22 kristaps 634: End literal mode begun by
1.39 kristaps 635: .Sx \&nf .
1.91 kristaps 636: .Ss \&ft
637: Change the current font mode.
638: See
639: .Sx Text Decoration
640: for a listing of available font modes.
1.79 kristaps 641: .Ss \&in
642: Indent relative to the current indentation:
643: .Pp
644: .D1 Pf \. Sx \&in Op Cm width
645: .Pp
646: If
647: .Cm width
648: is signed, the new offset is relative.
649: Otherwise, it is absolute.
650: This value is reset upon the next paragraph, section, or sub-section.
1.39 kristaps 651: .Ss \&na
1.36 kristaps 652: Don't align to the right margin.
1.39 kristaps 653: .Ss \&nf
1.22 kristaps 654: Begin literal mode: all subsequent free-form lines have their end of
1.68 kristaps 655: line boundaries preserved.
656: May be ended by
1.39 kristaps 657: .Sx \&fi .
1.101 kristaps 658: Literal mode is implicitly ended by
659: .Sx \&SH
660: or
661: .Sx \&SS .
1.39 kristaps 662: .Ss \&sp
1.44 kristaps 663: Insert vertical spaces into output with the following syntax:
664: .Bd -filled -offset indent
665: .Pf \. Sx \&sp
666: .Op Cm height
667: .Ed
668: .Pp
1.117 ! schwarze 669: The
1.44 kristaps 670: .Cm height
1.117 ! schwarze 671: argument is a scaling width as described in
! 672: .Xr roff 7 .
1.44 kristaps 673: If 0, this is equivalent to the
1.39 kristaps 674: .Sx \&br
1.68 kristaps 675: macro.
676: Defaults to 1, if unspecified.
1.44 kristaps 677: .Pp
678: See also
679: .Sx \&br .
1.111 schwarze 680: .Sh MACRO SYNTAX
681: The
682: .Nm
683: macros are classified by scope: line scope or block scope.
684: Line macros are only scoped to the current line (and, in some
685: situations, the subsequent line).
686: Block macros are scoped to the current line and subsequent lines until
687: closed by another block macro.
688: .Ss Line Macros
689: Line macros are generally scoped to the current line, with the body
690: consisting of zero or more arguments.
691: If a macro is scoped to the next line and the line arguments are empty,
692: the next line, which must be text, is used instead.
693: Thus:
694: .Bd -literal -offset indent
695: \&.I
696: foo
697: .Ed
698: .Pp
699: is equivalent to
700: .Sq \&.I foo .
701: If next-line macros are invoked consecutively, only the last is used.
702: If a next-line macro is followed by a non-next-line macro, an error is
703: raised, except for
704: .Sx \&br ,
705: .Sx \&sp ,
706: and
707: .Sx \&na .
708: .Pp
709: The syntax is as follows:
710: .Bd -literal -offset indent
711: \&.YO \(lBbody...\(rB
712: \(lBbody...\(rB
713: .Ed
714: .Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent
715: .It Em Macro Ta Em Arguments Ta Em Scope Ta Em Notes
716: .It Sx \&AT Ta <=1 Ta current Ta \&
717: .It Sx \&B Ta n Ta next-line Ta \&
718: .It Sx \&BI Ta n Ta current Ta \&
719: .It Sx \&BR Ta n Ta current Ta \&
720: .It Sx \&DT Ta 0 Ta current Ta \&
721: .It Sx \&I Ta n Ta next-line Ta \&
722: .It Sx \&IB Ta n Ta current Ta \&
723: .It Sx \&IR Ta n Ta current Ta \&
1.113 kristaps 724: .It Sx \&OP Ta 0, 1 Ta current Ta compat
1.111 schwarze 725: .It Sx \&R Ta n Ta next-line Ta \&
726: .It Sx \&RB Ta n Ta current Ta \&
727: .It Sx \&RI Ta n Ta current Ta \&
728: .It Sx \&SB Ta n Ta next-line Ta \&
729: .It Sx \&SM Ta n Ta next-line Ta \&
730: .It Sx \&TH Ta >1, <6 Ta current Ta \&
731: .It Sx \&UC Ta <=1 Ta current Ta \&
732: .It Sx \&br Ta 0 Ta current Ta compat
733: .It Sx \&fi Ta 0 Ta current Ta compat
734: .It Sx \&ft Ta 1 Ta current Ta compat
735: .It Sx \&in Ta 1 Ta current Ta compat
736: .It Sx \&na Ta 0 Ta current Ta compat
737: .It Sx \&nf Ta 0 Ta current Ta compat
738: .It Sx \&sp Ta 1 Ta current Ta compat
739: .El
740: .Pp
741: Macros marked as
742: .Qq compat
743: are included for compatibility with the significant corpus of existing
744: manuals that mix dialects of roff.
745: These macros should not be used for portable
746: .Nm
747: manuals.
748: .Ss Block Macros
749: Block macros comprise a head and body.
750: As with in-line macros, the head is scoped to the current line and, in
751: one circumstance, the next line (the next-line stipulations as in
752: .Sx Line Macros
753: apply here as well).
754: .Pp
755: The syntax is as follows:
756: .Bd -literal -offset indent
757: \&.YO \(lBhead...\(rB
758: \(lBhead...\(rB
759: \(lBbody...\(rB
760: .Ed
761: .Pp
762: The closure of body scope may be to the section, where a macro is closed
763: by
764: .Sx \&SH ;
765: sub-section, closed by a section or
766: .Sx \&SS ;
767: part, closed by a section, sub-section, or
768: .Sx \&RE ;
769: or paragraph, closed by a section, sub-section, part,
770: .Sx \&HP ,
771: .Sx \&IP ,
772: .Sx \&LP ,
773: .Sx \&P ,
774: .Sx \&PP ,
775: or
776: .Sx \&TP .
777: No closure refers to an explicit block closing macro.
778: .Pp
779: As a rule, block macros may not be nested; thus, calling a block macro
780: while another block macro scope is open, and the open scope is not
781: implicitly closed, is syntactically incorrect.
782: .Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX" -offset indent
783: .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope Ta Em Notes
784: .It Sx \&HP Ta <2 Ta current Ta paragraph Ta \&
785: .It Sx \&IP Ta <3 Ta current Ta paragraph Ta \&
786: .It Sx \&LP Ta 0 Ta current Ta paragraph Ta \&
787: .It Sx \&P Ta 0 Ta current Ta paragraph Ta \&
788: .It Sx \&PP Ta 0 Ta current Ta paragraph Ta \&
789: .It Sx \&RE Ta 0 Ta current Ta none Ta compat
790: .It Sx \&RS Ta 1 Ta current Ta part Ta compat
791: .It Sx \&SH Ta >0 Ta next-line Ta section Ta \&
792: .It Sx \&SS Ta >0 Ta next-line Ta sub-section Ta \&
793: .It Sx \&TP Ta n Ta next-line Ta paragraph Ta \&
794: .El
795: .Pp
796: Macros marked
797: .Qq compat
798: are as mentioned in
799: .Sx Line Macros .
800: .Pp
801: If a block macro is next-line scoped, it may only be followed by in-line
802: macros for decorating text.
803: .Ss Font handling
804: In
805: .Nm
806: documents, both
807: .Sx Physical markup
808: macros and
809: .Xr roff 7
810: .Ql \ef
811: font escape sequences can be used to choose fonts.
812: In text lines, the effect of manual font selection by escape sequences
813: only lasts until the next macro invocation; in macro lines, it only lasts
814: until the end of the macro scope.
815: Note that macros like
816: .Sx \&BR
817: open and close a font scope for each argument.
1.18 kristaps 818: .Sh COMPATIBILITY
1.58 kristaps 819: This section documents areas of questionable portability between
820: implementations of the
821: .Nm
822: language.
1.51 kristaps 823: .Pp
824: .Bl -dash -compact
1.109 kristaps 825: .It
826: Do not depend on
827: .Sx \&SH
828: or
829: .Sx \&SS
830: to close out a literal context opened with
831: .Sx \&nf .
832: This behaviour may not be portable.
1.77 kristaps 833: .It
1.58 kristaps 834: In quoted literals, GNU troff allowed pair-wise double-quotes to produce
1.68 kristaps 835: a standalone double-quote in formatted output.
836: It is not known whether this behaviour is exhibited by other formatters.
1.32 kristaps 837: .It
1.82 kristaps 838: troff suppresses a newline before
839: .Sq \(aq
840: macro output; in mandoc, it is an alias for the standard
841: .Sq \&.
842: control character.
843: .It
844: The
845: .Sq \eh
846: .Pq horizontal position ,
847: .Sq \ev
848: .Pq vertical position ,
849: .Sq \em
850: .Pq text colour ,
851: .Sq \eM
852: .Pq text filling colour ,
1.83 kristaps 853: .Sq \ez
854: .Pq zero-length character ,
1.84 kristaps 855: .Sq \ew
856: .Pq string length ,
1.85 kristaps 857: .Sq \ek
858: .Pq horizontal position marker ,
1.87 kristaps 859: .Sq \eo
860: .Pq text overstrike ,
1.82 kristaps 861: and
862: .Sq \es
863: .Pq text size
1.84 kristaps 864: escape sequences are all discarded in mandoc.
1.82 kristaps 865: .It
866: The
867: .Sq \ef
868: scaling unit is accepted by mandoc, but rendered as the default unit.
869: .It
1.23 kristaps 870: The
1.51 kristaps 871: .Sx \&sp
1.68 kristaps 872: macro does not accept negative values in mandoc.
873: In GNU troff, this would result in strange behaviour.
1.112 schwarze 874: .It
875: In page header lines, GNU troff versions up to and including 1.21
876: only print
877: .Ar volume
878: names explicitly specified in the
879: .Sx \&TH
880: macro; mandoc and newer groff print the default volume name
881: corresponding to the
882: .Ar section
883: number when no
884: .Ar volume
885: is given, like in
886: .Xr mdoc 7 .
1.32 kristaps 887: .El
1.113 kristaps 888: .Pp
889: The
890: .Sx OP
891: macro is part of the extended
892: .Nm
893: macro set, and may not be portable to non-GNU troff implementations.
1.1 kristaps 894: .Sh SEE ALSO
1.89 schwarze 895: .Xr man 1 ,
1.32 kristaps 896: .Xr mandoc 1 ,
1.98 kristaps 897: .Xr eqn 7 ,
1.89 schwarze 898: .Xr mandoc_char 7 ,
1.94 kristaps 899: .Xr mdoc 7 ,
900: .Xr roff 7 ,
901: .Xr tbl 7
1.78 schwarze 902: .Sh HISTORY
903: The
904: .Nm
905: language first appeared as a macro package for the roff typesetting
906: system in
907: .At v7 .
908: It was later rewritten by James Clark as a macro package for groff.
1.113 kristaps 909: Eric S. Raymond wrote the extended
910: .Nm
911: macros for groff in 2007.
1.78 schwarze 912: The stand-alone implementation that is part of the
913: .Xr mandoc 1
914: utility written by Kristaps Dzonsons appeared in
1.80 kristaps 915: .Ox 4.6 .
1.1 kristaps 916: .Sh AUTHORS
1.78 schwarze 917: This
1.32 kristaps 918: .Nm
1.23 kristaps 919: reference was written by
1.105 kristaps 920: .An Kristaps Dzonsons ,
921: .Mt kristaps@bsd.lv .
1.1 kristaps 922: .Sh CAVEATS
1.68 kristaps 923: Do not use this language.
924: Use
1.32 kristaps 925: .Xr mdoc 7 ,
1.1 kristaps 926: instead.
CVSweb