o Macro .PS renamed to .PT_SIZE. Alias .TS removed.
[s-roff.git] / man / groff_diff.man
blob07a8d9510717fa82475a23f98a36536619ecedc5
1 '\" e
2 .\" The above line should force the use of eqn as a preprocessor
3 .ig
4 groff_diff.man
6 Last update : 27 May 2002
8 This file is part of groff, the GNU roff type-setting system.
9 It is the source of the man-page groff_diff(7).
11 Copyright (C) 1989, 2001, 2002 Free Software Foundation, Inc.
12 written by James Clark
14 modified by Werner Lemberg <wl@gnu.org>
15             Bernd Warken <bwarken@mayn.de>
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.1 or
19 any later version published by the Free Software Foundation; with the
20 Invariant Sections being this .ig-section and AUTHORS, with no
21 Front-Cover Texts, and with no Back-Cover Texts.
23 A copy of the Free Documentation License is included as a file called
24 FDL in the main directory of the groff source package.
27 .\" --------------------------------------------------------------------
28 .\" Setup
29 .\" --------------------------------------------------------------------
31 .mso www.tmac
33 .if n \{\
34 .  mso tty-char.tmac
35 .  ftr CR R
36 .  ftr CI I
37 .  ftr CB B
38 .\}
40 .if '\*[.T]'dvi' \
41 .  ftr CB CW
43 .\" define a string tx for the TeX logo
44 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
45 .el   .ds tx TeX
48 .\" --------------------------------------------------------------------
49 .\" start of macro definitions
50 .eo
52 .de TQ
53 .  br
54 .  ns
55 .  TP \$1
57 .de Text
58 .  RI "\$*"
60 .de Topic
61 .  TP 2m
62 .  Text \[bu]
64 .de squoted
65 .  ds @arg1 \$1
66 .  shift
67 .\"  Text \[oq]\f[CB]\*[@arg1]\f[]\[cq]\$*
68 .  Text \[oq]\f[B]\*[@arg1]\f[]\[cq]\$*
69 .  rm @arg1
71 .\" A shell command line
72 .de ShellCommand
73 .  br
74 .  IR "shell#" "\h'1m'\f[CB]\$*\f[]\/"
76 .\" reference of a request or macro
77 .de request
78 .  ds @arg1 \$1
79 .  shift 1
80 .\"  Text \f[CB]\*[@arg1]\f[]\$*
81 .  Text \f[B]\*[@arg1]\f[]\$*
82 .  rm @arg1
84 .als option request
86 .\" representation of an escape sequence
87 .de esc
88 .  ds @arg1 \$1
89 .  shift
90 .\"  Text \f[CB]\[rs]\*[@arg1]\f[]\$*
91 .  Text \f[B]\[rs]\*[@arg1]\&\f[]\$*
92 .  rm @arg1
94 .ec
95 .\" end of macro definitions
97 .\" from old groff_out.man
98 .ie \n(.g \
99 .  ds ic \/
100 .el \
101 .  ds ic \^
104 .\" --------------------------------------------------------------------
105 .\" Title
106 .\" --------------------------------------------------------------------
108 .TH GROFF_DIFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
109 .SH NAME
110 groff_diff \- differences between GNU troff and classical troff
113 .\" --------------------------------------------------------------------
114 .SH DESCRIPTION
115 .\" --------------------------------------------------------------------
117 This manual page describes the language differences between
118 .IR groff ,
119 the GNU
120 .I roff
121 text processing system and the classical
122 .I roff
123 formatter of the freely available Unix\~7 of the 1970s, documented in
125 .I Troff User's Manual
127 .I Osanna
129 .IR Kernighan .
130 This inludes the roff language as well as the intermediate output
131 format (troff output).
134 The section
135 .I SEE ALSO
136 gives pointers to both the classical
137 .I roff
138 and the modern
139 .I groff
140 documentation.
143 At the moment, this document is the place of the most actual
144 documentation within the
145 .I groff
146 system.
148 This might change in the future.
150 Actually, all novelties of the groff language are first described here
151 and will pervade into the other documents only at a later stage.
154 .\" --------------------------------------------------------------------
155 .SH "GROFF LANGUAGE"
156 .\" --------------------------------------------------------------------
158 In this section, all additional features of
159 .I groff
160 compared to the classical Unix\~7
161 .I troff
162 are described in detail.
165 .\" --------------------------------------------------------------------
166 .SS "Long names"
167 .\" --------------------------------------------------------------------
169 The names of number registers, fonts, strings/\:macros/\:diversions,
170 special characters, and colors can be of any length.
172 In escape sequences, additionally to the classical
173 .BI ( xx
174 construction for a two character name, you can use
175 .BI [ xxx ]
176 for a name of arbitrary length, for example in
178 .TP \w'\[rs]f[xxx]'u+3n
179 .BI \[rs][ xxx ]
180 Print the special character called
181 .IR xxx .
184 .BI \[rs]f[ xxx ]
185 Set font
186 .IR xxx .
188 Additionally,
189 .B \[rs]f[]
190 is a new syntax equal to
191 .BR \[rs]fP ,
192 i.e., to return to the previous font.
195 .BI \[rs]*[ xxx ]
196 Interpolate string
197 .IR xxx .
200 .BI \[rs]n[ xxx ]
201 Interpolate number register
202 .IR xxx .
205 .\" --------------------------------------------------------------------
206 .SS "Fractional pointsizes"
207 .\" --------------------------------------------------------------------
210 .I scaled point
211 is equal to
212 .B 1/sizescale
213 points, where
214 .B sizescale
215 is specified in the
216 .B DESC
217 file (1 by default).
219 There is a new scale indicator
220 .B z
221 that has the effect of multiplying by sizescale.
223 Requests and escape sequences in troff interpret arguments that
224 represent a pointsize as being in units of scaled points, but they
225 evaluate each such argument using a default scale indicator of
226 .BR z .
227 Arguments treated in this way are the argument to the
228 .B ps
229 request, the third argument to the
230 .B cs
231 request, the second and fourth arguments to the
232 .B tkf
233 request, the argument to the
234 .B \[rs]H
235 escape sequence, and those variants of the
236 .B \[rs]s
237 escape sequence that take a numeric expression as their argument.
240 For example, suppose sizescale is 1000; then a scaled point will be
241 equivalent to a millipoint; the call
242 .B .ps\ 10.25
243 is equivalent to
244 .B .ps\ 10.25z
245 and so sets the pointsize to 10250 scaled points, which is equal to
246 10.25 points.
249 The number register
250 .B \[rs]n[.s]
251 returns the pointsize in points as decimal fraction.
253 There is also a new number register
254 .B \[rs]n[.ps]
255 that returns the pointsize in scaled points.
258 It would make no sense to use the
259 .B z
260 scale indicator in a numeric expression whose default scale indicator
261 was neither
262 .B u
264 .BR z ,
265 and so
266 .B troff
267 disallows this.
269 Similarly it would make no sense to use a scaling indicator other than
270 .B z
272 .B u
273 in a numeric expression whose default scale indicator was
274 .BR z ,
275 and so
276 .B troff
277 disallows this as well.
280 There is also new scale indicator\~\c
281 .B s
282 which multiplies by the number of units in a scaled point.
284 So, for example,
285 .B \[rs]n[.ps]s
286 is equal to
287 .BR 1m .
288 Be sure not to confuse the
289 .B s
291 .B z
292 scale indicators.
295 .\" --------------------------------------------------------------------
296 .SS "Numeric expressions"
297 .\" --------------------------------------------------------------------
299 Spaces are permitted in a number expression within parentheses.
302 .B M
303 indicates a scale of 100ths of an em.
304 .B f
305 indicates a scale of 65536 units, providing fractions for color
306 definitions with the
307 .B defcolor
308 request.
310 For example, 0.5f = 32768u.
313 .IB e1 >? e2
314 The maximum of
315 .I e1
317 .IR e2 .
320 .IB e1 <? e2
321 The minimum of
322 .I e1
324 .IR e2 .
327 .BI ( c ; e )
328 Evaluate
329 .I e
330 using
331 .I c
332 as the default scaling indicator.
335 .I c
336 is missing, ignore scaling indicators in the evaluation of
337 .IR e .
340 .\" --------------------------------------------------------------------
341 .SS "New escape sequences"
342 .\" --------------------------------------------------------------------
345 .BI \[rs]A' anything '
346 This expands to
347 .B 1
349 .B 0
350 resp., depending on whether
351 .I anything
352 is or is not acceptable as the name of a string, macro, diversion, number
353 register, environment, font, or color.
354 It will return\~\c
355 .B 0
357 .I anything
358 is empty.
360 This is useful if you want to lookup user input in some sort of
361 associative table.
364 .BI \[rs]B' anything '
365 This expands to
366 .B 1
368 .B 0
369 resp., depending on whether
370 .I anything
371 is or is not a valid numeric expression.
373 It will return\~\c
374 .B 0
376 .I anything
377 is empty.
380 .BI \[rs]C' xxx '
381 Typeset character named
382 .IR xxx .
383 Normally it is more convenient to use
384 .BI \[rs][ xxx ]\f[R].
386 .B \[rs]C
387 has the advantage that it is compatible with recent versions of
388 .SM UNIX
389 and is available in compatibility mode.
392 .B \[rs]E
393 This is equivalent to an escape character, but it is not interpreted in
394 copy-mode.
396 For example, strings to start and end superscripting could be defined
397 like this
401 .ft CB
402 .Text .ds { \[rs]v'\-.3m'\[rs]s'\[rs]En[.s]*6u/10u'
404 .Text .ds } \[rs]s0\[rs]v'.3m'
408 The use of
409 .B \[rs]E
410 ensures that these definitions will work even if
411 .B \[rs]*{
412 gets interpreted in copy-mode (for example, by being used in a macro
413 argument).
417 .BI \[rs]F f
419 .BI \[rs]F( fm
421 .BI \[rs]F[ fam ]
422 Change font family.
424 This is the same as the
425 .B fam
426 request.
428 .B \[rs]F[]
429 switches back to the previous color (note that
430 .B \[rs]FP
431 won't work; it selects font family `P' instead).
434 .BI \[rs]m x
436 .BI \[rs]m( xx
438 .BI \[rs]m[ xxx ]
439 Set drawing color.
440 .B \[rs]m[]
441 switches back to the previous color.
444 .BI \[rs]M x
446 .BI \[rs]M( xx
448 .BI \[rs]M[ xxx ]
449 Set background color for filled objects drawn with the
450 .BI \[rs]D' .\|.\|. '
451 commands.
452 .B \[rs]M[]
453 switches back to the previous color.
456 .BI \[rs]N' n '
457 Typeset the character with code
458 .I n
459 in the current font.
460 .I n
461 can be any integer.
463 Most devices only have characters with codes between 0 and 255.
465 If the current font does not contain a character with that code,
466 special fonts will
467 .I not
468 be searched.
471 .B \[rs]N
472 escape sequence can be conveniently used in conjunction with the
473 .B char
474 request, for example
477 .ft CB
479 .Text .char \[rs][phone] \[rs]f(ZD\[rs]N'37'
484 The code of each character is given in the fourth column in the font
485 description file after the
486 .B charset
487 command.
489 It is possible to include unnamed characters in the font description
490 file by using a name of
491 .BR \-\-\- ;
493 .B \[rs]N
494 escape sequence is the only way to use these.
497 .BI \[rs]O n
499 .BI \[rs]O[ n ]
500 Suppressing troff output.
502 The escapes
503 .BR \[rs]02 ,
504 .BR \[rs]O3 ,
505 .BR \[rs]O4 ,
507 .B \[rs]O5
508 are intended for internal use by
509 .BR \%grohtml .
513 .B \[rs]O0
514 Disable any ditroff glyphs from being emitted to the device driver,
515 provided that the escape occurs at the outer level (see
516 .B \[rs]O3
518 .BR \[rs]O4 ).
521 .B \[rs]O1
522 Enable output of glyphs, provided that the escape occurs at the outer
523 level.
525 .B \[rs]O0
527 .B \[rs]O1
528 also reset the registers
529 .BR \[rs]n[opminx] ,
530 .BR \[rs]n[opminy] ,
531 .BR \[rs]n[opmaxx] ,
533 .B \[rs]n[opmaxy]
534 to\~-1.
536 These four registers mark the top left and bottom right hand corners
537 of a box which encompasses all written glyphs.
540 .B \[rs]O2
541 Provided that the escape occurs at the outer level, enable output of
542 glyphs and also write out to stderr the page number and four registers
543 encompassing the glyphs previously written since the last call to
544 .BR \[rs]O .
547 .B \[rs]O3
548 Begin a nesting level.
550 At start-up,
551 .B troff
552 is at outer level.
554 This is really an internal mechanism for
555 .B \%grohtml
556 while producing images.
558 They are generated by running the troff source through
559 .B troff
560 to the postscript device and
561 .B ghostscript
562 to produce images in PNG format.
565 .B \[rs]O3
566 escape will start a new page if the device is not html (to reduce the
567 possibility of images crossing a page boundary).
570 .B \[rs]O4
571 End a nesting level.
574 .BI \[rs]O5[ Pfilename ]
575 This escape is
576 .B \%grohtml
577 specific.
579 Provided that this escape occurs at the outer nesting level, write
580 .I filename
581 to stderr.
583 The position of the image,
584 .IR P ,
585 must be specified and must be one of l, r, c, or i (left, right,
586 centered, inline).
588 .I filename
589 will be associated with the production of the next inline image.
593 .BI \[rs]R' name\ \[+-]n '
594 This has the same effect as
598 .BI .nr\  name\ \[+-]n
602 .BI \[rs]s( nn
604 .BI \[rs]s\[+-]( nn
605 Set the point size to
606 .I nn
607 points;
608 .I nn
609 must be exactly two digits.
612 .BI \[rs]s[\[+-] n ]
614 .BI \[rs]s\[+-][ n ]
616 .BI \[rs]s'\[+-] n '
618 .BI \[rs]s\[+-]' n '
619 Set the point size to
620 .I n
621 scaled points;
622 .I n
623 is a numeric expression with a default scale indicator of\~\c
624 .BR z .
627 .BI \[rs]V x
629 .BI \[rs]V( xx
631 .BI \[rs]V[ xxx ]
632 Interpolate the contents of the environment variable
633 .IR xxx ,
634 as returned by
635 .BR getenv (3).
636 .B \[rs]V
637 is interpreted in copy-mode.
640 .BI \[rs]Y x
642 .BI \[rs]Y( xx
644 .BI \[rs]Y[ xxx ]
645 This is approximately equivalent to
646 .BI \[rs]X'\[rs]*[ xxx ]'\f[R].
647 However the contents of the string or macro
648 .I xxx
649 are not interpreted; also it is permitted for
650 .I xxx
651 to have been defined as a macro and thus contain newlines (it is not
652 permitted for the argument to
653 .B \[rs]X
654 to contain newlines).
656 The inclusion of newlines requires an extension to the UNIX troff
657 output format, and will confuse drivers that do not know about this
658 extension.
661 .BI \[rs]Z' anything '
662 Print anything and then restore the horizontal and vertical position;
663 .I anything
664 may not contain tabs or leaders.
667 .B \[rs]$0
668 The name by which the current macro was invoked.
671 .B als
672 request can make a macro have more than one name.
675 .B \[rs]$*
676 In a macro, the concatenation of all the arguments separated by spaces.
679 .B \[rs]$@
680 In a macro, the concatenation of all the arguments with each
681 surrounded by double quotes, and separated by spaces.
684 .BI \[rs]$( nn
686 .BI \[rs]$[ nnn ]
687 In a macro, this gives the
688 .IR nn -th
690 .IR nnn -th
691 argument.
693 Macros can have an unlimited number of arguments.
696 .BI \[rs]? anything \[rs]?
697 When used in a diversion, this will transparently embed
698 .I anything
699 in the diversion.
700 .I anything
701 is read in copy mode.
703 When the diversion is reread,
704 .I anything
705 will be interpreted.
706 .I anything
707 may not contain newlines; use
708 .B \[rs]!\&
709 if you want to embed newlines in a diversion.
711 The escape sequence
712 .B \[rs]?\&
713 is also recognised in copy mode and turned into a single internal
714 code; it is this code that terminates
715 .IR anything .
716 Thus
720 .ne 14v+\n(.Vu
721 .ft CB
723 .Text .nr x 1
724 .Text .nf
725 .Text .di d
726 .Text \[rs]?\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\c
727 .Text \[rs]nx\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]?\[rs]?
728 .Text .di
729 .Text .nr x 2
730 .Text .di e
731 .Text .d
732 .Text .di
733 .Text .nr x 3
734 .Text .di f
735 .Text .e
736 .Text .di
737 .Text .nr x 4
738 .Text .f
744 will print\~\c
745 .BR 4 .
748 .B \[rs]/
749 This increases the width of the preceding character so that the
750 spacing between that character and the following character will be
751 correct if the following character is a roman character.
753 .if t \{\
754 .  nop For example, if an italic f is immediately followed by a roman
755 .  nop right parenthesis, then in many fonts the top right portion of
756 .  nop the f will overlap the top left of the right parenthesis
757 .  nop producing \f[I]f\f[R])\f[R], which is ugly.
758 .  nop Inserting
759 .  B \[rs]/
760 .  nop produces
761 .  ie \n(.g \f[I]f\/\f[R])\f[R]
762 .  el       \f[I]f\|\f[R])\f[R]
763 .  nop and avoids this problem.
765 It is a good idea to use this escape sequence whenever an italic
766 character is immediately followed by a roman character without any
767 intervening space.
770 .B \[rs],
771 This modifies the spacing of the following character so that the
772 spacing between that character and the preceding character will
773 correct if the preceding character is a roman character.
775 .if t \{\
776 .  nop For example, inserting
777 .  B \[rs],
778 .  nop between the parenthesis and the f changes
779 .  nop \f[R](\f[I]f\f[R] to
780 .  ie \n(.g \f[R](\,\f[I]f\f[R].
781 .  el       \f[R](\^\f[I]f\f[R].
783 It is a good idea to use this escape sequence whenever a roman
784 character is immediately followed by an italic character without any
785 intervening space.
788 .B \[rs])
789 Like
790 .B \[rs]&
791 except that it behaves like a character declared with the
792 .B cflags
793 request to be transparent for the purposes of end-of-sentence
794 recognition.
797 .B \[rs]~
798 This produces an unbreakable space that stretches like a normal
799 inter-word space when a line is adjusted.
802 .B \[rs]:
803 This causes the insertion of a zero-width break point.
805 It is equal to
806 .B \[rs]%
807 within a word but without insertion of a soft hyphen character.
810 .B \[rs]#
811 Everything up to and including the next newline is ignored.
813 This is interpreted in copy mode.
815 It is like
816 .B \[rs]"
817 except that
818 .B \[rs]"
819 does not ignore the terminating newline.
822 .\" --------------------------------------------------------------------
823 .SS "New requests"
824 .\" --------------------------------------------------------------------
827 .BI .aln\  xx\ yy
828 Create an alias
829 .I xx
830 for number register object named
831 .IR yy .
832 The new name and the old name will be exactly equivalent.
835 .I yy
836 is undefined, a warning of type
837 .B reg
838 will be generated, and the request will be ignored.
841 .BI .als\  xx\ yy
842 Create an alias
843 .I xx
844 for request, string, macro, or diversion object named
845 .IR yy .
847 The new name and the old name will be exactly equivalent (it is
848 similar to a hard rather than a soft link).
851 .I yy
852 is undefined, a warning of type
853 .B mac
854 will be generated, and the request will be ignored.
857 .BR de ,
858 .BR am ,
859 .BR di ,
860 .BR da ,
861 .BR ds ,
863 .B as
864 requests only create a new object if the name of the macro, diversion
865 or string diversion is currently undefined or if it is defined to be a
866 request; normally they modify the value of an existing object.
869 .BI .ami\  xx\ yy
870 Append to macro indirectly.
872 See the
873 .B dei
874 request below for more information.
877 .BI .am1\  xx\ yy
878 Similar to
879 .BR .am , 
880 but compatibility mode is switched off during execution.
882 To be more precise, a `compatibility save' token is inserted at the
883 beginning of the macro addition, and a `compatibility restore' token at
884 the end.
886 As a consequence, the requests
887 .BR am ,
888 .BR am1 ,
889 .BR de ,
891 .B de1
892 can be intermixed freely since the compatibility save/\:restore tokens
893 only affect the macro parts defined by
894 .B .am1
896 .BR .ds1 .
899 .BI .asciify\  xx
900 This request `unformats' the diversion
901 .I xx
902 in such a way that
903 .SM ASCII
904 and space characters (and some escape sequences) that were formatted
905 and diverted into
906 .I xx
907 will be treated like ordinary input characters when
908 .I xx
909 is reread.
910 Useful for diversions in conjunction with the
911 .B .writem
912 request.
914 It can be also used for gross hacks; for example, this
918 .ne 7v+\n(.Vu
919 .ft CB
921 .Text .tr @.
922 .Text .di x
923 .Text @nr n 1
924 .Text .br
925 .Text .di
926 .Text .tr @@
927 .Text .asciify x
928 .Text .x
934 will set register\~\c
935 .B n
936 to\~1.
938 Note that glyph information (font, font size, etc.) is not preserved;
940 .B .unformat
941 instead.
944 .BI .as1\  xx\ yy
945 Similar to
946 .BR .as , 
947 but compatibility mode is switched off during expansion.
949 To be more precise, a `compatibility save' token is inserted at the
950 beginning of the string, and a `compatibility restore' token at the end.
952 As a consequence, the requests
953 .BR as ,
954 .BR as1 ,
955 .BR ds ,
957 .B ds1
958 can be intermixed freely since the compatibility save/\:restore tokens
959 only affect the (sub)strings defined by
960 .B as1
962 .BR ds1 .
965 .B .backtrace
966 Print a backtrace of the input stack on stderr.
969 .BI .blm\  xx
970 Set the blank line macro to
971 .IR xx .
972 If there is a blank line macro, it will be invoked when a blank line
973 is encountered instead of the usual troff behaviour.
976 .BI .box\  xx
978 .BI .boxa\  xx
979 These requests are similar to the
980 .B di
982 .B da
983 requests with the exception that a partially filled line will not
984 become part of the diversion (i.e., the diversion always starts with a
985 new line) but restored after ending the diversion, discarding the
986 partially filled line which possibly comes from the diversion.
989 .B .break
990 Break out of a while loop.
992 See also the
993 .B while
995 .B continue
996 requests.
998 Be sure not to confuse this with the
999 .B br
1000 request.
1003 .B .brp
1004 This is the same as
1005 .BR \[rs]p .
1008 .BI .cflags\  n\ c1\ c2\|.\|.\|.\&
1009 Characters
1010 .IR c1 ,
1011 .IR c2 ,\|.\|.\|.\&
1012 have properties determined by
1013 .IR n ,
1014 which is ORed from the following:
1017 .IP 1
1018 The character ends sentences (initially characters
1019 .B .?!\&
1020 have this property).
1022 .IP 2
1023 Lines can be broken before the character (initially no characters have
1024 this property); a line will not be broken at a character with this
1025 property unless the characters on each side both have non-zero
1026 hyphenation codes.
1028 .IP 4
1029 Lines can be broken after the character (initially characters
1030 .B \-\[rs](hy\[rs](em
1031 have this property); a line will not be broken at a character with
1032 this property unless the characters on each side both have non-zero
1033 hyphenation codes.
1035 .IP 8
1036 The character overlaps horizontally (initially characters
1037 .B \[rs](ul\[rs](rn\[rs](ru
1038 have this property).
1040 .IP 16
1041 The character overlaps vertically (initially character
1042 .B \[rs](br
1043 has this property).
1045 .IP 32
1046 An end-of-sentence character followed by any number of characters with
1047 this property will be treated as the end of a sentence if followed by
1048 a newline or two spaces; in other words the character is transparent
1049 for the purposes of end-of-sentence recognition; this is the same as
1050 having a zero space factor in \*[tx] (initially characters
1051 .B \[dq]')]*\[rs](dg\[rs](rq
1052 have this property).
1056 .BI .char\  c\ string
1057 Define character
1058 .I c
1059 to be
1060 .IR string .
1061 Every time character
1062 .I c
1063 needs to be printed,
1064 .I string
1065 will be processed in a temporary environment and the result will be
1066 wrapped up into a single object.
1068 Compatibility mode will be turned off and the escape character will be
1069 set to
1070 .B \[rs]
1071 while
1072 .I string
1073 is being processed.
1075 Any emboldening, constant spacing or track kerning will be applied to
1076 this object rather than to individual characters in
1077 .IR string .
1080 A character defined by this request can be used just like a normal
1081 character provided by the output device.
1083 In particular other characters can be translated to it with the
1084 .B tr
1085 request; it can be made the leader character by the
1086 .B lc
1087 request; repeated patterns can be drawn with the character using the
1088 .B \[rs]l
1090 .B \[rs]L
1091 escape sequences; words containing the character can be hyphenated
1092 correctly, if the
1093 .B hcode
1094 request is used to give the character a hyphenation code.
1097 There is a special anti-recursion feature: use of character within the
1098 character's definition will be handled like normal characters not
1099 defined with
1100 .BR char .
1102 A character definition can be removed with the
1103 .B rchar
1104 request.
1107 .BI .chop\  xx
1108 Chop the last character off macro, string, or diversion
1109 .IR xx .
1110 This is useful for removing the newline from the end of diversions
1111 that are to be interpolated as strings.
1114 .BI .close\  stream
1115 Close the stream named
1116 .IR stream ;
1117 .I stream
1118 will no longer be an acceptable argument to the
1119 .B write
1120 request.
1122 See the
1123 .B open
1124 request.
1127 .B .continue
1128 Finish the current iteration of a while loop.
1130 See also the
1131 .B while
1133 .B break
1134 requests.
1137 .BI .cp\  n
1139 .I n
1140 is non-zero or missing, enable compatibility mode, otherwise disable
1143 In compatibility mode, long names are not recognised, and the
1144 incompatibilities caused by long names do not arise.
1147 .BI .defcolor\  xxx\ scheme\ color_components
1148 Define color.
1149 .I scheme
1150 can be one of the following values:
1151 .B rgb
1152 (three components),
1153 .B cym
1154 (three components),
1155 .B cmyk
1156 (four components), and
1157 .B gray
1159 .B grey
1160 (one component).
1162 Color components can be given either as a hexadecimal string or as
1163 positive decimal integers in the range 0-65535.
1165 A hexadecimal string contains all color components concatenated; it
1166 must start with either
1167 .B #
1169 .BR ## .
1170 The former specifies hex values in the range 0-255 (which are
1171 internally multiplied by\~257), the latter in the range 0-65535.
1173 Examples: #FFC0CB (pink), ##ffff0000ffff (magenta).
1175 A new scaling indicator\~\c
1176 .B f
1177 has been introduced which multiplies its value by\~65536; this makes
1178 it convenient to specify color components as fractions in the range 0
1179 to\~1.
1181 Example:
1185 .ft CB
1186 .Text .defcolor darkgreen rgb 0.1f 0.5f 0.2f
1192 Note that
1193 .B f
1194 is the default scaling indicator for the
1195 .B defcolor
1196 request, thus the above statement is equivalent to
1200 .ft CB
1201 .Text .defcolor darkgreen rgb 0.1 0.5 0.2
1207 The color named
1208 .B default
1209 (which is device-specific) can't be redefined.
1211 It is possible that the default color for
1212 .esc M
1214 .esc m
1215 is not the same.
1218 .BI .dei\  xx\ yy
1219 Define macro indirectly.
1221 The following example
1225 .ne 2v+\n(.Vu
1226 .ft CB
1228 .Text .ds xx aa
1229 .Text .ds yy bb
1230 .Text .dei xx yy
1236 is equivalent to
1240 .ft CB
1241 .Text .de aa bb
1247 .BI .de1\  xx\ yy
1248 Similar to
1249 .BR .de , 
1250 but compatibility mode is switched off during execution.
1252 On entry, the current compatibility mode is saved and restored at exit.
1255 .BI .do\  xxx
1256 Interpret
1257 .I .xxx
1258 with compatibility mode disabled.
1260 For example,
1265 .ft CB
1266 .Text .do fam T
1271 would have the same effect as
1274 .ft CB
1275 .Text .fam T
1280 except that it would work even if compatibility mode had been enabled.
1282 Note that the previous compatibility mode is restored before any files
1283 sourced by
1284 .I xxx
1285 are interpreted.
1290 .BI .ds1\  xx\ yy
1291 Similar to
1292 .BR .ds , 
1293 but compatibility mode is switched off during expansion.
1295 To be more precise, a `compatibility save' token is inserted at the
1296 beginning of the string, and a `compatibility restore' token at the end.
1299 .B .ecs
1300 Save current escape character.
1303 .B .ecr
1304 Restore escape character saved with
1305 .BR ecs .
1306 Without a previous call to
1307 .BR ecs ,
1308 .RB ` \[rs] '
1309 will be the new escape character.
1312 .BI .evc\  xx
1313 Copy the contents of environment
1314 .I xx
1315 to the current environment.
1317 No pushing or popping of environments will be done.
1320 .BI .fam\  xx
1321 Set the current font family to
1322 .IR xx .
1323 The current font family is part of the current environment.
1325 .I xx
1326 is missing, switch back to previous font family.
1328 The value at start-up is `T'.
1330 See the description of the
1331 .B sty
1332 request for more information on font families.
1335 .BI .fchar\  c\ string
1336 Define fallback character
1337 .I c
1338 to be
1339 .IR string .
1340 The syntax of this request is the same as the
1341 .B char
1342 request; the only difference is that a character defined with
1343 .B char
1344 hides the glyph with the same name in the current font, whereas a
1345 character defined with
1346 .B fchar
1347 is checked only if the particular glyph isn't found in the current font.
1349 This test happens before checking special fonts.
1352 .BI .fspecial\  f\ s1\ s2\|.\|.\|.\&
1353 When the current font is
1354 .IR f ,
1355 fonts
1356 .IR s1 ,
1357 .IR s2 ,\|.\|.\|.\&
1358 will be special, that is, they will searched for characters not in
1359 the current font.
1361 Any fonts specified in the
1362 .B special
1363 request will be searched after fonts specified in the
1364 .B fspecial
1365 request.
1368 .BI .ftr\  f\ g
1369 Translate font
1370 .I f
1372 .IR g .
1373 Whenever a font named
1374 .I f
1375 is referred to in an
1376 .B \[rs]f
1377 escape sequence, or in the
1378 .BR ft ,
1379 .BR ul ,
1380 .BR bd ,
1381 .BR cs ,
1382 .BR tkf ,
1383 .BR special ,
1384 .BR fspecial ,
1385 .BR fp ,
1387 .BR sty
1388 requests, font
1389 .I g
1390 will be used.
1392 .I g
1393 is missing, or equal to
1394 .I f
1395 then font
1396 .I f
1397 will not be translated.
1400 .BI .hcode \ c1\ code1\ c2\ code2\|.\|.\|.\&
1401 Set the hyphenation code of character
1402 .I c1
1404 .I code1
1405 and that of
1406 .I c2
1408 .IR code2 .
1409 A hyphenation code must be a single input character (not a special
1410 character) other than a digit or a space.
1412 Initially each lower-case letter \%a-z has a hyphenation code, which is
1413 itself, and each upper-case letter \%A-Z has a hyphenation code which is
1414 the lower-case version of itself.
1416 See also the
1417 .B hpf
1418 request.
1421 .BI .hla\  lang
1422 Set the current hyphenation language to
1423 .IR lang .
1424 Hyphenation exceptions specified with the
1425 .B hw
1426 request and hyphenation patterns specified with the
1427 .B hpf
1428 request are both associated with the current hyphenation language.
1431 .B hla
1432 request is usually invoked by the
1433 .B troffrc
1434 file.
1437 .BI .hlm\  n
1438 Set the maximum number of consecutive hyphenated lines to\~\c
1439 .IR n .
1441 .I n
1442 is negative, there is no maximum.
1444 The default value is\~\-1.
1446 This value is associated with the current environment.
1448 Only lines output from an environment count towards the maximum
1449 associated with that environment.
1451 Hyphens resulting from
1452 .B \[rs]%
1453 are counted; explicit hyphens are not.
1456 .BI .hpf\  file
1457 Read hyphenation patterns from
1458 .IR file ;
1459 this will be searched for in the same way that
1460 .IB name .tmac
1461 is searched for when the
1462 .BI \-m name
1463 option is specified.
1465 It should have the same format as (simple) \*[tx] patterns files.
1467 More specifically, the following scanning rules are implemented.
1470 .IP \[bu]
1471 A percent sign starts a comment (up to the end of the line) even if
1472 preceded by a backslash.
1474 .IP \[bu]
1475 No support for `digraphs' like
1476 .BR \[rs]$ .
1478 .IP \[bu]
1479 .BI ^^ xx
1480 .RI ( x
1481 is 0-9 or a-f) and
1482 .BI ^^ x
1483 (character code of\~\c
1484 .I x
1485 in the range 0-127) are recognized; other use of
1486 .B ^
1487 causes an error.
1489 .IP \[bu]
1490 No macro expansion.
1492 .IP \[bu]
1493 .B hpf
1494 checks for the expression
1495 .B \[rs]patterns{.\|.\|.}
1496 (possibly with whitespace before and after the braces).
1498 Everything between the braces is taken as hyphenation patterns.
1500 Consequently,
1501 .B {
1503 .B }
1504 are not allowed in patterns.
1506 .IP \[bu]
1507 Similarly,
1508 .B \[rs]hyphenation{.\|.\|.}
1509 gives a list of hyphenation exceptions.
1511 .IP \[bu]
1512 .B \[rs]endinput
1513 is recognized also.
1515 .IP \[bu]
1516 For backwards compatibility, if
1517 .B \[rs]patterns
1518 is missing, the whole file is treated as a list of hyphenation patterns
1519 (only recognizing the
1520 .BR % \~\c
1521 character as the start of a comment).
1525 Use the
1526 .B hpfcode
1527 request to map the encoding used in hyphenation patterns files to
1528 .BR groff 's
1529 input encoding.
1531 The set of hyphenation patterns is associated with the current language
1532 set by the
1533 .B hla
1534 request.
1537 .B hpf
1538 request is usually invoked by the
1539 .B troffrc
1540 file; a second call replaces the old patterns with the new ones.
1543 .BI .hpfa\  file
1544 The same as
1545 .B hpf
1546 except that the hyphenation patterns from
1547 .I file
1548 are appended to the patterns already loaded in the current language.
1551 .BI .hpfcode\  a\ b\ c\ d\ .\|.\|.
1552 After reading a hyphenation patterns file with the
1553 .B hpf
1555 .B hpfa
1556 request, convert all characters with character code\~\c
1557 .I a
1558 in the recently read patterns to character code\~\c
1559 .IR b ,
1560 character code\~\c
1561 .I c
1562 to\~\c
1563 .IR d ,
1564 etc.
1566 Initially, all character codes map to themselves.
1568 The arguments of
1569 .B hpfcode
1570 must be integers in the range 0 to\~255.
1572 Note that it is even possible to use character codes which are invalid in
1573 .B groff
1574 otherwise.
1577 .BI .hym\  n
1578 Set the
1579 .I hyphenation margin
1580 to\~\c
1581 .IR n :
1582 when the current adjustment mode is not\~\c
1583 .BR b ,
1584 the line will not be hyphenated if the line is no more than
1585 .I n
1586 short.
1588 The default hyphenation margin is\~0.
1590 The default scaling indicator for this request is\~\c
1591 .IR m .
1592 The hyphenation margin is associated with the current environment.
1594 The current hyphenation margin is available in the
1595 .B \[rs]n[.hym]
1596 register.
1599 .BI .hys\  n
1600 Set the
1601 .I hyphenation space
1602 to\~\c
1603 .IR n :
1604 when the current adjustment mode is\~\c
1605 .B b
1606 don't hyphenate the line if the line can be justified by adding no
1607 more than
1608 .I n
1609 extra space to each word space.
1611 The default hyphenation space is\~0.
1613 The default scaling indicator for this request is\~\c
1614 .BR m .
1615 The hyphenation space is associated with the current environment.
1617 The current hyphenation space is available in the
1618 .B \[rs]n[.hys]
1619 register.
1622 .BI .itc\  n\ macro
1623 Variant of
1624 .B .it
1625 for which a line interrupted with
1626 .B \[rs]c
1627 counts as one input line.
1630 .BI .kern\  n
1632 .I n
1633 is non-zero or missing, enable pairwise kerning, otherwise disable it.
1636 .BI .length\  xx\ string
1637 Compute the length of
1638 .I string
1639 and return it in the number register
1640 .I xx
1641 (which is not necessarily defined before).
1644 .BI .linetabs\  n
1646 .I n
1647 is non-zero or missing, enable line-tabs mode, otherwise disable it
1648 (which is the default).
1650 In line-tabs mode, tab distances are computed relative to the
1651 (current) output line.
1653 Otherwise they are taken relative to the input line.
1655 For example, the following
1659 .ne 6v+\n(.Vu
1660 .ft CB
1662 .Text .ds x a\[rs]t\[rs]c
1663 .Text .ds y b\[rs]t\[rs]c
1664 .Text .ds z c
1665 .Text .ta 1i 3i
1666 .Text \[rs]*x
1667 .Text \[rs]*y
1668 .Text \[rs]*z
1674 yields
1678 a         b         c
1682 In line-tabs mode, the same code gives
1686 a         b                   c
1690 Line-tabs mode is associated with the current environment; the
1691 read-only number register
1692 .B \\[rs]n[.linetabs]
1693 is set to\~1 if in line-tabs mode, and 0 otherwise.
1696 .BI .mso\  file
1697 The same as the
1698 .B so
1699 request except that
1700 .I file
1701 is searched for in the same directories as macro files for the the
1702 .B \-m
1703 command line option.
1705 If the file name to be included has the form
1706 .IB name .tmac
1707 and it isn't found,
1708 .B mso
1709 tries to include
1710 .BI tmac. name
1711 instead and vice versa.
1714 .BI .nop \ anything
1715 Execute
1716 .IR anything .
1717 This is similar to `.if\ 1'.
1720 .B .nroff
1721 Make the
1722 .B n
1723 built-in condition true and the
1724 .B t
1725 built-in condition false.
1727 This can be reversed using the
1728 .B troff
1729 request.
1732 .BI .open\  stream\ filename
1733 Open
1734 .I filename
1735 for writing and associate the stream named
1736 .I stream
1737 with it.
1739 See also the
1740 .B close
1742 .B write
1743 requests.
1745 .TP 
1746 .BI .opena\  stream\ filename
1747 Like
1748 .BR open ,
1749 but if
1750 .I filename
1751 exists, append to it instead of truncating it.
1754 .BI .output\  string
1755 Emit
1756 .I string
1757 directly to the intermediate output (subject to copy-mode interpretation);
1758 this is similar to
1759 .B \[rs]!
1760 used at the top level.
1762 An initial double quote in
1763 .I string
1764 is stripped off to allow initial blanks.
1767 .B .pnr
1768 Print the names and contents of all currently defined number registers
1769 on stderr.
1772 .BI .psbb \ filename
1773 Get the bounding box of a PostScript image
1774 .IR filename .
1775 This file must conform to Adobe's Document Structuring Conventions;
1776 the command looks for a
1777 .B \%%%BoundingBox
1778 comment to extract the bounding box values.
1780 After a successful call, the coordinates (in PostScript units) of the
1781 lower left and upper right corner can be found in the registers
1782 .BR \[rs]n[llx] ,
1783 .BR \[rs]n[lly] ,
1784 .BR \[rs]n[urx] ,
1786 .BR \[rs]n[ury] ,
1787 respectively.
1789 If some error has occurred, the four registers are set to zero.
1792 .BI .pso \ command
1793 This behaves like the
1794 .B so
1795 request except that input comes from the standard output of
1796 .IR command .
1799 .B .ptr
1800 Print the names and positions of all traps (not including input line
1801 traps and diversion traps) on stderr.
1803 Empty slots in the page trap list are printed as well, because they
1804 can affect the priority of subsequently planted traps.
1807 .BI .pvs \ \[+-]n
1808 Set the post-vertical line space to
1809 .IR n ;
1810 default scale indicator is\~\c
1811 .BR p .
1813 This value will be added to each line after it has been output.
1815 With no argument, the post-vertical line space is set to its previous
1816 value.
1819 The total vertical line spacing consists of four components:
1820 .B .vs
1822 .B \[rs]x
1823 with a negative value which are applied before the line is output, and
1824 .B .pvs
1826 .B \[rs]x
1827 with a positive value which are applied after the line is output.
1830 .BI .rchar\  c1\ c2\|.\|.\|.\&
1831 Remove the definitions of characters
1832 .IR c1 ,
1833 .IR c2 ,\|.\|.\|.
1834 This undoes the effect of a
1835 .B char
1836 request.
1839 .B .return
1840 Within a macro, return immediately.
1842 No effect otherwise.
1845 .B .rj
1847 .BI .rj \~n
1848 Right justify the next
1849 .IR n \~\c
1850 input lines.
1852 Without an argument right justify the next input line.
1854 The number of lines to be right justified is available in the
1855 .B \[rs]n[.rj]
1856 register.
1858 This implicitly does
1859 .BR .ce \~0 .
1861 .B ce
1862 request implicitly does
1863 .BR .rj \~0 .
1866 .BI .rnn \ xx\ yy
1867 Rename number register
1868 .I xx
1870 .IR yy .
1873 .BI .shc\  c
1874 Set the soft hyphen character to
1875 .IR c .
1877 .I c
1878 is omitted, the soft hyphen character will be set to the default
1879 .BR \[rs](hy .
1880 The soft hyphen character is the character which will be inserted when
1881 a word is hyphenated at a line break.
1883 If the soft hyphen character does not exist in the font of the
1884 character immediately preceding a potential break point, then the line
1885 will not be broken at that point.
1887 Neither definitions (specified with the
1888 .B char
1889 request) nor translations (specified with the
1890 .B tr
1891 request) are considered when finding the soft hyphen character.
1894 .BI .shift\  n
1895 In a macro, shift the arguments by
1896 .I n
1897 positions: argument\~\c
1898 .I i
1899 becomes argument
1900 .IR i \- n ;
1901 arguments 1 to\~\c
1902 .I n
1903 will no longer be available.
1906 .I n
1907 is missing, arguments will be shifted by\~1.
1909 Shifting by negative amounts is currently undefined.
1912 .BI .sizes\  s1\ s2\|.\|.\|.\|sn\  [0]
1913 This command is similar to the
1914 .B sizes
1915 command of a
1916 .B DESC
1917 file.
1919 It sets the available font sizes for the current font to
1920 .IR s1 ,
1921 .IR s2 ,\|.\|.\|.\|,\~ sn
1922 scaled points.
1924 The list of sizes can be terminated by an optional\~\c
1925 .BR 0 .
1927 Each
1928 .I si
1929 can also be a range of sizes
1930 .IR m - n .
1932 Contrary to the font file command, the list can't extend over more
1933 than a single line.
1936 .BI .special\  s1\ s2\|.\|.\|.\&
1937 Fonts
1938 .IR s1 ,
1939 .IR s2 ,
1940 are special and will be searched for characters not in the current
1941 font.
1944 .BI .spreadwarn\  limit
1945 Make
1946 .B troff
1947 emit a warning if the additional space inserted for each space between
1948 words in an output line is larger or equal to
1949 .IR limit .
1951 A negative value is changed to zero; no argument toggles the warning on
1952 and off without changing
1953 .IR limit .
1955 The default scaling indicator is\~\c
1956 .BR m .
1958 At startup,
1959 .B spreadwarn
1960 is deactivated, and
1961 .I limit
1962 is set to 3m.
1964 For example,
1965 .B .spreadwarn\ 0.2m
1966 will cause a warning if
1967 .B troff
1968 must add 0.2m or more for each interword space in a line.
1970 This request is active only if text is justified to both margins (using
1971 .BR .ad\ b ).
1974 .BI .sty\  n\ f
1975 Associate style\~\c
1976 .I f
1977 with font position\~\c
1978 .IR n .
1979 A font position can be associated either with a font or with a style.
1981 The current font is the index of a font position and so is also either
1982 a font or a style.
1984 When it is a style, the font that is actually used is the font the
1985 name of which is the concatenation of the name of the current family
1986 and the name of the current style.
1988 For example, if the current font is\~1 and font position\~1 is
1989 associated with style\~\c
1990 .B R
1991 and the current font family is\~\c
1992 .BR T ,
1993 then font
1994 .BR TR
1995 will be used.
1997 If the current font is not a style, then the current family is ignored.
1999 When the requests
2000 .BR cs ,
2001 .BR bd ,
2002 .BR tkf ,
2003 .BR uf ,
2005 .B fspecial
2006 are applied to a style, then they will instead be applied to the
2007 member of the current family corresponding to that style.
2009 The default family can be set with the
2010 .B \-f
2011 option.
2014 .B styles
2015 command in the
2016 .SM DESC
2017 file controls which font positions (if any) are initially associated
2018 with styles rather than fonts.
2021 .BI .substring\  xx\ n1\  [ n2 ]
2022 Replace the string in register
2023 .I xx
2024 with the substring defined by the indices
2025 .I n1
2027 .IR n2 .
2028 The first character in the string has index one.
2031 .I n2
2032 is omitted, it is taken to be equal to the string's length.
2034 If the index value
2035 .I n1
2037 .I n2
2038 is negative or zero, it will be counted from the end of the string,
2039 going backwards:
2041 The last character has index\~0, the character before the last
2042 character has index\~-1, etc.
2045 .BI .tkf\  f\ s1\ n1\ s2\ n2
2046 Enable track kerning for font
2047 .IR f .
2048 When the current font is
2049 .I f
2050 the width of every character will be increased by an amount between
2051 .I n1
2053 .IR n2 ;
2054 when the current point size is less than or equal to
2055 .I s1
2056 the width will be increased by
2057 .IR n1 ;
2058 when it is greater than or equal to
2059 .I s2
2060 the width will be increased by
2061 .IR n2 ;
2062 when the point size is greater than or equal to
2063 .I s1
2064 and less than or equal to
2065 .I s2
2066 the increase in width is a linear function of the point size.
2069 .BI .tm1\  string
2070 Similar to the
2071 .B tm
2072 request,
2073 .I string
2074 is read in copy mode and written on the standard error, but an initial
2075 double quote in
2076 .I string
2077 is stripped off to allow initial blanks.
2080 .BI .tmc\  string
2081 Similar to
2082 .B tm1
2083 but without writing a final newline.
2086 .BI .trf\  filename
2087 Transparently output the contents of file
2088 .IR filename .
2089 Each line is output as if preceded by
2090 .BR \[rs]! ;
2091 however, the lines are not subject to copy-mode interpretation.
2093 If the file does not end with a newline, then a newline will be added.
2095 For example, you can define a macro\~\c
2096 .I x
2097 containing the contents of file\~\c
2098 .IR f ,
2099 using
2103 .ne 2v+\n(.Vu
2104 .ft CB
2106 .Text .di x
2107 .Text .trf f
2108 .Text .di
2114 Unlike with the
2115 .B cf
2116 request, the file cannot contain characters such as
2117 .SM NUL
2118 that are not legal troff input characters.
2121 .BI .trin\  abcd
2122 This is the same as the
2123 .B tr
2124 request except that the
2125 .B asciify
2126 request will use the character code (if any) before the character
2127 translation.
2129 Example:
2134 .ft CB
2135 .Text .trin ax
2136 .Text .di xxx
2137 .Text a
2138 .Text .br
2139 .Text .di
2140 .Text .xxx
2141 .Text .trin aa
2142 .Text .asciify xxx
2143 .Text .xxx
2149 The result is
2150 .BR x\ a .
2152 Using
2153 .BR tr ,
2154 the result would be
2155 .BR x\ x .
2158 .BI .trnt\  abcd
2159 This is the same as the
2160 .B tr
2161 request except that the translations do not apply to text that is
2162 transparently throughput into a diversion with
2163 .BR \[rs]! .
2164 For example,
2169 .ft CB
2170 .Text .tr ab
2171 .Text .di x
2172 .Text \[rs]!.tm a
2173 .Text .di
2174 .Text .x
2180 will print\~\c
2181 .BR b ;
2183 .B trnt
2184 is used instead of
2185 .B tr
2186 it will print\~\c
2187 .BR a .
2191 .B .troff
2192 Make the
2193 .B n
2194 built-in condition false, and the
2195 .B t
2196 built-in condition true.
2198 This undoes the effect of the
2199 .B nroff
2200 request.
2203 .BI .unformat\  xx
2204 This request `unformats' the diversion
2205 .IR xx .
2206 Contrary to the
2207 .B .asciify
2208 request, which tries to convert formatted elements of the diversion
2209 back to input tokens as much as possible,
2210 .B .unformat
2211 will only handle tabs and spaces between words (usually caused by
2212 spaces or newlines in the input) specially.
2214 The former are treated as if they were input tokens, and the latter
2215 are stretchable again.
2217 Note that the vertical size of lines is not preserved.
2219 Glyph information (font, font size, space width, etc.) is retained.
2221 Useful in conjunction with the
2222 .B .box
2224 .B .boxa
2225 requests.
2228 .BI .vpt\  n
2229 Enable vertical position traps if
2230 .I n
2231 is non-zero, disable them otherwise.
2233 Vertical position traps are traps set by the
2234 .B wh
2236 .B dt
2237 requests.
2239 Traps set by the
2240 .B it
2241 request are not vertical position traps.
2243 The parameter that controls whether vertical position traps are
2244 enabled is global.
2246 Initially vertical position traps are enabled.
2249 .BI .warn\  n
2250 Control warnings.
2251 .I n
2252 is the sum of the numbers associated with each warning that is to be
2253 enabled; all other warnings will be disabled.
2255 The number associated with each warning is listed in
2256 .BR @g@troff (@MAN1EXT@).
2258 For example,
2259 .B .warn\~0
2260 will disable all warnings, and
2261 .B .warn\~1
2262 will disable all warnings except that about missing characters.
2265 .I n
2266 is not given, all warnings will be enabled.
2269 .BI .warnscale\  si
2270 Set the scaling indicator used in warnings to
2271 .IR si .
2273 Valid values for
2274 .I si
2276 .BR u ,
2277 .BR i ,
2278 .BR c ,
2279 .BR p ,
2281 .BR P .
2283 At startup, it is set to\~\c
2284 .BR i .
2287 .BI .while \ c\ anything
2288 While condition\~\c
2289 .I c
2290 is true, accept
2291 .I anything
2292 as input;
2293 .IR c \~\c
2294 can be any condition acceptable to an
2295 .B if
2296 request;
2297 .I anything
2298 can comprise multiple lines if the first line starts with
2299 .B \[rs]{
2300 and the last line ends with
2301 .BR \[rs]} .
2302 See also the
2303 .B break
2305 .B continue
2306 requests.
2309 .BI .write\  stream\ anything
2310 Write
2311 .I anything
2312 to the stream named
2313 .IR stream .
2314 .I stream
2315 must previously have been the subject of an
2316 .B open
2317 request.
2318 .I anything
2319 is read in copy mode;
2320 a leading\~\c
2321 .B \[dq]
2322 will be stripped.
2325 .BI .writec\  stream\ anything
2326 Similar to
2327 .B write
2328 but without writing a final newline.
2331 .BI .writem\  stream\ xx
2332 Write the contents of the macro or string
2333 .I xx
2334 to the stream named
2335 .IR stream .
2336 .I stream
2337 must previously have been the subject of an
2338 .B open
2339 request.
2340 .I xx
2341 is read in copy mode.
2344 .\" --------------------------------------------------------------------
2345 .SS "Extended requests"
2346 .\" --------------------------------------------------------------------
2349 .BI .cf\  filename
2350 When used in a diversion, this will embed in the diversion an object
2351 which, when reread, will cause the contents of
2352 .I filename
2353 to be transparently copied through to the output.
2355 In UNIX troff, the contents of
2356 .I filename
2357 is immediately copied through to the output regardless of whether
2358 there is a current diversion; this behaviour is so anomalous that it
2359 must be considered a bug.
2362 .BI .ev\  xx
2364 .I xx
2365 is not a number, this will switch to a named environment called
2366 .IR xx .
2367 The environment should be popped with a matching
2368 .B ev
2369 request without any arguments, just as for numbered environments.
2371 There is no limit on the number of named environments; they will be
2372 created the first time that they are referenced.
2375 .BI .ss\  m\ n
2376 When two arguments are given to the
2377 .B ss
2378 request, the second argument gives the
2379 .IR "sentence space size" .
2380 If the second argument is not given, the sentence space size
2381 will be the same as the word space size.
2383 Like the word space size, the sentence space is in units of
2384 one twelfth of the spacewidth parameter for the current font.
2386 Initially both the word space size and the sentence
2387 space size are\~12.
2389 Contrary to UNIX troff, GNU troff handles this request in nroff mode
2390 also; a given value is then rounded down to the nearest multiple
2391 of\~12.
2393 The sentence space size is used in two circumstances.
2395 If the end of a sentence occurs at the end of a line in fill mode,
2396 then both an inter-word space and a sentence space will be added; if
2397 two spaces follow the end of a sentence in the middle of a line, then
2398 the second space will be a sentence space.
2400 Note that the behaviour of UNIX troff will be exactly that exhibited
2401 by GNU troff if a second argument is never given to the
2402 .B ss
2403 request.
2405 In GNU troff, as in UNIX troff, you should always follow a sentence
2406 with either a newline or two spaces.
2409 .BI .ta\  n1\ n2\|.\|.\|.nn \ T\  r1\ r2\|.\|.\|.\|rn
2410 Set tabs at positions
2411 .IR n1 ,
2412 .IR n2 ,\|.\|.\|.\|,
2413 .I nn
2414 and then set tabs at
2415 .IR nn + r1 ,
2416 .IR nn + r2 ,\|.\|.\|.\|,
2417 .IR nn + rn
2418 and then at
2419 .IR nn + rn + r1 ,
2420 .IR nn + rn + r2 ,\|.\|.\|.\|,
2421 .IR nn + rn + rn ,
2422 and so on.
2423 For example,
2427 .ft CB
2428 .Text .ta T .5i
2433 will set tabs every half an inch.
2437 .\" --------------------------------------------------------------------
2438 .SS "New number registers"
2439 .\" --------------------------------------------------------------------
2441 The following read-only registers are available:
2444 .B \[rs]n[.C]
2445 1\~if compatibility mode is in effect, 0\~otherwise.
2448 .B \[rs]n[.cdp]
2449 The depth of the last character added to the current environment.
2451 It is positive if the character extends below the baseline.
2454 .B \[rs]n[.ce]
2455 The number of lines remaining to be centered, as set by the
2456 .B ce
2457 request.
2460 .B \[rs]n[.cht]
2461 The height of the last character added to the current environment.
2463 It is positive if the character extends above the baseline.
2466 .B \[rs]n[.csk]
2467 The skew of the last character added to the current environment.
2470 .I skew
2471 of a character is how far to the right of the center of a character
2472 the center of an accent over that character should be placed.
2475 .B \[rs]n[.ev]
2476 The name or number of the current environment.
2478 This is a string-valued register.
2481 .B \[rs]n[.fam]
2482 The current font family.
2484 This is a string-valued register.
2487 .B \[rs]n[.fn]
2488 The current (internal) real font name.
2490 This is a string-valued register.
2492 If the current font is a style, the value of
2493 .B \[rs]n[.fn]
2494 is the proper concatenation of family and style name.
2497 .B \[rs]n[.fp]
2498 The number of the next free font position.
2501 .B \[rs]n[.g]
2502 Always\~1.
2504 Macros should use this to determine whether they are running under GNU
2505 troff.
2508 .B \[rs]n[.hla]
2509 The current hyphenation language as set by the
2510 .B hla
2511 request.
2514 .B \[rs]n[.hlc]
2515 The number of immediately preceding consecutive hyphenated lines.
2518 .B \[rs]n[.hlm]
2519 The maximum allowed number of consecutive hyphenated lines, as set by
2521 .B hlm
2522 request.
2525 .B \[rs]n[.hy]
2526 The current hyphenation flags (as set by the
2527 .B hy
2528 request).
2531 .B \[rs]n[.hym]
2532 The current hyphenation margin (as set by the
2533 .B hym
2534 request).
2537 .B \[rs]n[.hys]
2538 The current hyphenation space (as set by the
2539 .B hys
2540 request).
2543 .B \[rs]n[.in]
2544 The indent that applies to the current output line.
2547 .B \[rs]n[.int]
2548 Set to a positive value if last output line is interrupted (i.e., if
2549 it contains
2550 .IR \[rs]c ).
2553 .B \[rs]n[.kern]
2554 1\~if pairwise kerning is enabled, 0\~otherwise.
2557 .B \[rs]n[.lg]
2558 The current ligature mode (as set by the
2559 .B lg
2560 request).
2563 .B \[rs]n[.linetabs]
2564 The current line-tabs mode (as set by the
2565 .B linetabs
2566 request).
2569 .B \[rs]n[.ll]
2570 The line length that applies to the current output line.
2573 .B \[rs]n[.lt]
2574 The title length as set by the
2575 .B lt
2576 request.
2579 .B \[rs]n[.ne]
2580 The amount of space that was needed in the last
2581 .B ne
2582 request that caused a trap to be sprung.
2584 Useful in conjunction with the
2585 .B \[rs]n[.trunc]
2586 register.
2589 .B \[rs]n[.ns]
2590 1\~if no-space mode is active, 0\~otherwise.
2593 .B \[rs]n[.pn]
2594 The number of the next page, either the value set by a
2595 .B pn
2596 request, or the number of the current page plus\~1.
2599 .B \[rs]n[.ps]
2600 The current pointsize in scaled points.
2603 .B \[rs]n[.psr]
2604 The last-requested pointsize in scaled points.
2607 .B \[rs]n[.pvs]
2608 The current post-vertical line space as set with the
2609 .B pvs
2610 request.
2613 .B \[rs]n[.rj]
2614 The number of lines to be right-justified as set by the
2615 .B rj
2616 request.
2619 .B \[rs]n[.sr]
2620 The last requested pointsize in points as a decimal fraction.
2622 This is a string-valued register.
2625 .B \[rs]n[.ss]
2627 .B \[rs]n[.sss]
2628 These give the values of the parameters set by the first and second
2629 arguments of the
2630 .B ss
2631 request.
2634 .B \[rs]n[.tabs]
2635 A string representation of the current tab settings suitable for use
2636 as an argument to the
2637 .B ta
2638 request.
2641 .B \[rs]n[.trunc]
2642 The amount of vertical space truncated by the most recently sprung
2643 vertical position trap, or, if the trap was sprung by a
2644 .B ne
2645 request, minus the amount of vertical motion produced by the
2646 .B ne
2647 request.
2649 In  other  words, at the point  a  trap is  sprung,  it represents the
2650 difference of  what the vertical position  would have been but for the
2651 trap, and what the vertical position actually is.
2653 Useful in conjunction with the
2654 .B \[rs]n[.ne]
2655 register.
2658 .B \[rs]n[.vpt]
2659 1\~if vertical position traps are enabled, 0\~otherwise.
2662 .B \[rs]n[.warn]
2663 The sum of the numbers associated with each of the currently enabled
2664 warnings.
2666 The number associated with each warning is listed in
2667 .BR @g@troff (@MAN1EXT@).
2670 .B \[rs]n[.x]
2671 The major version number.
2673 For example, if the version number is 1.03, then
2674 .B \[rs]n[.x]
2675 will contain\~1.
2678 .B \[rs]n[.y]
2679 The minor version number.
2681 For example, if the version number is 1.03, then
2682 .B \[rs]n[.y]
2683 will contain\~03.
2686 .B \[rs]n[.Y]
2687 The revision number of groff.
2690 .B \[rs]n[llx]
2692 .B \[rs]n[lly]
2694 .B \[rs]n[urx]
2696 .B \[rs]n[ury]
2697 These four registers are set by the
2698 .B .psbb
2699 request and contain the bounding box values (in PostScript units) of a
2700 given PostScript image.
2703 The following read/write registers are set by the
2704 .B \[rs]w
2705 escape sequence:
2708 .B \[rs]n[rst]
2710 .B \[rs]n[rsb]
2711 Like the
2712 .B st
2714 .B sb
2715 registers, but take account of the heights and depths of characters.
2718 .B \[rs]n[ssc]
2719 The amount of horizontal space (possibly negative) that should be
2720 added to the last character before a subscript.
2723 .B \[rs]n[skw]
2724 How far to right of the center of the last character in the
2725 .B \[rs]w
2726 argument, the center of an accent from a roman font should be placed
2727 over that character.
2730 Other available read/write number registers are:
2733 .B \[rs]n[c.]
2734 The current input line number.
2735 .B \[rs]n[.c]
2736 is a read-only alias to this register.
2739 .B \[rs]n[hp]
2740 The current horizontal position at input line.
2743 .B \[rs]n[systat]
2744 The return value of the system() function executed by the last
2745 .B sy
2746 request.
2749 .B \[rs]n[slimit]
2750 If greater than\~0, the maximum number of objects on the input stack.
2752 If less than or equal to\~0, there is no limit on the number of
2753 objects on the input stack.
2755 With no limit, recursion can continue until virtual memory is
2756 exhausted.
2759 .B \[rs]n[year]
2760 The current year.
2762 Note that the traditional
2763 .B troff
2764 number register
2765 .B \[rs]n[yr]
2766 is the current year minus 1900.
2769 .\" --------------------------------------------------------------------
2770 .SS Miscellaneous
2771 .\" --------------------------------------------------------------------
2773 .B @g@troff
2774 predefines a single (read/write) string-based register,
2775 .BR \[rs]*(.T ,
2776 which contains the argument given to the
2777 .B -T
2778 command line option, namely the current output device (for example,
2779 .I latin1
2781 .IR ascii ).
2782 Note that this is not the same as the (read-only) number register
2783 .B \[rs]n[.T]
2784 which is defined to be\~1 if
2785 .B troff
2786 is called with the
2787 .B -T
2788 command line option, and zero otherwise.
2790 This behaviour is different to UNIX troff.
2793 Fonts not listed in the
2794 .SM DESC
2795 file are automatically mounted on the next available font position
2796 when they are referenced.
2798 If a font is to be mounted explicitly with the
2799 .B fp
2800 request on an unused font position, it should be mounted on the first
2801 unused font position, which can be found in the
2802 .B \[rs]n[.fp]
2803 register; although
2804 .B troff
2805 does not enforce this strictly, it will not allow a font to be mounted
2806 at a position whose number is much greater than that of any currently
2807 used position.
2810 Interpolating a string does not hide existing macro arguments.
2812 Thus in a macro, a more efficient way of doing
2815 .BI . xx\  \[rs]\[rs]$@
2820 .BI \[rs]\[rs]*[ xx ]\[rs]\[rs]  
2823 If the font description file contains pairwise kerning information,
2824 characters from that font will be kerned.
2826 Kerning between two characters can be inhibited by placing a
2827 .B \[rs]&
2828 between them.
2831 In a string comparison in a condition, characters that appear at
2832 different input levels to the first delimiter character will not be
2833 recognised as the second or third delimiters.
2835 This applies also to the
2836 .B tl
2837 request.
2839 In a
2840 .B \[rs]w
2841 escape sequence, a character that appears at a different input level
2842 to the starting delimiter character will not be recognised as the
2843 closing delimiter character.
2845 The same is true for
2846 .BR \[rs]A ,
2847 .BR \[rs]b ,
2848 .BR \[rs]B ,
2849 .BR \[rs]C ,
2850 .BR \[rs]l ,
2851 .BR \[rs]L ,
2852 .BR \[rs]o ,
2853 .BR \[rs]X ,
2855 .BR \[rs]Z .
2857 When decoding a macro argument that is delimited by double quotes, a
2858 character that appears at a different input level to the starting
2859 delimiter character will not be recognised as the closing delimiter
2860 character.
2862 The implementation of
2863 .B \[rs]$@
2864 ensures that the double quotes surrounding an argument will appear the
2865 same input level, which will be different to the input level of the
2866 argument itself.
2868 In a long escape name
2869 .B ]
2870 will not be recognized as a closing delimiter except when it occurs at
2871 the same input level as the opening
2872 .BR ] .
2874 In compatibility mode, no attention is paid to the input-level.
2877 There are some new types of condition:
2880 .BI .if\ r xxx
2881 True if there is a number register named
2882 .IR xxx .
2885 .BI .if\ d xxx
2886 True if there is a string, macro, diversion, or request named
2887 .IR xxx .
2890 .BI .if\ m xxx
2891 True if there is a color named
2892 .IR xxx .
2895 .BI .if\ c ch
2896 True if there is a character
2897 .IR ch
2898 available;
2899 .I ch
2900 is either an
2901 .SM ASCII
2902 character or a special character
2903 .BI \[rs]( xx
2905 .BI \[rs][ xxx ]\f[R];
2906 the condition will also be true if
2907 .I ch
2908 has been defined by the
2909 .B char
2910 request.
2914 .B tr
2915 request can now map characters onto
2916 .BR \[rs]~ .
2919 It is now possible to have whitespace between the first and second dot
2920 (or the name of the ending macro) to end a macro definition.
2922 Example:
2925 .ne 6v+\n(.Vu
2926 .ft CB
2928 .Text .de foo
2929 .Text .  nop Hello, I'm `foo'.
2930 .Text .  nop I will now define `bar'.
2931 .Text .  de bar
2932 .Text .    nop Hello, I'm `bar'.
2933 .Text .  .
2934 .Text .  nop Done.
2935 .Text ..
2936 .Text .foo
2937 .Text .bar
2941 .\" --------------------------------------------------------------------
2942 .SH "INTERMEDIATE OUTPUT FORMAT"
2943 .\" --------------------------------------------------------------------
2945 This section describes the format output by GNU troff.
2947 The output format used by GNU troff is very similar to that used
2948 by Unix device-independent troff.
2950 Only the differences are documented here.
2953 .\" --------------------------------------------------------------------
2954 .SS "Units"
2955 .\" --------------------------------------------------------------------
2957 The argument to the
2958 .B s
2959 command is in scaled points (units of
2960 .IR points/ n ,
2961 where
2962 .I n
2963 is the argument to the
2964 .B sizescale
2965 command  in the DESC file).
2967 The argument to the
2968 .B x\ Height
2969 command is also in scaled points.
2972 .\" --------------------------------------------------------------------
2973 .SS "Text Commands"
2974 .\" --------------------------------------------------------------------
2977 .BI N n
2978 Print character with index\~\c
2979 .I n
2980 (a non-negative integer) of the current font.
2983 If the
2984 .B tcommand
2985 line is present in the DESC file, troff will use the following two
2986 commands.
2989 .BI t xxx
2990 .I xxx
2991 is any sequence of characters terminated by a space or a newline; the
2992 first character should be printed at the current position, the current
2993 horizontal position should be increased by the width of the first
2994 character, and so on for each character.
2996 The width of the character is that given in the font file,
2997 appropriately scaled for the current point size, and rounded so that
2998 it is a multiple of the horizontal resolution.
3000 Special characters cannot be printed using this command.
3003 .BI u n\ xxx
3004 This is same as the
3005 .B t
3006 command except that after printing each character, the current
3007 horizontal position is increased by the sum of the width of that
3008 character and
3009 .IR n .
3012 Note that single characters can have the eighth bit set, as can the
3013 names of fonts and special characters.
3016 The names of characters and fonts can be of arbitrary length; drivers
3017 should not assume that they will be only two characters long.
3020 When a character is to be printed, that character will always be
3021 in the current font.
3023 Unlike device-independent troff, it is not necessary for drivers to
3024 search special fonts to find a character.
3027 For color support, some new commands have been added:
3030 .Text \f[B]mc \f[I]cyan magenta yellow\f[R]
3032 .Text \f[B]md\f[R]
3034 .Text \f[B]mg \f[I]gray\f[R]
3036 .Text \f[B]mk \f[I]cyan magenta yellow black\f[R]
3038 .Text \f[B]mr \f[I]red green blue\f[R]
3039 Set the color components of the current drawing color, using various
3040 color schemes.
3042 .B md
3043 resets the drawing color to the default value.
3045 The arguments are integers in the range 0 to 65536.
3049 .B x
3050 device control command has been extended.
3053 .Text \f[B]x u \f[I]n\f[R]
3055 .I n
3056 is\~1, start underlining of spaces.
3059 .I n
3060 is\~0, stop underlining of spaces.
3062 This is needed for the
3063 .B cu
3064 request in nroff mode and is ignored otherwise.
3067 .\" --------------------------------------------------------------------
3068 .SS "Drawing Commands"
3069 .\" --------------------------------------------------------------------
3072 .B D
3073 drawing command has been extended.
3075 These extensions will not be used by GNU pic if the
3076 .B \-n
3077 option is given.
3080 .Text \f[B]Df \f[I]n\f[R]\*[ic]\[rs]n
3081 Set the shade of gray to be used for filling solid objects to
3082 .IR n ;
3083 .I n
3084 must be an integer between 0 and 1000, where 0 corresponds solid white
3085 and 1000 to solid black, and values in between correspond to
3086 intermediate shades of gray.
3088 This applies only to solid circles, solid ellipses and solid
3089 polygons.
3091 By default, a level of 1000 will be used.
3093 Whatever color a solid object has, it should completely obscure
3094 everything beneath it.
3096 A value greater than 1000 or less than 0 can also be used: this means
3097 fill with the shade of gray that is currently being used for lines and
3098 text.
3100 Normally this will be black, but some drivers may provide a way of
3101 changing this.
3104 .Text \f[B]DC \f[I]d\f[R]\*[ic]\[rs]n
3105 Draw a solid circle with a diameter of
3106 .I d
3107 with the leftmost point at the current position.
3110 .Text \f[B]DE \f[I]dx dy\f[R]\*[ic]\[rs]n
3111 Draw a solid ellipse with a horizontal diameter of
3112 .I dx
3113 and a vertical diameter of
3114 .I dy
3115 with the leftmost point at the current position.
3117 delim $$
3121 .Text \f[B]Dp\f[R] $dx sub 1$ $dy sub 1$ $dx sub 2$ $dy sub 2$ $...$ $dx sub n$ $dy sub n$\[rs]n
3122 Draw a polygon with, for $i = 1 ,..., n+1$, the
3123 .IR i -th
3124 vertex at the current position 
3126 $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$.
3128 At the moment, GNU pic only uses this command to generate triangles
3129 and rectangles.
3132 .Text \f[B]DP\f[R] $dx sub 1$ $dy sub 1$ $dx sub 2$ $dy sub 2$ $...$ $dx sub n$ $dy sub n$\[rs]n
3134 Like
3135 .B Dp
3136 but draw a solid rather than outlined polygon.
3139 .Text \f[B]Dt \f[I]n\f[R]\*[ic]\[rs]n
3140 Set the current line thickness to
3141 .I n
3142 machine units.
3144 Traditionally Unix troff drivers use a line thickness proportional to
3145 the current point size; drivers should continue to do this if no
3146 .B Dt
3147 command has been given, or if a
3148 .B Dt
3149 command has been given with a negative value of
3150 .IR n .
3151 A zero value of
3152 .I n
3153 selects the smallest available line thickness.
3156 A difficulty arises in how the current position should be changed after
3157 the execution of these commands.
3159 This is not of great importance since the code generated by GNU pic
3160 does not depend on this.
3162 Given a drawing command of the form
3164 \f[B]\[rs]D\[fm]\f[I]c\f[R] $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ $x sub n$ $y sub n$\[fm]
3167 where
3168 .I c
3169 is not one of
3170 .BR c ,
3171 .BR e ,
3172 .BR l ,
3173 .BR a ,
3175 .BR ~ ,
3176 Unix troff will treat each of the $x sub i$ as a horizontal quantity,
3177 and each of the $y sub i$ as a vertical quantity and will assume that
3178 the width of the drawn object is $sum from i=1 to n x sub i$,
3179 and that the height is $sum from i=1 to n y sub i$.
3181 (The assumption about the height can be seen by examining the
3182 .B st
3184 .B sb
3185 registers after using such a
3186 .B D
3187 command in a \[rs]w escape sequence).
3189 This rule also holds for all the original drawing commands with the
3190 exception of
3191 .BR De .
3192 For the sake of compatibility GNU troff also follows this rule, even
3193 though it produces an ugly result in the case of the
3194 .BR Dt ,
3195 and, to a lesser extent,
3196 .B DE
3197 commands.
3199 Thus after executing a
3200 .B D
3201 command of the form
3203 \f[B]D\f[I]c\f[R] $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ \c
3204 $x sub n$ $y sub n$\[rs]n
3207 the current position should be increased by
3209 $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
3212 Another set of extensions is
3215 .Text \f[B]DFc \f[I]cyan magenta yellow\f[R]\*[ic]\[rs]n
3217 .Text \f[B]DFd\f[R]\*[ic]\[rs]n
3219 .Text \f[B]DFg \f[I]gray\f[R]\*[ic]\[rs]n
3221 .Text \f[B]DFk \f[I]cyan magenta yellow black\f[R]\*[ic]\[rs]n
3223 .Text \f[B]DFr \f[I]red green blue\f[R]\*[ic]\[rs]n
3224 Set the color components of the filling color similar to the
3225 .B m
3226 commands above.
3229 Note that
3230 .B Df
3231 is now mapped onto
3232 .BR DFg .
3233 The current position isn't changed by those colour commands.
3236 .\" --------------------------------------------------------------------
3237 .SS "Device Control Commands"
3238 .\" --------------------------------------------------------------------
3240 There is a continuation convention which permits the argument to the
3241 .B x\ X
3242 command to contain newlines: when outputting the argument to the
3243 .B x\ X
3244 command, GNU troff will follow each newline in the argument with a
3245 .B +
3246 character (as usual, it will terminate the entire argument with a
3247 newline); thus if the line after the line containing the
3248 .B x\ X
3249 command starts with
3250 .BR + ,
3251 then the newline ending the line containing the
3252 .B x\ X
3253 command should be treated as part of the argument to the
3254 .B x\ X
3255 command, the
3256 .B +
3257 should be ignored, and the part of the line following the
3258 .B +
3259 should be treated like the part of the line following the
3260 .B x\ X
3261 command.
3264 The first three output commands are guaranteed to be:
3266 .BI x\ T\  device
3268 .BI x\ res\  n\ h\ v
3270 .B x init
3273 .\" --------------------------------------------------------------------
3274 .SH INCOMPATIBILITIES
3275 .\" --------------------------------------------------------------------
3277 In spite of the many extensions, groff has retained compatibility to
3278 classical troff to a large degree.
3280 For the cases where the extensions lead to collisions, a special
3281 compatibility mode with the restricted, old functionality was created
3282 for groff.
3285 .\" --------------------------------------------------------------------
3286 .SS "Groff Language"
3287 .\" --------------------------------------------------------------------
3289 .I groff
3290 provides a
3291 .B compatibility mode
3292 that allows to process roff code written for classical
3293 .troff
3294 or for other implementations of roff in a consistent way.
3297 Compatibility mode can be turned on with the
3298 .option \-C
3299 command line option, and turned on or off with the
3300 .request .cp
3301 request.
3303 The number register
3304 .esc n(.C
3305 is\~1 if compatibility mode is on, 0\~otherwise.
3308 This became necessary because the GNU concept for long names causes
3309 some incompatibilities.
3310 .I Classical troff
3311 interprets
3313 .request .dsabcd
3316 as defining a string
3317 .B ab
3318 with contents
3319 .BR cd .
3321 .IR groff
3322 mode, this will be considered as a call of a macro named
3323 .request dsabcd .
3326 Also
3327 .I classical troff
3328 interprets
3329 .esc *[
3331 .esc n[
3332 as references to a string or number register called
3333 .request [
3334 while
3335 .I groff
3336 takes this as the start of a long name.
3340 .IR "compatibility mode" ,
3341 groff interprets these things in the traditional way; so long
3342 names are not recognized.
3345 On the other hand, groff in
3346 .I GNU native mode
3347 does not allow to use the single-character escapes
3348 .esc \[rs]
3349 (backslash),
3350 .esc |
3351 (vertical bar),
3352 .esc ^
3353 (caret),
3354 .esc &
3355 (ampersand),
3356 .esc {
3357 (opening brace),
3358 .esc }
3359 (closing brace),
3360 .squoted "\[rs]\ "
3361 (space),
3362 .esc '
3363 (single quote),
3364 .esc `
3365 (backquote),
3366 .esc \-
3367 (minus),
3368 .esc _
3369 (underline),
3370 .esc !
3371 (bang),
3372 .esc %
3373 (percent),
3375 .esc c
3376 (character c) in names of strings, macros, diversions, number
3377 registers, fonts or environments, whereas
3378 .I classical troff
3379 does.
3383 .esc A
3384 escape sequence can be helpful in avoiding these escape sequences in
3385 names.
3388 Fractional pointsizes cause one noteworthy incompatibility.
3391 .I classical
3392 .IR troff ,
3394 .request ps
3395 request ignores scale indicators and so
3398 .B .ps\~10u
3402 will set the pointsize to 10\~points, whereas in groff native mode the
3403 pointsize will be set to 10\~scaled points.
3407 .I groff
3408 mode, there is a fundamental difference between unformatted input
3409 characters, and formatted output characters.
3411 Everything that affects how an output character will be output is
3412 stored with the character; once an output character has been
3413 constructed it is unaffected by any subsequent requests that are
3414 executed, including the
3415 .request bd ,
3416 .request cs ,
3417 .request tkf ,
3418 .request tr ,
3420 .request fp
3421 requests.
3424 Normally output characters are constructed from input characters at
3425 the moment immediately before the character is added to the current
3426 output line.
3428 Macros, diversions and strings are all, in fact, the same type of
3429 object; they contain lists of input characters and output characters
3430 in any combination.
3433 An output character does not behave like an input character for the
3434 purposes of macro processing; it does not inherit any of the special
3435 properties that the input character from which it was constructed
3436 might have had.
3438 The following example will make things clearer.
3443 .ft CB
3444 .Text .di x
3445 .Text \[rs]\[rs]\[rs]\[rs]
3446 .Text .br
3447 .Text .di
3448 .Text .x
3455 .I GNU mode
3456 this will be printed as
3457 .esc \[rs] .
3458 So each pair of input backslashes
3459 .squoted \[rs]\[rs]
3460 is turned into a single output backslash
3461 .squoted \[rs]
3462 and the resulting output backslashes are not interpreted as escape
3463 characters when they are reread.
3466 .I Classical troff
3467 would interpret them as escape characters when they were reread and
3468 would end up printing a single backslash
3469 .squoted \[rs] .
3472 In GNU, the correct way to get a printable version of the backslash
3473 character
3474 .squoted \[rs]
3475 is the
3476 .esc (rs
3477 escape sequence, but classical troff does not provide a clean feature
3478 for getting a non-syntactical backslash.
3480 A close method is the printable version of the current escape
3481 character using the
3482 .esc e
3483 escape sequence; this works if the current escape character is not
3484 redefined.
3486 It works in both GNU mode and compatibility mode, while dirty tricks
3487 like specifying a sequence of multiple backslashes do not work
3488 reliably; for the different handling in diversions, macro definitions,
3489 or text mode quickly leads to a confusion about the necessary number of
3490 backslashes.
3493 To store an escape sequence in a diversion that will be interpreted
3494 when the diversion is reread, either the traditional
3495 .esc !
3496 transparent output facility or the
3498 .esc ?
3499 escape sequence can be used.
3502 .\" --------------------------------------------------------------------
3503 .SS "Intermediate Output"
3504 .\" --------------------------------------------------------------------
3506 The groff intermediate output format is in a state of evolution.
3508 So far it has some incompatibilities, but it is intended to establish
3509 a full compatibility to the classical troff output format.
3511 Actually the following incompatibilities exist:
3513 .Topic
3514 The positioning after the drawing of the polygons conflicts with the
3515 classical definition.
3517 .Topic
3518 The intermediate output cannot be rescaled to other devices as
3519 classical "device-independent" troff did.
3522 .\" --------------------------------------------------------------------
3523 .SH AUTHORS
3524 .\" --------------------------------------------------------------------
3526 Copyright (C) 1989, 2001, 2002 Free Software Foundation, Inc.
3529 This document is distributed under the terms of the FDL (GNU Free
3530 Documentation License) version 1.1 or later.
3532 You should have received a copy of the FDL on your system, it is also
3533 available on-line at the
3534 .URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
3536 This document was written by James Clark, with modifications by
3537 .MTO wl@gnu.org "Werner Lemberg"
3539 .MTO bwarken@mayn.de "Bernd Warken" .
3542 This document is part of
3543 .IR groff ,
3544 the GNU roff distribution.
3546 Formerly, the contents of this document was kept in the manual
3547 page
3548 .BR @g@troff (@MAN1EXT@).
3549 Only the parts dealing with the language aspects of the different
3550 .I roff
3551 systems were carried over into this document.
3554 .I troff
3555 command line options and warnings are still documented in
3556 .BR @g@troff (@MAN1EXT@).
3558 .\" --------------------------------------------------------------------
3559 .SH "SEE ALSO"
3560 .\" --------------------------------------------------------------------
3563 .I groff info
3564 .IR file ,
3565 cf.\&
3566 .BR info (1)
3567 presents all groff documentation within a single document.
3570 .BR groff (@MAN1EXT@)
3571 A list of all documentation around
3572 .IR groff .
3575 .BR groff (@MAN7EXT@)
3576 A description of the
3577 .I groff
3578 language, including a short, but complete reference of all predefined
3579 requests, registers, and escapes of plain
3580 .IR groff .
3581 From the command line, this is called using
3584 .ShellCommand man\~7\~groff
3587 .BR roff (@MAN7EXT@)
3588 A survey of
3589 .I roff
3590 systems, including pointers to further historical documentation.
3593 .RI [ CSTR\~#54\/ ]
3595 .I Nroff/\:Troff User's Manual
3597 .I J.\& F.\& Osanna
3598 of 1976 in the revision of
3599 .I Brian Kernighan
3600 of 1992, being the
3601 .URL http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz \
3602      "classical troff documentation" .
3605 .\" --------------------------------------------------------------------
3606 .\" Emacs variables
3607 .\" --------------------------------------------------------------------
3609 .\" Local Variables:
3610 .\" mode: nroff
3611 .\" End: