* src/roff/troff/div.cc (save_vertical_space): Add default argument
[s-roff.git] / man / groff.man
blobd69330d02465c9a1d8aa8fbee586c386157477fc
1 .\" st                        -*- nroff -*-
2 .ig
3 groff.7
5 This file is part of groff, the GNU roff type-setting system.
7 Copyright (C) 2000 Free Software Foundation, Inc.
8 written by Bernd Warken <bwarken@mayn.de>
10 Last update: 17 May 2000
12 Permission is granted to copy, distribute and/or modify this document
13 under the terms of the GNU Free Documentation License, Version 1.1 or
14 any later version published by the Free Software Foundation; with the
15 Invariant Sections being this .ig-section and AUTHOR, with no
16 Front-Cover Texts, and with no Back-Cover Texts.
18 A copy of the Free Documentation License is included as a file called
19 FDL in the main directory of the groff source package.
22 .\" --------------------------------------------------------------------
23 .\" Setup
24 .\" --------------------------------------------------------------------
26 .if n \{\
27 .  mso tty-char.tmac
28 .  ftr CR R
29 .  ftr CI I
30 .  ftr CB B
31 .\}
33 .if '\*[.T]'dvi' \{\
34 .  ftr CB CW
35 .\}
37 .\" a comment macro which does nothing
38 .de c
41 .\" a tab string
42 .ds t "\t
44 .eo
46 .c text lines in macro definitions or bracketed sections \{...\}
47 .de text
48 .  if 1 \&\$*\&
51 .de option
52 .  ds @tmp@ \f(CB\$1\fP
53 .  shift 1
54 .  text \*[@tmp@]\$*
55 .  rm @tmp@
58 .als shellcommand option
60 .c --------- characters ---------
62 .de character
63 .  ds @tmp@ \f(CB\$1\fP
64 .  shift
65 .  text \*[@tmp@]\$*
66 .  rm @tmp@
69 .de 'char
70 .  ds @tmp@ \(oq\f(CB\$1\fP\(cq
71 .  shift
72 .  text \*[@tmp@]\$*
73 .  rm @tmp@
76 .de ''char
77 .  ds @tmp@ \(lq\f(CB\$1\fP\(rq
78 .  shift
79 .  text \*[@tmp@]\$*
80 .  rm @tmp@
83 .c --------- requests ---------
85 .c request synopsis
86 .de REQ
87 .  ds @tmp@ \&\$1
88 .  shift 1
89 .  IP "\f(CB\&\*[@tmp@] \fP\f(CI\&\$*\fP" 10n
90 .  rm @tmp@
93 .de request
94 .  ds @tmp@ \f(CB\$1\fP
95 .  shift 1
96 .  text \*[@tmp@]\$*
97 .  rm @tmp@
100 .c --------- macro or function arguments ---------
102 .de argument
103 .  ds @tmp@ \f(CI\$1\fP
104 .  shift 1
105 .  while (\n[.$] >= 2) \{\
106 .    as @tmp@ \/\f(CR\$1\fP\f(CI\,\$2\fP
107 .    shift 2
108 .  \}
109 .  if \n[.$] .as @tmp@ \/\f(CR\$1\fP
110 .  text \*[@tmp@]
111 .  rm @tmp@
114 .c argument followed by a numerical expression
115 .de argterm
116 .  ds @tmp@ \f(CI\$1\fP\|\f(CR\$2\fP
117 .  shift 2
118 .  text \*[@tmp@]\$*
119 .  rm @tmp@
122 .c --------- numerical elements ---------
124 .de number
125 .  ds @tmp@ \f(CR\$1\fP
126 .  shift 1
127 .  text \*[@tmp@]\$*
128 .  rm @tmp@
131 .de prefixednumber
132 .  ds @tmp@ \&\$1\ \f(CR\$2\fP
133 .  shift 2
134 .  text \*[@tmp@]\$*
135 .  rm @tmp@
138 .als scaleindicator request
140 .de scalednumber
141 .  ds @tmp@ \f(CR\$1\fP\f(CB\$2\fP
142 .  shift 2
143 .  text \*[@tmp@]\$*
144 .  rm @tmp@
147 .de operator
148 .  ds @tmp@ \(oq\f(CB\$1\fP\(cq
149 .  shift
150 .  text \*[@tmp@]\$*
151 .  rm @tmp@
154 .c --------- escape sequences ---------
156 .de esc[arg]
157 .  ds @tmp@ \f(CB\(rs\$1[\fP\f(CI\$2\fP\f(CB]\fP
158 .  shift 2
159 .  text \*[@tmp@]\$*
160 .  rm @tmp@
163 .de esc(arg
164 .  ds @tmp@ \f(CB\(rs\$1(\fP\f(CI\$2\fP
165 .  shift 2
166 .  text \*[@tmp@]\$*
167 .  rm @tmp@
170 .de escarg
171 .  ds @tmp@ \f(CB\(rs\$1\fP\f(CI\$2\fP
172 .  shift 2
173 .  text \*[@tmp@]\$*
174 .  rm @tmp@
177 .de esc[]
178 .  ds @tmp@ \f(CB\(rs[\fP\f(CI\$1\fP\f(CB]\fP
179 .  shift
180 .  text \*[@tmp@]\$*
181 .  rm @tmp@
184 .de esc(
185 .  ds @tmp@ \f(CB\(rs(\fP\f(CI\$1\fP
186 .  shift
187 .  text \*[@tmp@]\$*
188 .  rm @tmp@
191 .de esc
192 .  ds @tmp@ \f(CB\(rs\$1\fP
193 .  shift
194 .  text \*[@tmp@]\$*
195 .  rm @tmp@
198 .de (esc
199 .  ds @tmp@ \f(CB\(rs(\$1\fP
200 .  shift
201 .  text \*[@tmp@]\$*
202 .  rm @tmp@
205 .de [esc]
206 .  ds @tmp@ \f(CB\(rs[\$1]\fP
207 .  shift
208 .  text \*[@tmp@]\$*
209 .  rm @tmp@
212 .c escape sequence synopsis
213 .de ESC
214 .  ds @tmp@ \&\$1
215 .  shift 1
216 .  IP "\f(CB\(rs\&\*[@tmp@]\fP\f(CI\&\$*\fP"
217 .  rm @tmp@
220 .c synopsis for escape sequences with a long name
221 .de ESC[]
222 .  ds @arg1@ \&\$1
223 .  ds @arg2@ \&\$2
224 .  shift 2
225 .  IP "\f(CB\(rs\&\*[@arg1@][\fP\f(CI\&\*[@arg2@]\fP\f(CB]\&\$*\fP"
226 .  rm @arg1@
227 .  rm @arg2@
230 .c synopsis escape sequence with quoted argument
231 .  de ESCq
232 .  ds @tmp@ \&\$1
233 .  shift 1
234 .  IP "\f(CB\(rs\&\*[@tmp@]\(cq\fP\f(CI\h'-0.2m'\$*\/\fP\f(CB\(cq\fP"
235 .  rm @tmp@
238 .c synopsis for 2-escapes (special characters)
239 .de ESc
240 .  ds @tmp@ \$1
241 .  TP 14n
242 .  text \f(CB\(rs(\&\*[@tmp@]\ \ \ \fP\fR\(\*[@tmp@]\fP
243 .  shift 1
244 .  text \$*.
245 .  rm @tmp@
248 .c --------- registers ---------
250 .c synopsis for registers
251 .de REG
252 .  TP 10n
253 .  text \&\f(CR\(rsn[\fP\f(CB\$1\fP\f(CR]\fP
254 .  shift 1
255 .if \n[.$] \&\$*
258 .als register request
260 .c --------- warnings ---------
262 .als warning request
264 .c description of warnings
265 .de Warning
266 .  ne (2v + 1)
267 .  TP 12n
268 .  text \f(CB\$1\fP
269 .  text \f(CI\$2\fP
270 .  br
275 .\" --------------------------------------------------------------------
276 .\" Title
277 .\" --------------------------------------------------------------------
279 .TH GROFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
280 .SH NAME
281 groff \- a short reference for the GNU roff language
283 .\" --------------------------------------------------------------------
284 .SH DESCRIPTION
285 .\" --------------------------------------------------------------------
286 .I groff
287 stands for
288 .I GNU roff
289 and is the free implementation of the roff type-setting system.
291 .BR roff (@MAN7EXT@)
292 for a survey and the background of the groff system.
294 This document gives only short descriptions of the predefined roff
295 language elements as used in groff.
296 Both the classical features and the groff extensions are provided.
298 Historically, the
299 .I roff language
300 was called
301 .IR troff .
302 .I groff
303 is compatible with the classical system and provides proper extensions.
304 So in GNU, the terms
305 .IR roff ,
306 .IR troff ,
308 .I groff language
309 could be used as synonyms.
310 However
311 .I troff
312 slightly tends to refer more to the classical aspects, whereas
313 .I groff
314 emphasizes the GNU extensions, and
315 .I roff
316 is the general term for the language.
318 This file is only a short version of the complete documentation that is
319 found in the
320 .I groff
321 .BR info (1)
322 file, which contains more detailed, actual, and concise information.
324 The general syntax for writing groff documents is relatively easy, but
325 writing extensions to the roff language can be a bit harder.
327 The roff language is line-oriented.
328 There are only two kinds of lines, control lines and text lines.
329 The control lines start with a control character, by default a period
330 .''char .
331 or a single quote
332 .''char ' ;
333 all other lines are text lines.
335 .B Control lines
336 represent commands, optionally with arguments.
337 They have the following syntax.
338 The leading control character can be followed by a command name;
339 arguments, if any, are separated by blanks from the command name and
340 among themselves, for example,
343 \&\.command_name arg1 arg2
346 For indentation, any number of space or tab characters can be inserted
347 between the leading control character and the command name, but the control
348 character must be on the first position of the line.
350 .B Text lines
351 represent the parts that will be printed.
352 They can be modified by escape sequences, which are recognized by a
353 leading backslash
354 .'char \(rs .
355 These are in-line or even in-word formatting elements or functions.
356 Some of these take arguments separated by single quotes
357 .''char ' ,
358 others are regulated by a length encoding introduced by an open
359 parenthesis
360 .'char (
361 or enclosed in brackets
362 .'char [
364 .'char ] .
366 The roff language provides flexible instruments for writing language
367 extension, such as macros.
368 When interpreting macro definitions, the roff system enters a special
369 operating mode, called the
370 .BR "copy mode" .
372 The copy mode behavior can be quite tricky, but there are some rules
373 that ensure a safe usage.
374 .IP 1.
375 Printable backslashes must be denoted as
376 .esc e .
377 To be more precise,
378 .esc e
379 represents the current escape character.
380 To get a backslash glyph, use
381 .esc (rs .
382 .IP 2.
383 Double all backslashes.
384 .IP 3.
385 Begin all text lines with the special non-spacing character
386 .esc & .
388 This does not produce the most efficient code, but it should work as a
389 first measure.
390 For better strategies, see the groff info file and
391 .BR groff_tmac (@MAN5EXT@).
393 Reading roff source files is easier, just reduce all double backslashes
394 to a single one in all macro definitions.
396 .\" --------------------------------------------------------------------
397 .SH "GROFF ELEMENTS"
398 .\" --------------------------------------------------------------------
399 The roff language elements add formatting information to a text file.
400 The fundamental elements are predefined commands and variables that make
401 roff a full-blown programming language.
403 There are two kinds of roff commands, possibly with arguments.
404 .B Requests
405 are written on a line of their own starting with a dot
406 .'char .
407 or a
408 .''char ' ,
409 whereas
410 .B Escape sequences
411 are in-line functions and in-word formatting elements starting with a
412 backslash
413 .'char \(rs .
415 The user can define her own formatting commands using the
416 .request .de
417 request.  These commands are called
418 .BR macros ,
419 but they are used exactly like requests.  Macro packages are pre-defined 
420 sets of macros written in the groff language.
421 A user's possibilities to create escape sequences herself is very
422 limited, only special characters can be mapped.
424 The groff language provides several kinds of variables with
425 different interfaces.
426 There are pre-defined variables, but the user can define her own
427 variables as well.
429 .B String
430 variables store character sequences.
431 They are set with the
432 .request .ds
433 request and retrieved by the
434 .esc *
435 escape sequences.
437 .B Register
438 variables can store numerical values, numbers with a scale unit, and
439 occasionally string-like objects.
440 They are set with the
441 .request .nr
442 request and retrieved by the
443 .esc n
444 escape sequences.
446 .B Environments
447 allow the user to temporarily store global formatting parameters like
448 line length, font size, etc. for later reuse.
449 This is done by the
450 .request .ev
451 request.
453 .B Fonts
454 are identified either by a name or by an internal number.
455 The current font is chosen by the
456 .request .ft
457 request or by the
458 .esc f
459 escape sequences.
460 Each device has special fonts, but the following fonts are available for 
461 all devices.
462 .B R
463 is the standard font Roman.
464 .B B
465 is its
466 .B bold
467 counterpart.
469 .I italic
470 font is called
471 .B I
472 is everywhere available, but on text devices, it is displayed as an
473 underlined Roman font.
474 For the graphical output devices, there exist constant-width pendants of
475 these font,
476 .BR CR ,
477 .BR CI ,
479 .BR CB .
480 On text devices, all characters have a constant width anyway.
482 Moreover, there are some advanced roff elements.
484 .B diversion
485 stores information into a macro for later usage.
487 .B trap
488 is a positional condition like a certain number of lines from page top
489 or in a diversion or in the input.
490 Some action can be prescribed to be run automatically when the condition
491 is met.
493 More detailed information can be found in the groff info file.
495 .\" --------------------------------------------------------------------
496 .SH "CONTROL CHARACTERS"
497 .\" --------------------------------------------------------------------
498 There is a small set of characters that have a special controlling task
499 in certain conditions.
501 .character .
502 A dot is only special at the beginning of a line or after the
503 condition in the requests
504 .request .if ,
505 .request .ie ,
506 .request .el ,
508 .request .while .
509 There it is the control character that introduces a request (or macro).
510 The special behavior can be delayed by using the
511 .esc .
512 escape.
513 By using the 
514 .request .cc
515 request, the control character can be set to a different character,
516 making the dot
517 .'char .
518 a non-special character.
519 .IP ""
520 In all other positions, it just means a dot character.
521 In text paragraphs, it is advantageous to start each sentence at a line
522 of its own.
524 .character '
525 The single quote has two controlling tasks.  At the beginning of a line
526 and in the conditional requests it is the non-breaking control
527 character.
528 That means that it introduces a request like the dot, but with the
529 additional property that this request doesn't cause a linebreak.
530 By using the 
531 .request .c2
532 request, the non-break control character can be set to a different
533 character.
534 .IP ""
535 As a second task, it is the most commonly used argument separator in
536 some functional escape sequences (but any pair of characters not part
537 of the argument will work).
538 In all other positions, it denotes the single quote or apostrophe
539 character.
540 Groff provides a printable representation with the
541 .esc (cq
542 escape sequence.
544 .character \(dq
545 The double quote is used to enclose arguments in requests and macros.  In
547 .request .ds
549 .request .as
550 requests, a leading double quote in the argument will be stripped off,
551 making everything else afterwards the string to be defined (enabling leading
552 whitespace).
553 The escaped double quote
554 .esc \(dq
555 introduces a comment.
556 Otherwise, it is not special.
557 Groff provides a printable representation with the
558 .esc (dq
559 escape sequence.
561 .character \(rs
562 The backslash usually introduces an escape sequence (this can be
563 changed with the
564 .request ec
565 request).
566 A printed version of the escape character is the
567 .esc e
568 escape; a backslash glyph can be obtained by
569 .esc (rs .
571 .character (
572 The open parenthesis is only special in escape sequences when
573 introducing an escape name or argument consisting of exactly two
574 characters.
575 In groff, this behavior can be replaced by the \f(CB[]\fP construct.
577 .character [
578 The opening bracket is only special in groff escape sequences; there it
579 is used to introduce a long escape name or long escape argument.
580 Otherwise, it is non-special, e.g. in macro calls.
582 .character ]
583 The closing bracket is only special in groff escape sequences; there it
584 terminates a long escape name or long escape argument.
585 Otherwise, it is non-special.
587 \f(CIspace\fP
588 Space characters are only functional characters.  They separate the
589 arguments in requests or macros, and the words in text lines.
590 They are subject to groff's horizontal spacing calculations.
591 To get a defined space width, escape sequences like
592 .'char "\(rs\ "
593 (this is the escape character followed by a space),
594 .esc | ,
595 .esc ^ ,
597 .esc h
598 should be used.
599 .IP \f(CInewline\fP
600 In text paragraphs, newlines mostly behave like space characters.
601 Continuation lines can be specified by an escaped newline, i.e., by
602 specifying a backslash
603 .'char \(rs
604 as the last character of a line.
605 .IP \f(CItab\fP
606 If a tab character occurs during text the interpreter makes a horizontal 
607 jump to the next pre-defined tab position.
608 There is a sophisticated interface for handling tab positions.
610 .\" --------------------------------------------------------------------
611 .SH "NUMERICAL EXPRESSIONS"
612 .\" --------------------------------------------------------------------
614 .B numerical value
615 is a signed or unsigned integer or float with or without an appended
616 scale indicator.
618 .B scale indicator
619 is a one-character abbreviation for a unit of measurement.
620 A number followed by a scale indicator signifies a size value.
621 By default, numerical values do not have a scale indicator, i.e., they are
622 normal numbers.
624 The roff language defines the following scale indicators.
629 center, tab(@);
630 LfCB Lw(4i).
631 c@Centimeter
632 i@Inch
633 P@Pica\ \(eq\ 1/6\ inch
634 p@Point\ \(eq\ 1/72\ inch
635 m@T{
636 Em\ \(eq\ \fRthe font size in points (width of letter `\f(CRm\fR')
638 M@100th \fRof an \f(CREm
639 n@En\ \(eq\ Em/2
640 u@\fRBasic unit for actual output device
641 v@\fRVertical line space in basic units
642 z@T{
643 scaled point\ \(eq\ 1/\f(CIsizescale\fR of a point (defined in
644 font \fIDESC\fP file)
650 .B Numerical expressions
651 are combinations of the numerical values defined above with
652 the arithmetical operators
653 .operator + ,
654 .operator \- ,
655 .operator * ,
656 .operator / ,
657 .operator %
658 .RI ( modulo ),
659 the comparative operators
660 .operator ==
661 (this is the same as
662 .operator = ),
663 .operator <= ,
664 .operator >= ,
665 .operator < ,
666 .operator > ,
667 the logical operators
668 .operator &
669 .RI ( and ),
670 .operator :
671 .RI ( or ),
672 .operator !
673 .RI ( not ),
674 and the parentheses
675 .operator (
677 .operator ) .
679 Moreover,
680 .I groff
681 added the following operators for numerical expressions:
686 center, tab(@);
687 LfCB Lw(4i).
688 e1\f(CB>?\fPe2@The maximum of \f(CIe1\fP and \f(CIe2\fP.
689 e1\f(CB<?\fPe2@The minimum of \f(CIe1\fP and \f(CIe2\fP.
690 \f(CB(\fPc\f(CB;\fPe\f(CB)@T{
691 Evaluate \f(CIe\fP using \f(CIc\fP as the default scaling
692 indicator.
698 For details see the groff info file.
700 .\" --------------------------------------------------------------------
701 .SH CONDITIONS
702 .\" --------------------------------------------------------------------
703 .B Conditions
704 occur in tests raised by the
705 .request .if ,
706 .request .ie ,
707 and the
708 .request .while
709 requests.
710 The following table characterizes the different types of conditions.
715 center, tab(@);
716 LfCB Lw(4i).
717 \f(CIN\fP@T{
718 A numerical expression \f(CIN\fP yields true if its value
719 is\ \f(CR>0\fP.
721 !\f(CIN\fP@T{
722 True if the value of \f(CIN\fP is\ \f(CR\(<=0\fP.
724 \&'\f(CIs1\fP'\f(CIs2\fP'@T{
725 True if string\ \f(CIs1\fP is identical to string\ \f(CIs2\fP.
727 !'\f(CIs1\fP'\f(CIs2\fP'@T{
728 True if string\ \f(CIs1\fP is not identical to string\ \f(CIs2\fP.
730 c\f(CIch@T{
731 True if there is a character\ \f(CIch\fP available.
733 d\f(CIname@T{
734 True if there is a string, macro, diversion, or request
735 called \f(CIname\fP.
737 e@Current page number is even.
738 o@Current page number is odd.
739 n@Formatter is \fBnroff\fP.
740 r\f(CIreg@T{
741 True if there is a register named \f(CIreg\fP.
743 t@Formatter is \fBtroff\fR.
749 .\" --------------------------------------------------------------------
750 .SH REQUESTS
751 .\" --------------------------------------------------------------------
752 This section provides a short reference for the predefined requests.
753 In groff, request and macro names can be arbitrarily long.
754 No bracketing or marking of long names is needed.
756 Most requests take one or more arguments.
757 The arguments are separated by space characters (no tabs!); there is no
758 inherent limit for their length or number.
759 An argument can be enclosed by a pair of double quotes: This is very handy
760 if an argument contains space characters, e.g.,
761 .argument "\(dqarg\ with\ space\(dq"
762 denotes a single argument.
764 Some requests have optional arguments with a different behaviour.
765 Not all of these details are outlined here.
766 Refer to the groff info file for all details.
768 In the following request specifications, most argument names were chosen
769 to be descriptive.
770 Only the following denotations need clarification.
775 center, tab(@);
776 LfCI Lw(4i).
777 c@denotes a single character.
778 font@T{
779 a font either specified as a font name or a font number.
781 anything@T{
782 all characters up to the end of the line or within \f(CB\(rs{\fP
783 and \f(CB\(rs}\fP.
785 n@T{
786 is a numerical expression that evaluates to an integer value.
788 N@T{
789 is an arbitrary numerical expression, signed or unsigned.
791 \(+-N@T{
792 has three meanings depending on its sign, described below.
798 If an expression defined as
799 .argument \(+-N
800 starts with a
801 .operator +
802 sign the resulting value of the expression will be added to an already
803 existing value inherent to the related request, e.g. adding to a number
804 register.
805 If the expression starts with a
806 .operator -
807 the value of the expression will be subtracted from the request value.
809 Without a sign,
810 .argument N
811 replaces the existing value directly.
812 To assign a negative number either prepend\ \c
813 .number 0
814 or enclose the negative number in parentheses.
816 .\" --------------------------------------------------------------------
817 .SS "REQUEST SHORT REFERENCE"
818 .\" --------------------------------------------------------------------
819 .PD 0
821 .REQ .
822 Empty line, ignored.  Useful for structuring documents.
824 .REQ .\(rs\(dq anything
825 Complete line is a comment.
827 .REQ .ab string
828 Print
829 .argument string
830 on standard error, exit program.
832 .REQ .ad
833 Begin line adjustment for output lines in current adjust mode.
835 .REQ .ad c
836 Start line adjustment in mode
837 .argument c
838 (\f(CIc\fP\f(CR\|\^\(eq\|l,r,b,n\fP).
840 .REQ .af register c
841 Assign format
842 .argument c
844 .argument register
845 (\f(CIc\fP\f(CR\|\^\(eq\|l,i,I,a,A\fP).
847 .REQ .aln alias register
848 Create alias name for
849 .argument register .
851 .REQ .als alias object
852 Create alias name for request, string, macro, or diversion
853 .argument object .
855 .REQ .am macro
856 Append to
857 .argument macro
858 until
859 .request ..
860 is called.
862 .REQ .am macro end
863 Append to
864 .argument macro
865 until
866 .request .end
867 is called.
869 .REQ .as stringvar anything
870 Append
871 .argument anything
873 .argument stringvar .
875 .REQ .asciify diversion
876 Unformat ASCII characters, spaces, and some escape sequences in
877 .argument diversion .
879 .REQ .backtrace
880 Print a backtrace of the input on stderr.
882 .REQ .bd font N
883 Embolden
884 .argument font
886 .argterm N -1
887 units.
889 .REQ .bd S font N
890 Embolden Special Font
891 .argument S
892 when current font is
893 .argument font .
895 .REQ .box
896 End current diversion.
898 .REQ .box macro
899 Divert to
900 .argument macro ,
901 omitting a partially filled line.
903 .REQ .boxa
904 End current diversion.
906 .REQ .boxa macro
907 Divert and append to
908 .argument macro ,
909 omitting a partially filled line.
910 .REQ .bp
911 Eject current page and begin new page.
913 .REQ .bp \(+-N
914 Eject current page; next page number
915 .argument \(+-N .
917 .REQ .blm macro
918 Set the blank line macro to
919 .argument macro .
921 .REQ .br
922 Line break.
924 .REQ .break
925 Break out of a while loop.
927 .REQ .c2
928 Reset no-break control character to
929 .''char ' .
931 .REQ .c2 c
932 Set no-break control character to
933 .argument c .
935 .REQ .cc
936 Reset control character to
937 .'char . .
939 .REQ .cc c
940 Set control character to
941 .argument c .
943 .REQ .ce
944 Center the next input line.
946 .REQ .ce N
947 Center following
948 .argument N
949 input lines.
951 .REQ .cf filename
952 Copy contents of file
953 .argument filename
954 unprocessed to stdout or to the diversion.
956 .REQ .cflags mode c1 c2 ...
957 Treat characters
958 .argument c1 ,
959 .argument c2 ,
960 .argument ...
961 according to
962 .argument mode
963 number.
965 .REQ .ch trap N
966 Change
967 .argument trap
968 location
970 .argument N .
972 .REQ .char c anything
973 Define character
974 .argument c
975 to string
976 .argument anything .
978 .REQ .chop object
979 Chop the last character off macro, string, or diversion
980 .argument object .
982 .REQ .close stream
983 Close the
984 .argument stream .
986 .REQ .continue
987 Finish the current iteration of a while loop.
989 .REQ .cp
990 Enable compatibility mode.
992 .REQ .cp N
994 .I N
995 is zero disable compatibility mode, otherwise enable it.
997 .REQ .cs font N M
998 Set constant character width mode for
999 .argument font
1001 .argterm N /36
1002 ems with em
1003 .argument M .
1005 .REQ .cu N
1006 Continuous underline in nroff, like
1007 .request .ul
1008 in troff.
1010 .REQ .da
1011 End current diversion.
1013 .REQ .da macro
1014 Divert and append to
1015 .argument macro .
1017 .REQ .de macro
1018 Define or redefine
1019 .argument macro
1020 until
1021 .request ..
1022 is called.
1024 .REQ .de macro end
1025 Define or redefine
1026 .argument macro
1027 until
1028 .request .end
1029 is called.
1031 .REQ .dei macro
1032 Define or redefine a macro whose name is contained in the string register
1033 .argument macro
1034 until
1035 .request ..
1036 is called.
1038 .REQ .dei macro end
1039 Define or redefine a macro indirectly.
1040 .argument macro
1042 .argument end
1043 are string registers whose contents are interpolated for the macro name
1044 and the end macro, respectively.
1046 .REQ .di
1047 End current diversion.
1049 .REQ .di macro
1050 Divert to
1051 .argument macro .
1053 .REQ .do name
1054 Interpret
1055 .request .name
1056 with compatibility mode enabled.
1058 .REQ .ds stringvar anything
1060 .argument stringvar
1062 .argument anything .
1064 .REQ .dt N trap
1065 Set diversion trap to position
1066 .argument N
1067 (default scale indicator\ \c
1068 .scaleindicator v ).
1070 .REQ .ec
1071 Reset escape character to
1072 .'char \(rs .
1074 .REQ .ec c
1075 Set escape character to
1076 .argument c .
1078 .REQ .ecr
1079 Restore escape character saved with
1080 .request .ecs .
1082 .REQ .ecs
1083 Save current escape character.
1085 .REQ .el anything
1086 Else part for if-else (\c
1087 .argument .ie )
1088 request.
1090 .REQ .em macro
1092 .argument macro
1093 will be run after the end of input.
1095 .REQ .eo
1096 Turn off escape character mechanism.
1098 .REQ .ev
1099 Switch to previous environment.
1101 .REQ .ev env
1102 Push down environment number or name
1103 .argument env
1104 and switch to it.
1106 .REQ .evc env
1107 Copy the contents of environment
1108 .argument env
1109 to the current environment.
1110 No pushing or popping.
1112 .REQ .ex
1113 Exit from roff processing.
1115 .REQ .fam
1116 Return to previous font family.
1118 .REQ .fam name
1119 Set the current font family to
1120 .argument name .
1122 .REQ .fc
1123 Disable field mechanism.
1125 .REQ .fc a
1126 Set field delimiter to
1127 .argument a
1128 and pad character to space.
1129 .REQ .fc a b
1130 Set field delimiter to
1131 .argument a
1132 and pad character to
1133 .argument b .
1135 .REQ .fi
1136 Fill output lines.
1138 .REQ .fl
1139 Flush output buffer.
1141 .REQ .fp n font
1142 Mount
1143 .argument font
1144 on position
1145 .argument n .
1147 .REQ .fp n internal external
1148 Mount font with long
1149 .argument external
1150 name to short
1151 .argument internal
1152 name on position
1153 .argument n .
1155 .REQ .fspecial font s1 s2...
1156 When the current font is
1157 .argument font ,
1158 then the fonts
1159 .argument s1 ,
1160 .argument s2 ,
1161 .argument ...
1162 will be special.
1164 .REQ .ft
1165 Return to previous font.
1166 Same as
1167 .request \(rsfP .
1168 .REQ .ft font
1169 Change to font name or number
1170 .argument font ;
1171 same as
1172 .esc[arg] f font
1173 escape sequence.
1175 .REQ .ftr font1 font2
1176 Translate
1177 .argument font1
1179 .argument font2 .
1181 .REQ .hc
1182 Remove additional hyphenation indicator character.
1184 .REQ .hc c
1185 Set up additional hyphenation indicator character\ \c
1186 .argument c .
1188 .REQ .hcode c1 code1 c2 code2 ...
1189 Set the hyphenation code of character
1190 .argument c1
1192 .argument code1 ,
1193 that of
1194 .argument c2
1196 .argument code2 ,
1197 etc.
1199 .REQ .hla lang
1200 Set the current hyphenation language to
1201 .argument lang .
1203 .REQ .hlm n
1204 Set the maximum number of consecutive hyphenated lines to
1205 .argument n .
1207 .REQ .hpf file
1208 Read hyphenation patterns from
1209 .argument file .
1211 .REQ .hw words
1212 List of
1213 .argument words
1214 with exceptional hyphenation.
1216 .REQ .hy N
1217 Switch to hyphenation mode
1218 .argument N .
1220 .REQ .hym n
1221 Set the hyphenation margin to
1222 .argument n
1223 (default scale indicator\ \c
1224 .scaleindicator m ).
1226 .REQ .hys n
1227 Set the hyphenation space to
1228 .argument n .
1230 .REQ .ie cond anything
1232 .argument cond
1233 then
1234 .argument anything
1235 else goto
1236 .request .el .
1238 .REQ .if cond anything
1240 .argument cond
1241 then
1242 .argument anything ;
1243 otherwise do nothing.
1245 .REQ .ig
1246 Ignore text until
1247 .request ..
1248 is called.
1250 .REQ .ig end
1251 Ignore text until
1252 .request .end .
1254 .REQ .in
1255 Change to previous indent value.
1257 .REQ .in \(+-N
1258 Change indent according to
1259 .argument \(+-N
1260 (default scale indicator\ \c
1261 .scaleindicator m ).
1263 .REQ .it N trap
1264 Set an input-line count trap at position
1265 .argument N .
1267 .REQ .kern
1268 Enable pairwise kerning.
1270 .REQ .kern n
1272 .argument n
1273 is zero, disable pairwise kerning, otherwise enable it.
1275 .REQ .lc
1276 Remove leader repetition character.
1278 .REQ .lc c
1279 Set leader repetition character to\ \c
1280 .argument c .
1282 .REQ .length register anything
1283 Write the length of the string
1284 .argument anything
1286 .argument register .
1288 .REQ .linetabs
1289 Enable line-tabs mode (i.e., calculate tab positions relative to output
1290 line).
1292 .REQ .linetabs n
1294 .argument n
1295 is zero, disable line-tabs mode, otherwise enable it.
1297 .REQ .lf N file
1298 Set input line number to
1299 .argument N
1300 and filename to
1301 .argument file .
1303 .REQ .lg N
1304 Ligature mode on if
1305 .argterm N >0 .
1307 .REQ .ll
1308 Change to previous line length.
1310 .REQ .ll \(+-N
1311 Set line length according to
1312 .argument \(+-N
1313 (default size
1314 .scalednumber 6.5 i ,
1315 default scale indicator\ \c
1316 .scaleindicator m ).
1318 .REQ .ls
1319 Change to the previous value of additional intra-line skip.
1321 .REQ .ls N
1322 Set additional intra-line skip value to
1323 .argument N ,
1324 i.e.,
1325 .argterm N -1
1326 blank lines are inserted after each text output line.
1328 .REQ .lt \(+-N
1329 Length of title (default scale indicator\ \c
1330 .scaleindicator m ).
1332 .REQ .mc
1333 Margin character off.
1335 .REQ .mc c
1336 Print character
1337 .argument c
1338 after each text line at actual distance from right margin.
1340 .REQ .mc c N
1341 Set margin character to
1342 .argument c
1343 and distance to
1344 .argument N
1345 from right margin (default scale indicator\ \c
1346 .scaleindicator m ).
1348 .REQ .mk register
1349 Mark current vertical position in
1350 .argument register .
1352 .REQ .mso file
1353 The same as the .so request except that
1354 .I file
1355 is searched in the tmac directories.
1357 .REQ .na
1358 No output-line adjusting.
1360 .REQ .ne
1361 Need a one-line vertical space.
1363 .REQ .ne N
1364 Need
1365 .argument N
1366 vertical space (default scale indicator\ \c
1367 .scaleindicator v ).
1369 .REQ .nf
1370 No filling or adjusting of output-lines.
1372 .REQ .nh
1373 No hyphenation.
1375 .REQ .nm
1376 Number mode off.
1378 .REQ .nm \(+-N M S I
1379 In line number mode, set number, multiple, spacing, and indent.
1381 .REQ .nn
1382 Do not number next line.
1384 .REQ .nn N
1385 Do not number next
1386 .argument N
1387 lines.
1389 .REQ .nop anything
1390 Always execute
1391 .argument anything .
1393 .REQ .nr register \(+-N M
1394 Define or modify
1395 .argument register
1396 using
1397 .argument \(+-N
1398 with auto-increment
1399 .argument M .
1401 .REQ .nroff
1402 Make the built-in condition
1403 .B n
1404 true and
1405 .B t
1406 false.
1408 .REQ .ns
1409 Turn no-space mode on.
1411 .REQ .nx filename
1412 Next file.
1414 .REQ .open stream filename
1415 Open
1416 .register filename
1417 for writing and associate the stream named
1418 .register stream
1419 with it.
1421 .REQ .opena stream filename
1422 Like
1423 .request .open
1424 but append to it.
1426 .REQ .os
1427 Output vertical distance that was saved by the
1428 .request .sv
1429 request.
1431 .REQ .pc
1432 Reset page number character to\ \c
1433 .'char % .
1435 .REQ .pc c
1436 Page number character.
1438 .REQ .pi program
1439 Pipe output to
1440 .argument program
1441 (nroff only).
1443 .REQ .pl
1444 Set page length to default
1445 .scalednumber 11 i .
1446 The current page length is stored in
1447 .register .p .
1449 .REQ .pl \(+-N
1450 Change page length to
1451 .argument \(+-N
1452 (default scale indicator\ \c
1453 .scaleindicator v ).
1455 .REQ .pm
1456 Print macro names and sizes (number of blocks of 128 bytes).
1458 .REQ ".pm t"
1459 Print only total of sizes of macros (number of 128 bytes blocks).
1461 .REQ .pn \(+-N
1462 Next page number
1463 .argument N .
1465 .REQ .pnr
1466 Print the names and contents of all currently defined number registers
1467 on stderr.
1469 .REQ .po
1470 Change to previous page offset.  The current page offset is available in
1471 .register .o .
1473 .REQ .po \(+-N
1474 Page offset
1475 .argument N .
1477 .REQ .ps
1478 Return to previous point-size.
1479 .REQ .ps \(+-N
1480 Point size; same as
1481 .esc[arg] s \(+-N .
1483 .REQ .psbb filename
1484 Get the bounding box of a PostScript image
1485 .argument filename .
1487 .REQ .pso command
1488 This behaves like the
1489 .request .so
1490 request except that input comes from the standard output of
1491 .argument command .
1493 .REQ .ptr
1494 Print the names and positions of all traps (not including input line
1495 traps and diversion traps) on stderr.
1497 .REQ .rchar c1 c2...
1498 Remove the definitions of characters
1499 .argument c1 ,
1500 .argument c2 ,
1501 .argument ...
1503 .REQ .rd prompt
1504 Read insertion.
1506 .REQ .return
1507 Return from a macro.
1509 .REQ .rj n
1510 Right justify the next
1511 .argument n
1512 input lines.
1514 .REQ .rm name
1515 Remove request, macro, or string
1516 .argument name .
1518 .REQ .rn old new
1519 Rename request, macro, or string
1520 .argument old
1522 .argument new .
1524 .REQ .rnn reg1 reg2
1525 Rename register
1526 .argument reg1
1528 .argument reg2 .
1530 .REQ .rr register
1531 Remove
1532 .argument register .
1534 .REQ .rs
1535 Restore spacing; turn no-space mode off.
1537 .REQ .rt \(+-N
1538 Return
1539 .I (upward only)
1540 to marked vertical place (default scale indicator\ \c
1541 .scaleindicator v ).
1543 .REQ .shc
1544 Reset soft hyphen character to
1545 .esc (hy .
1547 .REQ .shc c
1548 Set the soft hyphen character to
1549 .argument c .
1551 .REQ .shift n
1552 In a macro, shift the arguments by
1553 .argument n \ \c
1554 positions.
1556 .REQ .so filename
1557 Include source file.
1559 .REQ .sp
1560 Skip one line vertically.
1562 .REQ .sp N
1563 Space vertical distance
1564 .argument N
1565 up or down according to sign of
1566 .argument N
1567 (default scaling indicator\ \c
1568 .scaleindicator v ).
1570 .REQ .special s1 s2 ...
1571 Fonts
1572 .argument s1 ,
1573 .argument s2 ,
1574 etc. are special and will be searched for characters not in the current font.
1576 .REQ .ss N
1577 Space-character size set to
1578 .argument N /12
1579 of the spacewidth in the current font.
1581 .REQ .ss N M
1582 Space-character size set to
1583 .argterm N /12
1584 and sentence space size set to
1585 .argterm M /12
1586 of the spacewidth in the current font (\f(CR\(eq1/3 em\fP).
1588 .REQ .sty n style
1589 Associate
1590 .argument style
1591 with font position
1592 .argument n .
1594 .REQ .substring register n1 n2
1595 Replace the string in
1596 .argument register
1597 with the substring defined by the indices
1598 .argument n1
1600 .argument n2 .
1602 .REQ .sv
1603 Save
1604 .scalednumber 1 v
1605 of vertical space.
1607 .REQ .sv N
1608 Save the vertical distance
1609 .argument N
1610 for later output with
1611 .request .os
1612 request.
1614 .REQ .sy command-line
1615 Execute program
1616 .argument command-line .
1618 .REQ ".ta T" N
1619 Set tabs after every position that is a multiple of
1620 .argument N
1621 (default scaling indicator\ \c
1622 .scaleindicator m ).
1623 .REQ .ta n1 n2 ... nn \f(CBT\fP r1 r2 ... rn
1624 Set tabs at positions
1625 .argument n1 ,
1626 .argument n2 ,
1627 \&...,
1628 .argument nn ,
1629 then set tabs at
1630 .argument nn + r1 ,
1631 .argument nn + r2 ,
1632 \&...,
1633 .argument nn + rn ,
1634 then at
1635 .argument nn + rn + r1 ,
1636 .argument nn + rn + r2 ,
1637 \&...,
1638 .argument nn + rn + rn ,
1639 and so on.
1641 .\".REQ .tar
1642 .\"Restore internally saved tab positions.
1643 .\".
1644 .\".REQ .tas
1645 .\"Save tab positions internally.
1647 .REQ .tc
1648 Remove tab repition character.
1649 .REQ .tc c
1650 Set tab repetition character to\ \c
1651 .argument c .
1653 .REQ .ti \(+-N
1654 Temporary indent next line (default scaling indicator\ \c
1655 .scaleindicator m ).
1657 .REQ .tkf font s1 n1 s2 n2
1658 Enable track kerning for
1659 .argument font .
1661 .REQ .tl \f(CB\(cq\fPleft\f(CB\(cq\fPcenter\f(CB\(cq\fPright\f(CB\(cq\fP
1662 Three-part title.
1664 .REQ .tm anything
1665 Print
1666 .argument anything
1667 on terminal (UNIX standard message output).
1669 .REQ .tm1 anything
1670 Print
1671 .argument anything
1672 on terminal (UNIX standard message output), allowing leading whitespace if
1673 .argument anything
1674 starts with
1675 .character \(dq
1676 (which will be stripped off).
1678 .REQ .tmc anything
1679 Similar to
1680 .request .tm1
1681 without emitting a final newline.
1683 .REQ .tr abcd....
1684 Translate
1685 .argument a
1687 .argument b ,
1688 .argument c
1690 .argument d ,
1691 etc. on output.
1693 .REQ .trf filename
1694 Transparently output the contents of file
1695 .argument filename .
1697 .REQ .trnt abcd....
1698 This is the same as the
1699 .request .tr
1700 request except that the translations do not apply to text that is
1701 transparently throughput into a diversion with
1702 .esc ! .
1704 .REQ .troff
1705 Make the built-in condition
1706 .B t
1707 true and
1708 .B n
1709 false.
1711 .REQ .uf font
1712 Underline font set to
1713 .argument font
1714 (to be switched to by
1715 .request .ul ).
1717 .REQ .ul N
1718 Underline (italicize in troff)
1719 .argument N
1720 input lines.
1722 .REQ .unformat diversion
1723 Unformat space characters and tabs, preserving font information in
1724 .argument diversion .
1725 .REQ .vpt n
1726 Enable vertical position traps if
1727 .argument n
1728 is non-zero, disable them otherwise.
1730 .REQ .vs
1731 Change to previous vertical base line spacing.
1733 .REQ .vs N
1734 Set vertical base line spacing to
1735 .argument N .
1736 Default value is
1737 .scalednumber 12 p .
1739 .REQ .warn n
1740 Set warnings code to
1741 .argument n .
1743 .REQ .wh N trap
1744 Set location trap; negative means from page bottom.
1746 .REQ .while cond anything
1747 While condition
1748 .argument cond
1749 is true, accept
1750 .argument anything
1751 as input.
1753 .REQ .write stream anything
1754 Write
1755 .argument anything
1756 to the stream named
1757 .argument stream .
1761 Besides these standard groff requests, there might be further macro
1762 calls.
1763 They can originate from a macro package (see
1764 .BR roff (@MAN7EXT@)
1765 for an overview) or from a preprocessor.
1767 Preprocessor macros are easy to be recognized.  They enclose their code
1768 into a pair of characteristic macros.
1771 box, center, tab (@);
1772 c | c | c
1773 CfCB | CfCB | CfCB.
1774 preprocessor@start macro@ end macro
1776 eqn@.PS@.PE
1777 grap@.G1@.G2
1778 grn@.GS@.GE
1779 pic@.PS@.PE
1780 refer@.R1@.R2
1781 soelim@\fInone@\fInone
1782 tbl@.TS@.TE
1786 .\" --------------------------------------------------------------------
1787 .SH "ESCAPE SEQUENCES"
1788 .\" --------------------------------------------------------------------
1790 Escape sequences are in-line language elements usually introduced by
1791 a backslash
1792 .'char \(rs
1793 and followed by an escape name and sometimes by a required argument.
1794 Input processing is continued directly after the escaped character or
1795 the argument resp. without an intervening separation character.
1796 So there must be a way to determine the end of the escape name and the end
1797 of the argument.
1799 This is done by enclosing names (escape name and arguments consisting of
1800 a variable name) by a pair of brackets
1801 .esc[] name
1802 and constant arguments (number expressions and characters) by apostrophes
1803 (ASCII 0x27) like
1804 .IR \(cqconstant\(cq .
1806 There are abbreviations for short names.
1807 Two character escape names can be specified by an opening parenthesis like
1808 .esc( xy
1809 without a closing counterpart.
1810 And all one-character names different from the special characters
1811 .'char [
1813 .'char (
1814 can even be specified without a marker in the form
1815 .esc \fP\f(CIc .
1817 Constant arguments of length
1818 .number 1
1819 can omit the marker apostrophes, too, but there is no two-character
1820 analogue.
1822 While 1-character escape sequences are mainly used for in-line functions
1823 and system related tasks, the 2-letter names following the
1824 .esc( ""
1825 construct are used for special characters predefined by the roff system.
1826 Names with more than two characters
1827 .esc[] name
1828 mostly denote user defined named characters (see the
1829 .request .char
1830 request).
1832 .\" --------------------------------------------------------------------
1833 .SS "SINGLE CHARACTER ESCAPES"
1834 .\" --------------------------------------------------------------------
1836 .PD 0
1838 .\" --------- comments ---------
1840 .ESC \(dq
1841 Beginning of a comment.
1842 Everything up to the end of the line is ignored.
1844 .ESC #
1845 Everything up to and including the next newline is ignored.
1846 This is interpreted in copy mode.
1847 This is like
1848 .esc \(dq
1849 except the ignoring of the terminating newline.
1851 .\" --------- strings ---------
1853 .ESC * s
1854 The string stored in the string variable with 1-character name
1855 .argument s .
1857 .ESC *( st
1858 The string stored in the string variable with 2-character name
1859 .argument st .
1861 .ESC[] * stringvar
1862 The string stored in the string variable with arbitrary length name
1863 .argument stringvar .
1865 .\" --------- macro arguments ---------
1867 .ESC $0
1868 The name by which the current macro was invoked.  The
1869 .request .als
1870 request can make a macro have more than one name.
1872 .ESC $ x
1873 Macro argument with 1-place number
1874 .argument x ,
1875 where
1876 .argument x
1877 is a digit between 1 and 9.
1879 .ESC $( xy
1880 Macro argument with 2-digit number
1881 .argument xy .
1883 .ESC[] $ nexp
1884 Macro argument with number
1885 .argument nexp ,
1886 where
1887 .argument nexp
1888 is a numerical expression evaluating to an integer \(>=1.
1890 .ESC $*
1891 In a macro, the concatenation of all the arguments separated by spaces.
1893 .ESC $@
1894 In a macro, the concatenation of all the arguments with each surrounded
1895 by double quotes, and separated by spaces.
1897 .\" --------- escaped characters ---------
1899 .ESC \(rs
1900 reduces to a single backslash; useful to delay its interpretation as
1901 escape character in copy mode.
1902 For a printable backslash, use
1903 .esc e .
1905 .ESC \(cq
1906 The acute accent \(aa; same as
1907 .esc( aa .
1908 Unescaped: apostrophe, right quotation mark, single quote (ASCII 0x27).
1910 .ESC `
1911 The grave accent \(ga; same as
1912 .esc( ga .
1913 Unescaped: left quote, backquote (ASCII 0x60).
1915 .ESC \-
1916 The \- sign in the current font.
1918 .ESC .
1919 An uninterpreted dot (period), even at start of line.
1921 .ESC %
1922 Default optional hyphenation character.
1924 .ESC !
1925 Transparent line indicator.
1927 .ESC ? anything\fB?\fP
1928 In a diversion, this will transparently embed
1929 .argument anything
1930 in the diversion.
1931 .argument anything
1932 is read in copy mode.
1933 See also the escape sequences
1934 .esc !
1936 .esc ? .
1939 .\" --------- spacing ---------
1941 .ESC \& space
1942 Unpaddable space-size space character (no line break).
1944 .ESC 0
1945 Digit width.
1947 .ESC |
1948 1/6\ em narrow space character; zero width in nroff.
1950 .ESC ^
1951 1/12\ em half-narrow space character; zero width in nroff.
1953 .ESC &
1954 Non-printable, zero width character.
1956 .ESC )
1957 Like
1958 .esc &
1959 except that it behaves like a character declared with the cflags
1960 request to be transparent for the purposes of end of sentence
1961 recognition.
1963 .ESC /
1964 Increases the width of the preceding character so that the spacing
1965 between that character and the following character will be correct if
1966 the following character is a roman character.
1968 .ESC ,
1969 Modifies the spacing of the following character so that the spacing
1970 between that character and the preceding character will correct if the
1971 preceding character is a roman character.
1973 .ESC ~
1974 Unbreakable space that stretches like a normal inter-word space when a
1975 line is adjusted.
1977 .ESC :
1978 Inserts a zero-width break point (similar to
1979 .esc %
1980 but without a soft hyphen character).
1982 .ESC \& newline
1983 Ignored newline, for continuation lines.
1985 .\" --------- structuring ---------
1987 .ESC {
1988 Begin conditional input.
1990 .ESC }
1991 End conditional input.
1993 .\" --------- longer escape names ---------
1995 .ESC ( st
1996 The special character with 2-character name
1997 .argument st ,
1998 see section
1999 .BR "SPECIAL CHARACTERS" .
2001 .ESC[] \& name
2002 The named character with arbitrary length name
2003 .argument name .
2005 .\" --------- alphabetical escapes ---------
2007 .ESC a
2008 Non-interpreted leader character.
2010 .ESCq A anything
2012 .argument anything
2013 is acceptable as a name of a string, macro, diversion, register,
2014 environment or font it expands to
2015 .number 1 ,
2017 .number 0
2018 otherwise.
2020 .ESCq b abc...
2021 Bracket building function.
2023 .ESCq B anything
2025 .argument anything
2026 is acceptable as a valid numeric expression it expands to
2027 .number 1 ,
2029 .number 0
2030 otherwise.
2032 .ESC c
2033 Interrupt text processing.
2035 .ESCq C char
2036 The character called
2037 .argument char ;
2038 same as
2039 .esc[] char ,
2040 but compatible to other roff versions.
2042 .ESC d
2043 Forward (down) 1/2 em vertical unit (1/2 line in nroff).
2045 .ESCq D charseq
2046 Draw a graphical element defined by the characters in
2047 .argument charseq ;
2048 see groff info file for details.
2050 .ESC e
2051 Printable version of the current escape character.
2053 .ESC E
2054 Equivalent to an escape character, but is not interpreted in copy-mode.
2056 .ESC f F
2057 Change to font with 1-character name or 1-digit number
2058 .argument F .
2060 .ESC f( fo
2061 Change to font with 2-characer name or 2-digit number
2062 .argument fo .
2064 .ESC[] f font
2065 Change to font with arbitrary length name or number expression
2066 .argument font .
2068 .ESC[] g reg
2069 Return format of register with name
2070 .argument reg
2071 suitable for
2072 .request .af .
2073 Alternative forms
2074 .esc(arg g xy
2076 .escarg g x .
2078 .ESCq h N
2079 Local horizontal motion; move right
2080 .argument N
2081 (left if negative).
2083 .ESCq H N
2084 Set height of current font to
2085 .argument N .
2087 .ESC[] k reg
2088 Mark horizontal input place in register with arbitrary length name
2089 .argument reg .
2090 Alternative forms
2091 .esc(arg k xy
2093 .escarg k x .
2095 .ESCq l Nc
2096 Horizontal line drawing function (optionally using character
2097 .argument c ).
2099 .ESCq L Nc
2100 Vertical line drawing function (optionally using character
2101 .argument c ).
2103 .ESC n r
2104 The numerical value stored in the register variable with the 1-character
2105 name
2106 .argument r .
2108 .ESC n( re
2109 The numerical value stored in the register variable with the 2-character
2110 name
2111 .argument re .
2113 .ESC[] n reg
2114 The numerical value stored in the register variable with arbitrary
2115 lenght name
2116 .argument reg .
2118 .ESCq N n
2119 Typeset the character with code
2120 .argument n
2121 in the current font, no special fonts are searched.  Useful for adding
2122 characters to a font using the
2123 .request .char
2124 request.
2126 .ESCq o abc...
2127 Overstrike characters
2128 .argument a ,
2129 .argument b ,
2130 .argument c ,
2131 etc.
2133 .ESC p
2134 Break and spread output line.
2136 .ESC r
2137 Reverse 1\ em vertical motion (reverse line in nroff).
2139 .ESCq R name \(+-n
2140 The same as
2141 .request .nr
2142 .argument name
2143 .argument \(+-n .
2145 .ESC[] s \(+-N
2146 Set the point size to
2147 .I N
2148 scaled points.  Note the alternative forms
2149 .BI \(rss \(+- [ N ]\c
2151 .BI \(rss' \(+-N '\c
2153 .BI \(rss \(+- ' N '\c
2155 .esc(arg s \(+-xy ,
2156 .BI \(rss \(+- ( xy\c
2158 .escarg s \(+-x .
2159 Same as
2160 .request .ps
2161 request.
2163 .ESCq S N
2164 Slant output
2165 .argument N
2166 degrees.
2168 .ESC t
2169 Non-interpreted horizontal tab.
2171 .ESC u
2172 Reverse (up) 1/2 em vertical motion (1/2 line in nroff).
2174 .ESCq v N
2175 Local vertical motion; move down
2176 .argument N
2177 (up if negative).
2179 .ESC[] V env
2180 The contents of the environment variable
2181 .argument env .
2182 Alternative forms
2183 .esc(arg V xy
2185 .escarg V x .
2187 .ESCq w string
2188 The width of the character sequence
2189 .argument string .
2191 .ESCq x N
2192 Extra line-space function (negative before, positive after).
2194 .ESCq X string
2195 Output
2196 .argument string
2197 as device control function.
2199 .ESC[] Y name
2200 Output string variable or macro
2201 .argument name
2202 uninterpreted as device control function.
2203 Alternative forms
2204 .esc(arg Y xy
2206 .escarg Y x .
2208 .ESC z c
2209 Print
2210 .argument c
2211 with zero width (without spacing).
2213 .ESCq Z anything
2214 Print
2215 .argument anything
2216 and then restore the horizontal and vertical position;
2217 .argument anything
2218 may not contain tabs or leaders.
2221 The escape sequences
2222 .esc e ,
2223 .esc . ,
2224 .esc \(dq ,
2225 .esc $ ,
2226 .esc * ,
2227 .esc a ,
2228 .esc n ,
2229 .esc t ,
2230 .esc g ,
2232 .escarg \& newline
2233 are interpreted in copy mode.
2235 Escape sequences starting with
2236 .esc (
2238 .esc [
2239 do not represent single character escape sequences, but introduce escape
2240 names with two or more characters.
2242 If a backslash is followed by a character that does not constitute a
2243 defined escape sequence the backslash is silently ignored and the
2244 character maps to itself.
2246 .\" --------------------------------------------------------------------
2247 .SS "SPECIAL CHARACTERS"
2248 .\" --------------------------------------------------------------------
2249 Common special characters are predefined by escape sequences of the form
2250 .(esc \fP\f(CIxy
2251 with characters
2252 .argument x
2254 .argument y .
2255 Some of these exist in the usual font while most of them are only
2256 available in the special font.  Below you'll find a selection of the most
2257 important glyphs; a complete list can be found in
2258 .BR groff_char (@MAN7EXT@).
2261 .PD 0
2263 .ESc bu Bullet sign
2264 .ESc co Copyright
2265 .ESc ct Cent
2266 .ESc dd Double dagger
2267 .ESc de Degree
2268 .ESc dg Dagger
2269 .ESc em Em-dash
2270 .ESc hy Hyphen
2271 .ESc rg Registered sign
2272 .ESc sc Section sign
2273 .ESc ul Underline character
2274 .ESc == Identical
2275 .ESc >= Larger or equal
2276 .ESc <= Less or equal
2277 .ESc != Not equal
2278 .ESc -> Right arrow
2279 .ESc <- Left arrow
2280 .ESc +- Plus-minus sign
2284 .\" --------------------------------------------------------------------
2285 .SH REGISTERS
2286 .\" --------------------------------------------------------------------
2287 Registers are variables that store a value.
2288 In groff, most registers store numerical values (see section
2289 .B NUMERICAL EXPRESSIONS
2290 above), but some can also hold a string value.
2292 Each register is given a name.
2293 Arbitrary registers can be defined and set with the request
2294 .request .nr
2295 .argument register .
2297 The value stored in a register can be retrieved by the escape sequences
2298 introduced by
2299 .esc n .
2301 Most useful are predefined registers.
2302 In the following the notation
2303 .argument name
2304 is used to refer to a register called
2305 .register name
2306 to make clear that we speak about registers.
2307 Please keep in mind that the
2308 .esc en[]
2309 decoration is not part of the register name.
2311 .\" --------------------------------------------------------------------
2312 .SS "READ-ONLY REGISTERS"
2313 .\" --------------------------------------------------------------------
2314 The following registers have predefined values that should not be
2315 modified by the user (usually, registers starting with a dot a read-only).
2316 Mostly, they provide information on the current settings or store results
2317 from request calls.
2319 .PD 0
2320 .REG .$ Number of arguments in the current macro.
2321 .REG .a
2322 Post-line extra line-space most recently utilized using
2323 .escarg x 'N' .
2324 .REG .A
2325 Set to
2326 .number 1
2328 .B troff
2329 if option
2330 .B \-A
2331 is used; always
2332 .number 1
2334 .BR nroff .
2335 .REG .c Current input line number.
2336 .REG .C 1 if compatibility mode is in effect, 0 otherwise.
2337 .REG .cdp
2338 The depth of the last character added to the current environment.
2339 It is positive if the character extends below the baseline.
2340 .REG .ce
2341 The number of lines remaining to be centered, as set by the
2342 .request .ce
2343 request.
2344 .REG .cht
2345 The height of the last character added to the current environment.
2346 It is positive if the character extends above the baseline.
2347 .REG .csk
2348 The skew of the last character added to the current environment.
2349 The skew of a character is how far to the right of the center of a character
2350 the center of an accent over that character should be placed.
2351 .REG .d
2352 Current vertical place in current diversion; equal to register
2353 .register nl .
2354 .REG .ev The name or number of the current environment (string-valued).
2355 .REG .f Current font number.
2356 .REG .fam  The current font family (string-valued).
2357 .REG .fp The number of the next free font position.
2358 .REG .g
2359 Always 1 in GNU troff.
2360 Macros should use it to test if running under groff.
2361 .REG .h Text base-line high-water mark on current page or diversion.
2362 .REG .H Available horizontal resolution in basic units.
2363 .REG .hla
2364 The current hyphenation language as set by the
2365 .B .hla
2366 request.
2367 .REG .hlc
2368 The number of immediately preceding consecutive hyphenated lines.
2369 .REG .hlm
2370 The maximum allowed number of consecutive hyphenated lines, as set by
2372 .request .hlm
2373 request.
2374 .REG .hy
2375 The current hyphenation flags (as set by the
2376 .request .hy
2377 request).
2378 .REG .hym
2379 The current hyphenation margin (as set by the
2380 .request .hym
2381 request).
2382 .REG .hys
2383 The current hyphenation space (as set by the
2384 .request .hys
2385 request).
2386 .REG .i Current ident.
2387 .REG .in The indent that applies to the current output line.
2388 .REG .int
2389 Positive if last output line contains
2390 .esc c .
2391 .REG .kern
2392 .number 1
2393 if pairwise kerning is enabled,
2394 .number 0
2395 otherwise.
2396 .REG .l Current line length.
2397 .REG .lg
2398 The current ligature mode (as set by the
2399 .request .lg
2400 request).
2401 .REG .linetabs
2402 The current line-tabs mode (as set by the
2403 .request .linetabs
2404 request).
2405 .REG .ll The line length that applies to the current output line.
2406 .REG .lt
2407 The title length (as set by the
2408 .request .lt
2409 request).
2410 .REG .n Length of text portion on previous output line.
2411 .REG .ne
2412 The amount of space that was needed in the last
2413 .request .ne
2414 request that caused a trap to be sprung.
2415 Useful in conjunction with
2416 .register .trunc .
2417 .REG .o Current page offset.
2418 .REG .p Current page length.
2419 .REG .pn
2420 The number of the next page: either the value set by a
2421 .request .pn
2422 request, or the number of the current page plus\ 1.
2423 .REG .ps The current pointsize in scaled points.
2424 .REG .psr The last-requested pointsize in scaled points.
2425 .REG .rj
2426 The number of lines to be right-justified as set by the rj request.
2427 .REG .s Current point size as a decimal fraction.
2428 .REG .sr
2429 The last requested pointsize in points as a decimal fraction
2430 (string-valued).
2431 .REG .t Distance to the next trap.
2432 .REG .T
2433 Set to
2434 .number 1
2435 if option
2436 .B \-T
2437 is used.
2438 .REG .tabs
2439 A string representation of the current tab settings suitable for use as
2440 an argument to the
2441 .request .ta
2442 request.
2443 .REG .trunc
2444 The amount of vertical space truncated by the most recently sprung
2445 vertical position trap, or, if the trap was sprung by a
2446 .request .ne
2447 request, minus the amount of vertical motion produced by
2448 .request .ne .
2449 request.
2450 In other words, at the point a trap is sprung, it represents the difference
2451 of what the vertical position would have been but for the trap, and what the
2452 vertical position actually is.
2453 Useful in conjunction with the
2454 .register .ne
2455 register.
2456 .REG .ss
2457 The value of the parameters set by the first argument of the
2458 .request .ss
2459 request.
2460 .REG .sss
2461 The value of the parameters set by the second argument of the
2462 .request .ss
2463 request.
2464 .REG .u Equal to 1 bin fill mode and 0 in nofill mode.
2465 .REG .v Current vertical line spacing.
2466 .REG .V Available vertical resolution in basic units.
2467 .REG .vpt
2468 .number 1
2469 if vertical position traps are enabled,
2470 .number 0
2471 otherwise.
2472 .REG .w Width of previous character.
2473 .REG .warn
2474 The sum of the number codes of the currently enabled warnings.
2475 .REG .x The major version number.
2476 .REG .y The minor version number.
2477 .REG .Y The revision number of groff.
2478 .REG .z Name of current diversion.
2481 .\" --------------------------------------------------------------------
2482 .SS "WRITABLE REGISTERS"
2483 .\" --------------------------------------------------------------------
2484 The following registers can be read and written by the user.
2485 They have predefined default values, but these can be modified for
2486 customizing a document.
2488 .PD 0
2489 .REG % Current page number.
2490 .REG c. Current input line number.
2491 .REG ct Character type (set by width function
2492 .esc w ).
2493 .REG dl Maximal width of last completed diversion.
2494 .REG dn Height of last completed diversion.
2495 .REG dw Current day of week (1-7).
2496 .REG dy Current day of month (1-31).
2497 .REG hp Current horizontal position at input line.
2498 .REG llx
2499 Lower left x-coordinate (in PostScript units) of a given PostScript
2500 image (set by
2501 .request .psbb ).
2502 .REG lly
2503 Lower left y-coordinate (in PostScript units) of a given PostScript
2504 image (set by
2505 .request .psbb ).
2506 .REG ln Output line number.
2507 .REG mo Current month (1-12).
2508 .REG nl Vertical position of last printed text base-line.
2509 .REG rsb Like
2510 .register sb ,
2511 but takes account of the heights and depths of characters.
2512 .REG rst
2513 Like
2514 .register st ,
2515 but takes account of the heights and depths of characters.
2516 .REG sb
2517 Depth of string below base line (generated by width function
2518 .esc w ).
2519 .REG skw
2520 Right skip width from the center of the last character in the
2521 .esc w
2522 argument.
2523 .REG slimit
2524 If greater than 0, the maximum number of objects on the input stack.
2525 If \(<=0 there is no limit, i.e., recursion can continue until virtual
2526 memory is exhausted.
2527 .REG ssc
2528 The amount of horizontal space (possibly negative) that should be added
2529 to the last character before a subscript (generated by width function
2530 .esc w ).
2531 .REG st
2532 Height of string above base line (generated by width function
2533 .esc w ).
2534 .REG systat
2535 The return value of the
2536 .I system()
2537 function executed by the last
2538 .request .sy
2539 request.
2540 .REG urx
2541 Upper right x-coordinate (in PostScript units) of a given PostScript
2542 image (set by
2543 .request .psbb ).
2544 .REG ury
2545 Upper right y-coordinate (in PostScript units) of a given PostScript
2546 image (set by
2547 .request .psbb ).
2548 .REG year The current year (year 2000 compliant).
2549 .REG yr
2550 Current year minus 1900.  For Y2K compliance use register
2551 .register year
2552 instead.
2555 .\" --------------------------------------------------------------------
2556 .SH WARNINGS
2557 .\" --------------------------------------------------------------------
2558 Each warning generated by groff is identified by a name and a code
2559 number.  The codes are powers of 2 to allow bit-encoding with a single
2560 integer.  There are also names that can be used to refer to groups of
2561 warnings.
2563 The name associated with a warning is used by the
2564 .option \-w
2566 .option \-W
2567 options;
2568 the number code is used by the
2569 .request .warn
2570 request and by the
2571 .esc[arg] n warn
2572 register.
2574 .PD 0
2575 .Warning all group
2576 All warnings except
2577 .warning di ,
2578 .warning mac
2580 .warning reg .
2581 Intended to cover all warnings with traditional macro packages.
2582 .Warning break 4
2583 In fill mode, lines which could not be broken so that their length was
2584 less than the line length.  This is enabled by default.
2585 .Warning char 1
2586 Non-existent characters.  This is enabled by default.
2587 .Warning delim 8
2588 Missing or mismatched closing delimiters.
2589 .Warning di 256
2590 Use of
2591 .request .di
2593 .request .da
2594 without an argument when there is no current diversion.
2595 .Warning el 16
2596 Use of the
2597 .request .el
2598 request with no matching
2599 .request .ie
2600 request.
2601 .Warning escape 32768
2602 Unrecognized escape sequence.  Then the escape character is ignored.
2603 .Warning font 131072
2604 Non-existent fonts.  This is enabled by default.
2605 .Warning ig 262144
2606 Illegal escapes in text ignored with the
2607 .request \.ig
2608 request.  These are conditions that are errors when they occur outside
2609 of ignored text.
2610 .Warning mac 512
2611 Use of undefined strings, macros, and diversions.  Automatically handled
2612 as empty.  Usually, only one warning per name.
2613 .Warning missing 8192
2614 Request that is missing non-optional arguments.
2615 .Warning input 16384
2616 Illegal input character.
2617 .Warning number 2
2618 Invalid numeric expressions.  This is enabled by default.
2619 .Warning range 64
2620 Out of range arguments.
2621 .Warning reg 1024
2622 Use of undefined number register.  Automatically defined as having
2623 value 0.  Usually, only one warning per name.
2624 .Warning right-brace 4096
2625 Use of
2626 .esc }
2627 where a number was expected.
2628 .Warning scale 32
2629 Meaningless scaling indicators.
2630 .Warning space 65536
2631 Missing space between a request or macro and its argument.  Then no
2632 macro is automatically defined.  This is enabled by default.  This
2633 warning will never occur in compatibility mode.
2634 .Warning syntax 128
2635 Dubious syntax in numeric expressions.
2636 .Warning tab 2048
2637 Inappropriate use of a tab character (either in an unquoted macro
2638 argument or where a number was expected).
2639 .Warning w group
2640 All warnings.
2644 tab(@), box, expand;
2645 c c c | c  c  c | c  c  c
2646 R RI CB | R RI CB | R RI CB.
2647 Bit@Code@Warning@Bit@Code@Warning@Bit@Code@Warning
2649 0@1@char@8@256@di@16@65536@space
2650 1@2@number@9@512@mac@17@131072@font
2651 2@4@break@10@1024@reg@18@262144@ig
2652 3@8@delim@11@2048@tab
2653 4@16@el@12@4096@right-brace
2654 5@32@scale@13@8192@missing
2655 6@64@range@14@16384@input
2656 7@128@syntax@15@32768@escape
2660 .\" --------------------------------------------------------------------
2661 .SH COMPATIBILITY
2662 .\" --------------------------------------------------------------------
2663 .I groff
2664 provides a
2665 .B compatibility mode
2666 that allows to process roff code written for classical
2667 .troff
2668 or for other implementations of roff in a consistent way.
2670 Compatibility mode can be turned on with the
2671 .option \-C
2672 command line option, and turned on or off with the
2673 .request .cp
2674 request.  The number register
2675 .esc(arg n .C
2677 .number 1
2678 if compatibility mode is on,
2679 .number 0
2680 otherwise.
2682 This became necessary because the GNU concept for long names causes some
2683 incompatibilities.
2684 .I Classical troff
2685 will interpret
2688 \&.dsabcd
2690 as defining a string
2691 .B ab
2692 with contents
2693 .BR cd .
2694 Normally,
2695 .I groff
2696 will interpret this as a call of a macro named
2697 .request dsabcd .
2699 Also
2700 .I classical troff
2701 will interpret
2702 .esc *[
2704 .esc n[
2705 as references to a string or number register called
2706 .register [ .
2708 .I GNU native
2709 .IR mode ,
2710 however, this will normally be interpreted as the start of a long name.
2713 .I compatibility
2714 .IR mode ,
2715 groff will interpret these things in the traditional way, but long names
2716 are not recognized.
2718 On the other hand, groff in
2719 .I GNU native mode
2720 does not allow to use the escape sequences
2721 .esc e ,
2722 .esc | ,
2723 .esc ^ ,
2724 .esc & ,
2725 .esc } ,
2726 .esc { ,
2727 .esc "\ " (space),
2728 .esc ' ,
2729 .esc ` ,
2730 .esc - ,
2731 .esc _ ,
2732 .esc ! ,
2733 .esc % ,
2735 .esc c
2736 in names of strings, macros, diversions, number registers, fonts or
2737 environments, whereas
2738 .I classical troff
2739 does.  The
2740 .esc A
2741 escape sequence can be helpful in avoiding these escape sequences in
2742 names.
2744 Fractional pointsizes cause one noteworthy incompatibility.
2746 .I classical
2747 .IR troff ,
2749 .request .ps
2750 request ignores scale indicators and so
2753 .B .ps\ 10u
2756 will set the pointsize to 10 points, whereas in groff native mode the
2757 pointsize will be set to 10 scaled points.
2760 .I groff
2761 mode, there is a fundamental difference between unformatted input
2762 characters, and formatted output characters.
2763 Everything that affects how an output character will be output is stored
2764 with the character; once an output character has been constructed it is
2765 unaffected by any subsequent requests that are executed, including the
2766 .request .bd ,
2767 .request .cs ,
2768 .request .tkf ,
2769 .request .tr ,
2771 .request .fp
2772 requests.
2774 Normally output characters are constructed from input characters at the
2775 moment immediately before the character is added to the current output
2776 line.
2777 Macros, diversions and strings are all, in fact, the same type of object;
2778 they contain lists of input characters and output characters in any
2779 combination.
2781 An output character does not behave like an input character for the
2782 purposes of macro processing; it does not inherit any of the special
2783 properties that the input character from which it was constructed might
2784 have had.
2785 The following example will make things clearer.
2789 .ft B
2790 \&.di x
2791 \(rs\(rs\(rs\(rs
2792 \&.br
2793 \&.di
2794 \&.x
2800 .I GNU mode
2801 this will be printed as
2802 .esc \(rs .
2803 So each pair of input backslashes
2804 .'char \(rs\(rs
2805 is turned into a single output backslash
2806 .'char \(rs
2807 and the resulting output backslashes are not interpreted as escape
2808 characters when they are reread.
2810 .I Classical troff
2811 would interpret them as escape characters when they were reread and
2812 would end up printing a single backslash
2813 .'char \(rs .
2815 The correct way to get a printable
2816 .'char \(rs
2817 is to use the
2818 .esc e
2819 escape sequence.  This will always print a single instance of the
2820 current escape character, regardless of whether or not it is used in a
2821 diversion.  It will also work in both GNU mode and compatibility mode.
2823 To store an escape sequence in a diversion that will be interpreted when
2824 the diversion is reread, either the traditional
2825 .esc !
2826 transparent output facility or the
2828 .esc ?
2829 escape sequence can be used.
2831 .\" --------------------------------------------------------------------
2832 .SH BUGS
2833 .\" --------------------------------------------------------------------
2834 At the moment, the documentation of the groff system is in a state of
2835 change and evolution.  It is possible that there are small
2836 inconsistencies between different documents temporarily.
2839 .B WARNINGS
2840 section belongs to
2841 .BR troff (@MAN1EXT@).
2843 .\" --------------------------------------------------------------------
2844 .SH AUTHOR
2845 .\" --------------------------------------------------------------------
2846 This document is part of groff, the GNU roff distribution.  It was
2847 written by Bernd Warken <bwarken@mayn.de>.
2849 It is distributed under the terms of the FDL (GNU Free Documentation
2850 License) version 1.1 or later.  You should have received a copy of the
2851 FDL on your system, it is also available on-line under
2854 .IR http://www.gnu.org/copyleft/fdl.html .
2857 Formerly, the extensions of the groff language were kept in the manual
2858 page
2859 .BR troff (@MAN1EXT@).
2860 This document contains the essential parts of that documentation, but
2861 the gory details are found in the groff info file.
2863 .\" --------------------------------------------------------------------
2864 .SH "SEE ALSO"
2865 .\" --------------------------------------------------------------------
2866 The main source of information for the groff language is the
2867 .B groff
2868 .BR info (1)
2869 file.
2871 For a survey of roff and the groff system and further documentation
2872 pointers see
2873 .BR roff (@MAN7EXT@).
2875 The formatter programs are described in
2876 .BR groff (@MAN1EXT@)
2878 .BR troff (@MAN1EXT@);
2879 a complete of all predefined glyph names can be found in
2880 .BR groff_char (@MAN7EXT@).
2882 The classical
2883 .I troff
2884 documentation is available on-line at
2887 .I http://cm.bell-labs.com/cm/cs/cstr.html
2891 .IR http://www.kohala.com/start/troff/ .