]> git.cameronkatri.com Git - mandoc.git/blob - man.7
Make sure that -Thtml doesn't break within literal lines. This is the
[mandoc.git] / man.7
1 .\" $Id: man.7,v 1.95 2011/01/12 10:43:22 kristaps Exp $
2 .\"
3 .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate: January 12 2011 $
18 .Dt MAN 7
19 .Os
20 .Sh NAME
21 .Nm man
22 .Nd man language reference
23 .Sh DESCRIPTION
24 The
25 .Nm man
26 language was historically used to format
27 .Ux
28 manuals.
29 This reference document describes its syntax, structure, and usage.
30 .Pp
31 .Bf -emphasis
32 Do not use
33 .Nm
34 to write your manuals.
35 .Ef
36 Use the
37 .Xr mdoc 7
38 language, instead.
39 .Pp
40 A
41 .Nm
42 document follows simple rules: lines beginning with the control
43 character
44 .Sq \&.
45 are parsed for macros.
46 Other lines are interpreted within the scope of
47 prior macros:
48 .Bd -literal -offset indent
49 \&.SH Macro lines change control state.
50 Other lines are interpreted within the current state.
51 .Ed
52 .Sh INPUT ENCODING
53 .Nm
54 documents may contain only graphable 7-bit ASCII characters, the
55 space character, and the tab character.
56 All manuals must have
57 .Ux
58 line termination.
59 .Pp
60 Blank lines are acceptable; where found, the output will assert a
61 vertical space.
62 .Pp
63 If the first character of a line is a space, that line is printed
64 with a leading newline.
65 .Ss Comments
66 Text following a
67 .Sq \e\*q ,
68 whether in a macro or free-form text line, is ignored to the end of
69 line.
70 A macro line with only a control character and comment escape,
71 .Sq \&.\e\*q ,
72 is also ignored.
73 Macro lines with only a control character and optionally whitespace are
74 stripped from input.
75 .Ss Special Characters
76 Special characters may occur in both macro and free-form lines.
77 Sequences begin with the escape character
78 .Sq \e
79 followed by either an open-parenthesis
80 .Sq \&(
81 for two-character sequences; an open-bracket
82 .Sq \&[
83 for n-character sequences (terminated at a close-bracket
84 .Sq \&] ) ;
85 or a single one-character sequence.
86 See
87 .Xr mandoc_char 7
88 for a complete list.
89 Examples include
90 .Sq \e(em
91 .Pq em-dash
92 and
93 .Sq \ee
94 .Pq back-slash .
95 .Ss Text Decoration
96 Terms may be text-decorated using the
97 .Sq \ef
98 escape followed by an indicator: B (bold), I (italic), R (Roman), or P
99 (revert to previous mode):
100 .Pp
101 .D1 \efBbold\efR \efIitalic\efP
102 .Pp
103 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
104 respectively) may be used instead.
105 A text decoration is only valid, if specified in free-form text, until
106 the next macro invocation; if specified within a macro, it's only valid
107 until the macro closes scope.
108 Note that macros like
109 .Sx \&BR
110 open and close a font scope with each argument.
111 .Pp
112 The
113 .Sq \ef
114 attribute is forgotten when entering or exiting a macro block.
115 .Ss Whitespace
116 Whitespace consists of the space character.
117 In free-form lines, whitespace is preserved within a line; unescaped
118 trailing spaces are stripped from input (unless in a literal context).
119 Blank free-form lines, which may include spaces, are permitted and
120 rendered as an empty line.
121 .Pp
122 In macro lines, whitespace delimits arguments and is discarded.
123 If arguments are quoted, whitespace within the quotes is retained.
124 .Ss Dates
125 The
126 .Sx \&TH
127 macro is the only
128 .Nm
129 macro that requires a date.
130 The form for this date is the ISO-8601
131 standard
132 .Cm YYYY-MM-DD .
133 .Ss Scaling Widths
134 Many macros support scaled widths for their arguments, such as
135 stipulating a two-inch paragraph indentation with the following:
136 .Bd -literal -offset indent
137 \&.HP 2i
138 .Ed
139 .Pp
140 The syntax for scaled widths is
141 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:]? ,
142 where a decimal must be preceded or proceeded by at least one digit.
143 Negative numbers, while accepted, are truncated to zero.
144 The following scaling units are accepted:
145 .Pp
146 .Bl -tag -width Ds -offset indent -compact
147 .It c
148 centimetre
149 .It i
150 inch
151 .It P
152 pica (~1/6 inch)
153 .It p
154 point (~1/72 inch)
155 .It f
156 synonym for
157 .Sq u
158 .It v
159 default vertical span
160 .It m
161 width of rendered
162 .Sq m
163 .Pq em
164 character
165 .It n
166 width of rendered
167 .Sq n
168 .Pq en
169 character
170 .It u
171 default horizontal span
172 .It M
173 mini-em (~1/100 em)
174 .El
175 .Pp
176 Using anything other than
177 .Sq m ,
178 .Sq n ,
179 .Sq u ,
180 or
181 .Sq v
182 is necessarily non-portable across output media.
183 .Pp
184 If a scaling unit is not provided, the numerical value is interpreted
185 under the default rules of
186 .Sq v
187 for vertical spaces and
188 .Sq u
189 for horizontal ones.
190 .Em Note :
191 this differs from
192 .Xr mdoc 7 ,
193 which, if a unit is not provided, will instead interpret the string as
194 literal text.
195 .Ss Sentence Spacing
196 When composing a manual, make sure that sentences end at the end of
197 a line.
198 By doing so, front-ends will be able to apply the proper amount of
199 spacing after the end of sentence (unescaped) period, exclamation mark,
200 or question mark followed by zero or more non-sentence closing
201 delimiters
202 .Po
203 .Sq \&) ,
204 .Sq \&] ,
205 .Sq \&' ,
206 .Sq \&"
207 .Pc .
208 .Sh MANUAL STRUCTURE
209 Each
210 .Nm
211 document must contain the
212 .Sx \&TH
213 macro describing the document's section and title.
214 It may occur anywhere in the document, although conventionally it
215 appears as the first macro.
216 .Pp
217 Beyond
218 .Sx \&TH ,
219 at least one macro or text node must appear in the document.
220 Documents are generally structured as follows:
221 .Bd -literal -offset indent
222 \&.TH FOO 1 2009-10-10
223 \&.SH NAME
224 \efBfoo\efR \e(en a description goes here
225 \&.\e\*q .SH LIBRARY
226 \&.\e\*q For sections 2 & 3 only.
227 \&.\e\*q Not used in OpenBSD.
228 \&.SH SYNOPSIS
229 \efBfoo\efR [\efB\e-options\efR] arguments...
230 \&.SH DESCRIPTION
231 The \efBfoo\efR utility processes files...
232 \&.\e\*q .SH IMPLEMENTATION NOTES
233 \&.\e\*q Not used in OpenBSD.
234 \&.\e\*q .SH RETURN VALUES
235 \&.\e\*q For sections 2, 3, & 9 only.
236 \&.\e\*q .SH ENVIRONMENT
237 \&.\e\*q For sections 1, 6, 7, & 8 only.
238 \&.\e\*q .SH FILES
239 \&.\e\*q .SH EXIT STATUS
240 \&.\e\*q For sections 1, 6, & 8 only.
241 \&.\e\*q .SH EXAMPLES
242 \&.\e\*q .SH DIAGNOSTICS
243 \&.\e\*q For sections 1, 4, 6, 7, & 8 only.
244 \&.\e\*q .SH ERRORS
245 \&.\e\*q For sections 2, 3, & 9 only.
246 \&.\e\*q .SH SEE ALSO
247 \&.\e\*q .BR foo ( 1 )
248 \&.\e\*q .SH STANDARDS
249 \&.\e\*q .SH HISTORY
250 \&.\e\*q .SH AUTHORS
251 \&.\e\*q .SH CAVEATS
252 \&.\e\*q .SH BUGS
253 \&.\e\*q .SH SECURITY CONSIDERATIONS
254 \&.\e\*q Not used in OpenBSD.
255 .Ed
256 .Pp
257 The sections in a
258 .Nm
259 document are conventionally ordered as they appear above.
260 Sections should be composed as follows:
261 .Bl -ohang -offset indent
262 .It Em NAME
263 The name(s) and a short description of the documented material.
264 The syntax for this is generally as follows:
265 .Pp
266 .D1 \efBname\efR \e(en description
267 .It Em LIBRARY
268 The name of the library containing the documented material, which is
269 assumed to be a function in a section 2 or 3 manual.
270 For functions in the C library, this may be as follows:
271 .Pp
272 .D1 Standard C Library (libc, -lc)
273 .It Em SYNOPSIS
274 Documents the utility invocation syntax, function call syntax, or device
275 configuration.
276 .Pp
277 For the first, utilities (sections 1, 6, and 8), this is
278 generally structured as follows:
279 .Pp
280 .D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR...
281 .Pp
282 For the second, function calls (sections 2, 3, 9):
283 .Pp
284 .D1 \&.B char *name(char *\efIarg\efR);
285 .Pp
286 And for the third, configurations (section 4):
287 .Pp
288 .D1 \&.B name* at cardbus ? function ?
289 .Pp
290 Manuals not in these sections generally don't need a
291 .Em SYNOPSIS .
292 .It Em DESCRIPTION
293 This expands upon the brief, one-line description in
294 .Em NAME .
295 It usually contains a break-down of the options (if documenting a
296 command).
297 .It Em IMPLEMENTATION NOTES
298 Implementation-specific notes should be kept here.
299 This is useful when implementing standard functions that may have side
300 effects or notable algorithmic implications.
301 .It Em RETURN VALUES
302 This section documents the return values of functions in sections 2, 3, and 9.
303 .It Em ENVIRONMENT
304 Documents any usages of environment variables, e.g.,
305 .Xr environ 7 .
306 .It Em FILES
307 Documents files used.
308 It's helpful to document both the file name and a short description of how
309 the file is used (created, modified, etc.).
310 .It Em EXIT STATUS
311 This section documents the command exit status for
312 section 1, 6, and 8 utilities.
313 Historically, this information was described in
314 .Em DIAGNOSTICS ,
315 a practise that is now discouraged.
316 .It Em EXAMPLES
317 Example usages.
318 This often contains snippets of well-formed,
319 well-tested invocations.
320 Make sure that examples work properly!
321 .It Em DIAGNOSTICS
322 Documents error conditions.
323 This is most useful in section 4 manuals.
324 Historically, this section was used in place of
325 .Em EXIT STATUS
326 for manuals in sections 1, 6, and 8; however, this practise is
327 discouraged.
328 .It Em ERRORS
329 Documents error handling in sections 2, 3, and 9.
330 .It Em SEE ALSO
331 References other manuals with related topics.
332 This section should exist for most manuals.
333 .Pp
334 .D1 \&.BR bar \&( 1 \&),
335 .Pp
336 Cross-references should conventionally be ordered
337 first by section, then alphabetically.
338 .It Em STANDARDS
339 References any standards implemented or used, such as
340 .Pp
341 .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
342 .Pp
343 If not adhering to any standards, the
344 .Em HISTORY
345 section should be used.
346 .It Em HISTORY
347 A brief history of the subject, including where support first appeared.
348 .It Em AUTHORS
349 Credits to the person or persons who wrote the code and/or documentation.
350 Authors should generally be noted by both name and email address.
351 .It Em CAVEATS
352 Common misuses and misunderstandings should be explained
353 in this section.
354 .It Em BUGS
355 Known bugs, limitations, and work-arounds should be described
356 in this section.
357 .It Em SECURITY CONSIDERATIONS
358 Documents any security precautions that operators should consider.
359 .El
360 .Sh MACRO SYNTAX
361 Macros are one to three characters in length and begin with a
362 control character,
363 .Sq \&. ,
364 at the beginning of the line.
365 The
366 .Sq \(aq
367 macro control character is also accepted.
368 An arbitrary amount of whitespace (spaces or tabs) may sit between the
369 control character and the macro name.
370 Thus, the following are equivalent:
371 .Bd -literal -offset indent
372 \&.PP
373 \&.\ \ \ PP
374 .Ed
375 .Pp
376 The
377 .Nm
378 macros are classified by scope: line scope or block scope.
379 Line macros are only scoped to the current line (and, in some
380 situations, the subsequent line).
381 Block macros are scoped to the current line and subsequent lines until
382 closed by another block macro.
383 .Ss Line Macros
384 Line macros are generally scoped to the current line, with the body
385 consisting of zero or more arguments.
386 If a macro is scoped to the next line and the line arguments are empty,
387 the next line, which must be text, is used instead.
388 Thus:
389 .Bd -literal -offset indent
390 \&.I
391 foo
392 .Ed
393 .Pp
394 is equivalent to
395 .Sq \&.I foo .
396 If next-line macros are invoked consecutively, only the last is used.
397 If a next-line macro is followed by a non-next-line macro, an error is
398 raised, except for
399 .Sx \&br ,
400 .Sx \&sp ,
401 and
402 .Sx \&na .
403 .Pp
404 The syntax is as follows:
405 .Bd -literal -offset indent
406 \&.YO \(lBbody...\(rB
407 \(lBbody...\(rB
408 .Ed
409 .Pp
410 .Bl -column -compact -offset indent "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX"
411 .It Em Macro Ta Em Arguments Ta Em Scope Ta Em Notes
412 .It Sx \&AT Ta <=1 Ta current Ta \&
413 .It Sx \&B Ta n Ta next-line Ta \&
414 .It Sx \&BI Ta n Ta current Ta \&
415 .It Sx \&BR Ta n Ta current Ta \&
416 .It Sx \&DT Ta 0 Ta current Ta \&
417 .It Sx \&I Ta n Ta next-line Ta \&
418 .It Sx \&IB Ta n Ta current Ta \&
419 .It Sx \&IR Ta n Ta current Ta \&
420 .It Sx \&R Ta n Ta next-line Ta \&
421 .It Sx \&RB Ta n Ta current Ta \&
422 .It Sx \&RI Ta n Ta current Ta \&
423 .It Sx \&SB Ta n Ta next-line Ta \&
424 .It Sx \&SM Ta n Ta next-line Ta \&
425 .It Sx \&TH Ta >1, <6 Ta current Ta \&
426 .It Sx \&UC Ta <=1 Ta current Ta \&
427 .It Sx \&br Ta 0 Ta current Ta compat
428 .It Sx \&fi Ta 0 Ta current Ta compat
429 .It Sx \&ft Ta 1 Ta current Ta compat
430 .It Sx \&in Ta 1 Ta current Ta compat
431 .It Sx \&na Ta 0 Ta current Ta compat
432 .It Sx \&nf Ta 0 Ta current Ta compat
433 .It Sx \&sp Ta 1 Ta current Ta compat
434 .El
435 .Pp
436 Macros marked as
437 .Qq compat
438 are included for compatibility with the significant corpus of existing
439 manuals that mix dialects of roff.
440 These macros should not be used for portable
441 .Nm
442 manuals.
443 .Ss Block Macros
444 Block macros comprise a head and body.
445 As with in-line macros, the head is scoped to the current line and, in
446 one circumstance, the next line (the next-line stipulations as in
447 .Sx Line Macros
448 apply here as well).
449 .Pp
450 The syntax is as follows:
451 .Bd -literal -offset indent
452 \&.YO \(lBhead...\(rB
453 \(lBhead...\(rB
454 \(lBbody...\(rB
455 .Ed
456 .Pp
457 The closure of body scope may be to the section, where a macro is closed
458 by
459 .Sx \&SH ;
460 sub-section, closed by a section or
461 .Sx \&SS ;
462 part, closed by a section, sub-section, or
463 .Sx \&RE ;
464 or paragraph, closed by a section, sub-section, part,
465 .Sx \&HP ,
466 .Sx \&IP ,
467 .Sx \&LP ,
468 .Sx \&P ,
469 .Sx \&PP ,
470 or
471 .Sx \&TP .
472 No closure refers to an explicit block closing macro.
473 .Pp
474 As a rule, block macros may not be nested; thus, calling a block macro
475 while another block macro scope is open, and the open scope is not
476 implicitly closed, is syntactically incorrect.
477 .Pp
478 .Bl -column -compact -offset indent "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX"
479 .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope Ta Em Notes
480 .It Sx \&HP Ta <2 Ta current Ta paragraph Ta \&
481 .It Sx \&IP Ta <3 Ta current Ta paragraph Ta \&
482 .It Sx \&LP Ta 0 Ta current Ta paragraph Ta \&
483 .It Sx \&P Ta 0 Ta current Ta paragraph Ta \&
484 .It Sx \&PP Ta 0 Ta current Ta paragraph Ta \&
485 .It Sx \&RE Ta 0 Ta current Ta none Ta compat
486 .It Sx \&RS Ta 1 Ta current Ta part Ta compat
487 .It Sx \&SH Ta >0 Ta next-line Ta section Ta \&
488 .It Sx \&SS Ta >0 Ta next-line Ta sub-section Ta \&
489 .It Sx \&TP Ta n Ta next-line Ta paragraph Ta \&
490 .El
491 .Pp
492 Macros marked
493 .Qq compat
494 are as mentioned in
495 .Sx Line Macros .
496 .Pp
497 If a block macro is next-line scoped, it may only be followed by in-line
498 macros for decorating text.
499 .Sh REFERENCE
500 This section is a canonical reference to all macros, arranged
501 alphabetically.
502 For the scoping of individual macros, see
503 .Sx MACRO SYNTAX .
504 .Ss \&AT
505 Sets the volume for the footer for compatibility with man pages from
506 .Tn AT&T UNIX
507 releases.
508 The optional arguments specify which release it is from.
509 .Ss \&B
510 Text is rendered in bold face.
511 .Pp
512 See also
513 .Sx \&I
514 and
515 .Sx \&R .
516 .Ss \&BI
517 Text is rendered alternately in bold face and italic.
518 Thus,
519 .Sq .BI this word and that
520 causes
521 .Sq this
522 and
523 .Sq and
524 to render in bold face, while
525 .Sq word
526 and
527 .Sq that
528 render in italics.
529 Whitespace between arguments is omitted in output.
530 .Pp
531 Examples:
532 .Pp
533 .Dl \&.BI bold italic bold italic
534 .Pp
535 The output of this example will be emboldened
536 .Dq bold
537 and italicised
538 .Dq italic ,
539 with spaces stripped between arguments.
540 .Pp
541 See also
542 .Sx \&IB ,
543 .Sx \&BR ,
544 .Sx \&RB ,
545 .Sx \&RI ,
546 and
547 .Sx \&IR .
548 .Ss \&BR
549 Text is rendered alternately in bold face and roman (the default font).
550 Whitespace between arguments is omitted in output.
551 .Pp
552 See
553 .Sx \&BI
554 for an equivalent example.
555 .Pp
556 See also
557 .Sx \&BI ,
558 .Sx \&IB ,
559 .Sx \&RB ,
560 .Sx \&RI ,
561 and
562 .Sx \&IR .
563 .Ss \&DT
564 Has no effect.
565 Included for compatibility.
566 .Ss \&HP
567 Begin a paragraph whose initial output line is left-justified, but
568 subsequent output lines are indented, with the following syntax:
569 .Bd -filled -offset indent
570 .Pf \. Sx \&HP
571 .Op Cm width
572 .Ed
573 .Pp
574 The
575 .Cm width
576 argument must conform to
577 .Sx Scaling Widths .
578 If specified, it's saved for later paragraph left-margins; if unspecified, the
579 saved or default width is used.
580 .Pp
581 See also
582 .Sx \&IP ,
583 .Sx \&LP ,
584 .Sx \&P ,
585 .Sx \&PP ,
586 and
587 .Sx \&TP .
588 .Ss \&I
589 Text is rendered in italics.
590 .Pp
591 See also
592 .Sx \&B
593 and
594 .Sx \&R .
595 .Ss \&IB
596 Text is rendered alternately in italics and bold face.
597 Whitespace between arguments is omitted in output.
598 .Pp
599 See
600 .Sx \&BI
601 for an equivalent example.
602 .Pp
603 See also
604 .Sx \&BI ,
605 .Sx \&BR ,
606 .Sx \&RB ,
607 .Sx \&RI ,
608 and
609 .Sx \&IR .
610 .Ss \&IP
611 Begin an indented paragraph with the following syntax:
612 .Bd -filled -offset indent
613 .Pf \. Sx \&IP
614 .Op Cm head Op Cm width
615 .Ed
616 .Pp
617 The
618 .Cm width
619 argument defines the width of the left margin and is defined by
620 .Sx Scaling Widths .
621 It's saved for later paragraph left-margins; if unspecified, the saved or
622 default width is used.
623 .Pp
624 The
625 .Cm head
626 argument is used as a leading term, flushed to the left margin.
627 This is useful for bulleted paragraphs and so on.
628 .Pp
629 See also
630 .Sx \&HP ,
631 .Sx \&LP ,
632 .Sx \&P ,
633 .Sx \&PP ,
634 and
635 .Sx \&TP .
636 .Ss \&IR
637 Text is rendered alternately in italics and roman (the default font).
638 Whitespace between arguments is omitted in output.
639 .Pp
640 See
641 .Sx \&BI
642 for an equivalent example.
643 .Pp
644 See also
645 .Sx \&BI ,
646 .Sx \&IB ,
647 .Sx \&BR ,
648 .Sx \&RB ,
649 and
650 .Sx \&RI .
651 .Ss \&LP
652 Begin an undecorated paragraph.
653 The scope of a paragraph is closed by a subsequent paragraph,
654 sub-section, section, or end of file.
655 The saved paragraph left-margin width is reset to the default.
656 .Pp
657 See also
658 .Sx \&HP ,
659 .Sx \&IP ,
660 .Sx \&P ,
661 .Sx \&PP ,
662 and
663 .Sx \&TP .
664 .Ss \&P
665 Synonym for
666 .Sx \&LP .
667 .Pp
668 See also
669 .Sx \&HP ,
670 .Sx \&IP ,
671 .Sx \&LP ,
672 .Sx \&PP ,
673 and
674 .Sx \&TP .
675 .Ss \&PP
676 Synonym for
677 .Sx \&LP .
678 .Pp
679 See also
680 .Sx \&HP ,
681 .Sx \&IP ,
682 .Sx \&LP ,
683 .Sx \&P ,
684 and
685 .Sx \&TP .
686 .Ss \&R
687 Text is rendered in roman (the default font).
688 .Pp
689 See also
690 .Sx \&I
691 and
692 .Sx \&B .
693 .Ss \&RB
694 Text is rendered alternately in roman (the default font) and bold face.
695 Whitespace between arguments is omitted in output.
696 .Pp
697 See
698 .Sx \&BI
699 for an equivalent example.
700 .Pp
701 See also
702 .Sx \&BI ,
703 .Sx \&IB ,
704 .Sx \&BR ,
705 .Sx \&RI ,
706 and
707 .Sx \&IR .
708 .Ss \&RE
709 Explicitly close out the scope of a prior
710 .Sx \&RS .
711 .Ss \&RI
712 Text is rendered alternately in roman (the default font) and italics.
713 Whitespace between arguments is omitted in output.
714 .Pp
715 See
716 .Sx \&BI
717 for an equivalent example.
718 .Pp
719 See also
720 .Sx \&BI ,
721 .Sx \&IB ,
722 .Sx \&BR ,
723 .Sx \&RB ,
724 and
725 .Sx \&IR .
726 .Ss \&RS
727 Begin a part setting the left margin.
728 The left margin controls the offset, following an initial indentation,
729 to un-indented text such as that of
730 .Sx \&PP .
731 This has the following syntax:
732 .Bd -filled -offset indent
733 .Pf \. Sx \&Rs
734 .Op Cm width
735 .Ed
736 .Pp
737 The
738 .Cm width
739 argument must conform to
740 .Sx Scaling Widths .
741 If not specified, the saved or default width is used.
742 .Ss \&SB
743 Text is rendered in small size (one point smaller than the default font)
744 bold face.
745 .Ss \&SH
746 Begin a section.
747 The scope of a section is only closed by another section or the end of
748 file.
749 The paragraph left-margin width is reset to the default.
750 .Ss \&SM
751 Text is rendered in small size (one point smaller than the default
752 font).
753 .Ss \&SS
754 Begin a sub-section.
755 The scope of a sub-section is closed by a subsequent sub-section,
756 section, or end of file.
757 The paragraph left-margin width is reset to the default.
758 .Ss \&TH
759 Sets the title of the manual page with the following syntax:
760 .Bd -filled -offset indent
761 .Pf \. Sx \&TH
762 .Cm title section
763 .Op Cm date Op Cm source Op Cm volume
764 .Ed
765 .Pp
766 At least the upper-case document
767 .Cm title
768 and the manual
769 .Cm section
770 arguments must be provided.
771 The
772 .Cm date
773 argument should be formatted as described in
774 .Sx Dates ,
775 but will be printed verbatim if it is not.
776 If the date is not specified, the current date is used.
777 The
778 .Cm source
779 string specifies the organisation providing the utility.
780 The
781 .Cm volume
782 string replaces the default rendered volume, which is dictated by the
783 manual section.
784 .Pp
785 Examples:
786 .Pp
787 .Dl \&.TH CVS 5 "1992-02-12" GNU
788 .Ss \&TP
789 Begin a paragraph where the head, if exceeding the indentation width, is
790 followed by a newline; if not, the body follows on the same line after a
791 buffer to the indentation width.
792 Subsequent output lines are indented.
793 The syntax is as follows:
794 .Bd -filled -offset indent
795 .Pf \. Sx \&TP
796 .Op Cm width
797 .Ed
798 .Pp
799 The
800 .Cm width
801 argument must conform to
802 .Sx Scaling Widths .
803 If specified, it's saved for later paragraph left-margins; if
804 unspecified, the saved or default width is used.
805 .Pp
806 See also
807 .Sx \&HP ,
808 .Sx \&IP ,
809 .Sx \&LP ,
810 .Sx \&P ,
811 and
812 .Sx \&PP .
813 .Ss \&UC
814 Sets the volume for the footer for compatibility with man pages from
815 BSD releases.
816 The optional first argument specifies which release it is from.
817 .Ss \&br
818 Breaks the current line.
819 Consecutive invocations have no further effect.
820 .Pp
821 See also
822 .Sx \&sp .
823 .Ss \&fi
824 End literal mode begun by
825 .Sx \&nf .
826 .Ss \&ft
827 Change the current font mode.
828 See
829 .Sx Text Decoration
830 for a listing of available font modes.
831 .Ss \&in
832 Indent relative to the current indentation:
833 .Pp
834 .D1 Pf \. Sx \&in Op Cm width
835 .Pp
836 If
837 .Cm width
838 is signed, the new offset is relative.
839 Otherwise, it is absolute.
840 This value is reset upon the next paragraph, section, or sub-section.
841 .Ss \&na
842 Don't align to the right margin.
843 .Ss \&nf
844 Begin literal mode: all subsequent free-form lines have their end of
845 line boundaries preserved.
846 May be ended by
847 .Sx \&fi .
848 .Ss \&sp
849 Insert vertical spaces into output with the following syntax:
850 .Bd -filled -offset indent
851 .Pf \. Sx \&sp
852 .Op Cm height
853 .Ed
854 .Pp
855 Insert
856 .Cm height
857 spaces, which must conform to
858 .Sx Scaling Widths .
859 If 0, this is equivalent to the
860 .Sx \&br
861 macro.
862 Defaults to 1, if unspecified.
863 .Pp
864 See also
865 .Sx \&br .
866 .Sh COMPATIBILITY
867 This section documents areas of questionable portability between
868 implementations of the
869 .Nm
870 language.
871 .Pp
872 .Bl -dash -compact
873 .It
874 In quoted literals, GNU troff allowed pair-wise double-quotes to produce
875 a standalone double-quote in formatted output.
876 It is not known whether this behaviour is exhibited by other formatters.
877 .It
878 troff suppresses a newline before
879 .Sq \(aq
880 macro output; in mandoc, it is an alias for the standard
881 .Sq \&.
882 control character.
883 .It
884 The
885 .Sq \eh
886 .Pq horizontal position ,
887 .Sq \ev
888 .Pq vertical position ,
889 .Sq \em
890 .Pq text colour ,
891 .Sq \eM
892 .Pq text filling colour ,
893 .Sq \ez
894 .Pq zero-length character ,
895 .Sq \ew
896 .Pq string length ,
897 .Sq \ek
898 .Pq horizontal position marker ,
899 .Sq \eo
900 .Pq text overstrike ,
901 and
902 .Sq \es
903 .Pq text size
904 escape sequences are all discarded in mandoc.
905 .It
906 The
907 .Sq \ef
908 scaling unit is accepted by mandoc, but rendered as the default unit.
909 .It
910 The
911 .Sx \&sp
912 macro does not accept negative values in mandoc.
913 In GNU troff, this would result in strange behaviour.
914 .El
915 .Sh SEE ALSO
916 .Xr man 1 ,
917 .Xr mandoc 1 ,
918 .Xr mandoc_char 7 ,
919 .Xr mdoc 7 ,
920 .Xr roff 7 ,
921 .Xr tbl 7
922 .Sh HISTORY
923 The
924 .Nm
925 language first appeared as a macro package for the roff typesetting
926 system in
927 .At v7 .
928 It was later rewritten by James Clark as a macro package for groff.
929 The stand-alone implementation that is part of the
930 .Xr mandoc 1
931 utility written by Kristaps Dzonsons appeared in
932 .Ox 4.6 .
933 .Sh AUTHORS
934 This
935 .Nm
936 reference was written by
937 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
938 .Sh CAVEATS
939 Do not use this language.
940 Use
941 .Xr mdoc 7 ,
942 instead.