Annotation of mandoc/man.7, Revision 1.116
1.116 ! schwarze 1: .\" $Id: man.7,v 1.115 2012/05/27 17:39:28 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.116 ! schwarze 18: .Dd $Mdocdate: May 27 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
364: argument must conform to
365: .Sx Scaling Widths .
366: If specified, it's saved for later paragraph left-margins; if unspecified, the
367: saved or default width is used.
368: .Pp
369: See also
1.45 kristaps 370: .Sx \&IP ,
371: .Sx \&LP ,
372: .Sx \&P ,
373: .Sx \&PP ,
1.44 kristaps 374: and
1.45 kristaps 375: .Sx \&TP .
1.39 kristaps 376: .Ss \&I
1.22 kristaps 377: Text is rendered in italics.
1.44 kristaps 378: .Pp
379: See also
1.92 kristaps 380: .Sx \&B
1.44 kristaps 381: and
1.92 kristaps 382: .Sx \&R .
1.39 kristaps 383: .Ss \&IB
1.80 kristaps 384: Text is rendered alternately in italics and bold face.
385: Whitespace between arguments is omitted in output.
1.44 kristaps 386: .Pp
387: See
388: .Sx \&BI
389: for an equivalent example.
390: .Pp
391: See also
392: .Sx \&BI ,
393: .Sx \&BR ,
394: .Sx \&RB ,
395: .Sx \&RI ,
396: and
397: .Sx \&IR .
1.39 kristaps 398: .Ss \&IP
1.44 kristaps 399: Begin an indented paragraph with the following syntax:
400: .Bd -filled -offset indent
401: .Pf \. Sx \&IP
402: .Op Cm head Op Cm width
1.32 kristaps 403: .Ed
1.44 kristaps 404: .Pp
405: The
406: .Cm width
407: argument defines the width of the left margin and is defined by
1.80 kristaps 408: .Sx Scaling Widths .
1.44 kristaps 409: It's saved for later paragraph left-margins; if unspecified, the saved or
410: default width is used.
411: .Pp
412: The
413: .Cm head
1.68 kristaps 414: argument is used as a leading term, flushed to the left margin.
415: This is useful for bulleted paragraphs and so on.
1.44 kristaps 416: .Pp
417: See also
1.45 kristaps 418: .Sx \&HP ,
419: .Sx \&LP ,
420: .Sx \&P ,
421: .Sx \&PP ,
1.44 kristaps 422: and
1.45 kristaps 423: .Sx \&TP .
1.39 kristaps 424: .Ss \&IR
1.22 kristaps 425: Text is rendered alternately in italics and roman (the default font).
426: Whitespace between arguments is omitted in output.
1.44 kristaps 427: .Pp
428: See
429: .Sx \&BI
430: for an equivalent example.
431: .Pp
432: See also
433: .Sx \&BI ,
434: .Sx \&IB ,
435: .Sx \&BR ,
436: .Sx \&RB ,
437: and
438: .Sx \&RI .
1.39 kristaps 439: .Ss \&LP
1.68 kristaps 440: Begin an undecorated paragraph.
441: The scope of a paragraph is closed by a subsequent paragraph,
442: sub-section, section, or end of file.
1.78 schwarze 443: The saved paragraph left-margin width is reset to the default.
1.44 kristaps 444: .Pp
445: See also
1.45 kristaps 446: .Sx \&HP ,
447: .Sx \&IP ,
448: .Sx \&P ,
449: .Sx \&PP ,
1.44 kristaps 450: and
1.45 kristaps 451: .Sx \&TP .
1.113 kristaps 452: .Ss \&OP
453: Optional command-line argument.
1.114 schwarze 454: This is a non-standard GNU extension, included only for compatibility.
455: It has the following syntax:
1.113 kristaps 456: .Bd -filled -offset indent
457: .Pf \. Sx \&OP
458: .Cm key Op Cm value
459: .Ed
460: .Pp
461: The
462: .Cm key
463: is usually a command-line flag and
464: .Cm value
465: its argument.
1.39 kristaps 466: .Ss \&P
467: Synonym for
468: .Sx \&LP .
1.44 kristaps 469: .Pp
470: See also
1.45 kristaps 471: .Sx \&HP ,
472: .Sx \&IP ,
473: .Sx \&LP ,
474: .Sx \&PP ,
1.44 kristaps 475: and
1.45 kristaps 476: .Sx \&TP .
1.39 kristaps 477: .Ss \&PP
478: Synonym for
479: .Sx \&LP .
1.44 kristaps 480: .Pp
481: See also
1.45 kristaps 482: .Sx \&HP ,
483: .Sx \&IP ,
484: .Sx \&LP ,
485: .Sx \&P ,
1.44 kristaps 486: and
1.45 kristaps 487: .Sx \&TP .
1.39 kristaps 488: .Ss \&R
1.22 kristaps 489: Text is rendered in roman (the default font).
1.44 kristaps 490: .Pp
491: See also
1.92 kristaps 492: .Sx \&I
1.44 kristaps 493: and
1.92 kristaps 494: .Sx \&B .
1.39 kristaps 495: .Ss \&RB
1.22 kristaps 496: Text is rendered alternately in roman (the default font) and bold face.
497: Whitespace between arguments is omitted in output.
1.44 kristaps 498: .Pp
499: See
500: .Sx \&BI
501: for an equivalent example.
502: .Pp
503: See also
504: .Sx \&BI ,
505: .Sx \&IB ,
506: .Sx \&BR ,
507: .Sx \&RI ,
508: and
509: .Sx \&IR .
1.39 kristaps 510: .Ss \&RE
1.30 kristaps 511: Explicitly close out the scope of a prior
1.39 kristaps 512: .Sx \&RS .
1.102 kristaps 513: The default left margin is restored to the state of the original
514: .Sx \&RS
515: invocation.
1.39 kristaps 516: .Ss \&RI
1.22 kristaps 517: Text is rendered alternately in roman (the default font) and italics.
518: Whitespace between arguments is omitted in output.
1.44 kristaps 519: .Pp
520: See
521: .Sx \&BI
522: for an equivalent example.
523: .Pp
524: See also
525: .Sx \&BI ,
526: .Sx \&IB ,
527: .Sx \&BR ,
528: .Sx \&RB ,
529: and
530: .Sx \&IR .
1.39 kristaps 531: .Ss \&RS
1.102 kristaps 532: Temporarily reset the default left margin.
1.44 kristaps 533: This has the following syntax:
534: .Bd -filled -offset indent
1.102 kristaps 535: .Pf \. Sx \&RS
1.44 kristaps 536: .Op Cm width
1.32 kristaps 537: .Ed
1.44 kristaps 538: .Pp
539: The
540: .Cm width
541: argument must conform to
542: .Sx Scaling Widths .
1.55 kristaps 543: If not specified, the saved or default width is used.
1.102 kristaps 544: .Pp
545: See also
546: .Sx \&RE .
1.39 kristaps 547: .Ss \&SB
1.22 kristaps 548: Text is rendered in small size (one point smaller than the default font)
549: bold face.
1.39 kristaps 550: .Ss \&SH
1.68 kristaps 551: Begin a section.
552: The scope of a section is only closed by another section or the end of
553: file.
1.78 schwarze 554: The paragraph left-margin width is reset to the default.
1.39 kristaps 555: .Ss \&SM
1.22 kristaps 556: Text is rendered in small size (one point smaller than the default
557: font).
1.39 kristaps 558: .Ss \&SS
1.68 kristaps 559: Begin a sub-section.
560: The scope of a sub-section is closed by a subsequent sub-section,
561: section, or end of file.
1.78 schwarze 562: The paragraph left-margin width is reset to the default.
1.39 kristaps 563: .Ss \&TH
1.22 kristaps 564: Sets the title of the manual page with the following syntax:
1.44 kristaps 565: .Bd -filled -offset indent
566: .Pf \. Sx \&TH
1.99 schwarze 567: .Ar title section date
568: .Op Ar source Op Ar volume
1.44 kristaps 569: .Ed
1.43 kristaps 570: .Pp
1.99 schwarze 571: Conventionally, the document
572: .Ar title
573: is given in all caps.
574: The recommended
575: .Ar date
576: format is
577: .Sy YYYY-MM-DD
578: as specified in the ISO-8601 standard;
579: if the argument does not conform, it is printed verbatim.
580: If the
581: .Ar date
582: is empty or not specified, the current date is used.
583: The optional
584: .Ar source
1.68 kristaps 585: string specifies the organisation providing the utility.
586: The
1.99 schwarze 587: .Ar volume
1.43 kristaps 588: string replaces the default rendered volume, which is dictated by the
589: manual section.
590: .Pp
591: Examples:
1.46 kristaps 592: .Pp
1.93 kristaps 593: .Dl \&.TH CVS 5 "1992-02-12" GNU
1.39 kristaps 594: .Ss \&TP
1.25 kristaps 595: Begin a paragraph where the head, if exceeding the indentation width, is
1.24 kristaps 596: followed by a newline; if not, the body follows on the same line after a
1.68 kristaps 597: buffer to the indentation width.
598: Subsequent output lines are indented.
1.44 kristaps 599: The syntax is as follows:
600: .Bd -filled -offset indent
601: .Pf \. Sx \&TP
602: .Op Cm width
1.32 kristaps 603: .Ed
604: .Pp
1.44 kristaps 605: The
606: .Cm width
607: argument must conform to
608: .Sx Scaling Widths .
609: If specified, it's saved for later paragraph left-margins; if
1.27 kristaps 610: unspecified, the saved or default width is used.
1.44 kristaps 611: .Pp
612: See also
1.45 kristaps 613: .Sx \&HP ,
614: .Sx \&IP ,
615: .Sx \&LP ,
616: .Sx \&P ,
1.44 kristaps 617: and
1.45 kristaps 618: .Sx \&PP .
1.72 joerg 619: .Ss \&UC
620: Sets the volume for the footer for compatibility with man pages from
621: BSD releases.
622: The optional first argument specifies which release it is from.
1.39 kristaps 623: .Ss \&br
1.68 kristaps 624: Breaks the current line.
625: Consecutive invocations have no further effect.
1.44 kristaps 626: .Pp
627: See also
628: .Sx \&sp .
1.39 kristaps 629: .Ss \&fi
1.22 kristaps 630: End literal mode begun by
1.39 kristaps 631: .Sx \&nf .
1.91 kristaps 632: .Ss \&ft
633: Change the current font mode.
634: See
635: .Sx Text Decoration
636: for a listing of available font modes.
1.79 kristaps 637: .Ss \&in
638: Indent relative to the current indentation:
639: .Pp
640: .D1 Pf \. Sx \&in Op Cm width
641: .Pp
642: If
643: .Cm width
644: is signed, the new offset is relative.
645: Otherwise, it is absolute.
646: This value is reset upon the next paragraph, section, or sub-section.
1.39 kristaps 647: .Ss \&na
1.36 kristaps 648: Don't align to the right margin.
1.39 kristaps 649: .Ss \&nf
1.22 kristaps 650: Begin literal mode: all subsequent free-form lines have their end of
1.68 kristaps 651: line boundaries preserved.
652: May be ended by
1.39 kristaps 653: .Sx \&fi .
1.101 kristaps 654: Literal mode is implicitly ended by
655: .Sx \&SH
656: or
657: .Sx \&SS .
1.39 kristaps 658: .Ss \&sp
1.44 kristaps 659: Insert vertical spaces into output with the following syntax:
660: .Bd -filled -offset indent
661: .Pf \. Sx \&sp
662: .Op Cm height
663: .Ed
664: .Pp
1.55 kristaps 665: Insert
1.44 kristaps 666: .Cm height
667: spaces, which must conform to
668: .Sx Scaling Widths .
669: If 0, this is equivalent to the
1.39 kristaps 670: .Sx \&br
1.68 kristaps 671: macro.
672: Defaults to 1, if unspecified.
1.44 kristaps 673: .Pp
674: See also
675: .Sx \&br .
1.111 schwarze 676: .Sh MACRO SYNTAX
677: The
678: .Nm
679: macros are classified by scope: line scope or block scope.
680: Line macros are only scoped to the current line (and, in some
681: situations, the subsequent line).
682: Block macros are scoped to the current line and subsequent lines until
683: closed by another block macro.
684: .Ss Line Macros
685: Line macros are generally scoped to the current line, with the body
686: consisting of zero or more arguments.
687: If a macro is scoped to the next line and the line arguments are empty,
688: the next line, which must be text, is used instead.
689: Thus:
690: .Bd -literal -offset indent
691: \&.I
692: foo
693: .Ed
694: .Pp
695: is equivalent to
696: .Sq \&.I foo .
697: If next-line macros are invoked consecutively, only the last is used.
698: If a next-line macro is followed by a non-next-line macro, an error is
699: raised, except for
700: .Sx \&br ,
701: .Sx \&sp ,
702: and
703: .Sx \&na .
704: .Pp
705: The syntax is as follows:
706: .Bd -literal -offset indent
707: \&.YO \(lBbody...\(rB
708: \(lBbody...\(rB
709: .Ed
710: .Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent
711: .It Em Macro Ta Em Arguments Ta Em Scope Ta Em Notes
712: .It Sx \&AT Ta <=1 Ta current Ta \&
713: .It Sx \&B Ta n Ta next-line Ta \&
714: .It Sx \&BI Ta n Ta current Ta \&
715: .It Sx \&BR Ta n Ta current Ta \&
716: .It Sx \&DT Ta 0 Ta current Ta \&
717: .It Sx \&I Ta n Ta next-line Ta \&
718: .It Sx \&IB Ta n Ta current Ta \&
719: .It Sx \&IR Ta n Ta current Ta \&
1.113 kristaps 720: .It Sx \&OP Ta 0, 1 Ta current Ta compat
1.111 schwarze 721: .It Sx \&R Ta n Ta next-line Ta \&
722: .It Sx \&RB Ta n Ta current Ta \&
723: .It Sx \&RI Ta n Ta current Ta \&
724: .It Sx \&SB Ta n Ta next-line Ta \&
725: .It Sx \&SM Ta n Ta next-line Ta \&
726: .It Sx \&TH Ta >1, <6 Ta current Ta \&
727: .It Sx \&UC Ta <=1 Ta current Ta \&
728: .It Sx \&br Ta 0 Ta current Ta compat
729: .It Sx \&fi Ta 0 Ta current Ta compat
730: .It Sx \&ft Ta 1 Ta current Ta compat
731: .It Sx \&in Ta 1 Ta current Ta compat
732: .It Sx \&na Ta 0 Ta current Ta compat
733: .It Sx \&nf Ta 0 Ta current Ta compat
734: .It Sx \&sp Ta 1 Ta current Ta compat
735: .El
736: .Pp
737: Macros marked as
738: .Qq compat
739: are included for compatibility with the significant corpus of existing
740: manuals that mix dialects of roff.
741: These macros should not be used for portable
742: .Nm
743: manuals.
744: .Ss Block Macros
745: Block macros comprise a head and body.
746: As with in-line macros, the head is scoped to the current line and, in
747: one circumstance, the next line (the next-line stipulations as in
748: .Sx Line Macros
749: apply here as well).
750: .Pp
751: The syntax is as follows:
752: .Bd -literal -offset indent
753: \&.YO \(lBhead...\(rB
754: \(lBhead...\(rB
755: \(lBbody...\(rB
756: .Ed
757: .Pp
758: The closure of body scope may be to the section, where a macro is closed
759: by
760: .Sx \&SH ;
761: sub-section, closed by a section or
762: .Sx \&SS ;
763: part, closed by a section, sub-section, or
764: .Sx \&RE ;
765: or paragraph, closed by a section, sub-section, part,
766: .Sx \&HP ,
767: .Sx \&IP ,
768: .Sx \&LP ,
769: .Sx \&P ,
770: .Sx \&PP ,
771: or
772: .Sx \&TP .
773: No closure refers to an explicit block closing macro.
774: .Pp
775: As a rule, block macros may not be nested; thus, calling a block macro
776: while another block macro scope is open, and the open scope is not
777: implicitly closed, is syntactically incorrect.
778: .Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX" -offset indent
779: .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope Ta Em Notes
780: .It Sx \&HP Ta <2 Ta current Ta paragraph Ta \&
781: .It Sx \&IP Ta <3 Ta current Ta paragraph Ta \&
782: .It Sx \&LP Ta 0 Ta current Ta paragraph Ta \&
783: .It Sx \&P Ta 0 Ta current Ta paragraph Ta \&
784: .It Sx \&PP Ta 0 Ta current Ta paragraph Ta \&
785: .It Sx \&RE Ta 0 Ta current Ta none Ta compat
786: .It Sx \&RS Ta 1 Ta current Ta part Ta compat
787: .It Sx \&SH Ta >0 Ta next-line Ta section Ta \&
788: .It Sx \&SS Ta >0 Ta next-line Ta sub-section Ta \&
789: .It Sx \&TP Ta n Ta next-line Ta paragraph Ta \&
790: .El
791: .Pp
792: Macros marked
793: .Qq compat
794: are as mentioned in
795: .Sx Line Macros .
796: .Pp
797: If a block macro is next-line scoped, it may only be followed by in-line
798: macros for decorating text.
799: .Ss Font handling
800: In
801: .Nm
802: documents, both
803: .Sx Physical markup
804: macros and
805: .Xr roff 7
806: .Ql \ef
807: font escape sequences can be used to choose fonts.
808: In text lines, the effect of manual font selection by escape sequences
809: only lasts until the next macro invocation; in macro lines, it only lasts
810: until the end of the macro scope.
811: Note that macros like
812: .Sx \&BR
813: open and close a font scope for each argument.
1.18 kristaps 814: .Sh COMPATIBILITY
1.58 kristaps 815: This section documents areas of questionable portability between
816: implementations of the
817: .Nm
818: language.
1.51 kristaps 819: .Pp
820: .Bl -dash -compact
1.109 kristaps 821: .It
822: Do not depend on
823: .Sx \&SH
824: or
825: .Sx \&SS
826: to close out a literal context opened with
827: .Sx \&nf .
828: This behaviour may not be portable.
1.77 kristaps 829: .It
1.58 kristaps 830: In quoted literals, GNU troff allowed pair-wise double-quotes to produce
1.68 kristaps 831: a standalone double-quote in formatted output.
832: It is not known whether this behaviour is exhibited by other formatters.
1.32 kristaps 833: .It
1.82 kristaps 834: troff suppresses a newline before
835: .Sq \(aq
836: macro output; in mandoc, it is an alias for the standard
837: .Sq \&.
838: control character.
839: .It
840: The
841: .Sq \eh
842: .Pq horizontal position ,
843: .Sq \ev
844: .Pq vertical position ,
845: .Sq \em
846: .Pq text colour ,
847: .Sq \eM
848: .Pq text filling colour ,
1.83 kristaps 849: .Sq \ez
850: .Pq zero-length character ,
1.84 kristaps 851: .Sq \ew
852: .Pq string length ,
1.85 kristaps 853: .Sq \ek
854: .Pq horizontal position marker ,
1.87 kristaps 855: .Sq \eo
856: .Pq text overstrike ,
1.82 kristaps 857: and
858: .Sq \es
859: .Pq text size
1.84 kristaps 860: escape sequences are all discarded in mandoc.
1.82 kristaps 861: .It
862: The
863: .Sq \ef
864: scaling unit is accepted by mandoc, but rendered as the default unit.
865: .It
1.23 kristaps 866: The
1.51 kristaps 867: .Sx \&sp
1.68 kristaps 868: macro does not accept negative values in mandoc.
869: In GNU troff, this would result in strange behaviour.
1.112 schwarze 870: .It
871: In page header lines, GNU troff versions up to and including 1.21
872: only print
873: .Ar volume
874: names explicitly specified in the
875: .Sx \&TH
876: macro; mandoc and newer groff print the default volume name
877: corresponding to the
878: .Ar section
879: number when no
880: .Ar volume
881: is given, like in
882: .Xr mdoc 7 .
1.32 kristaps 883: .El
1.113 kristaps 884: .Pp
885: The
886: .Sx OP
887: macro is part of the extended
888: .Nm
889: macro set, and may not be portable to non-GNU troff implementations.
1.1 kristaps 890: .Sh SEE ALSO
1.89 schwarze 891: .Xr man 1 ,
1.32 kristaps 892: .Xr mandoc 1 ,
1.98 kristaps 893: .Xr eqn 7 ,
1.89 schwarze 894: .Xr mandoc_char 7 ,
1.94 kristaps 895: .Xr mdoc 7 ,
896: .Xr roff 7 ,
897: .Xr tbl 7
1.78 schwarze 898: .Sh HISTORY
899: The
900: .Nm
901: language first appeared as a macro package for the roff typesetting
902: system in
903: .At v7 .
904: It was later rewritten by James Clark as a macro package for groff.
1.113 kristaps 905: Eric S. Raymond wrote the extended
906: .Nm
907: macros for groff in 2007.
1.78 schwarze 908: The stand-alone implementation that is part of the
909: .Xr mandoc 1
910: utility written by Kristaps Dzonsons appeared in
1.80 kristaps 911: .Ox 4.6 .
1.1 kristaps 912: .Sh AUTHORS
1.78 schwarze 913: This
1.32 kristaps 914: .Nm
1.23 kristaps 915: reference was written by
1.105 kristaps 916: .An Kristaps Dzonsons ,
917: .Mt kristaps@bsd.lv .
1.1 kristaps 918: .Sh CAVEATS
1.68 kristaps 919: Do not use this language.
920: Use
1.32 kristaps 921: .Xr mdoc 7 ,
1.1 kristaps 922: instead.
CVSweb