o Added TOC (finally) and a nearly complete set of associated
[s-roff.git] / man / groff_diff.man
blob11b4efe7f5dd757b7cc48f510ca6dca4ff38a466
1 '\" e
2 .\" The above line should force the use of eqn as a preprocessor
3 .ig
4 groff_diff.man
6 Last update : 15 May 2003
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, 2003 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
51 .eo
53 .de c
56 .de TQ
57 .  br
58 .  ns
59 .  TP \$1
61 .de Text
62 .  RI "\$*"
64 .de Topic
65 .  TP 2m
66 .  Text \[bu]
68 .de squoted
69 .  ds @arg1 \$1
70 .  shift
71 .\"  Text \[oq]\f[CB]\*[@arg1]\f[]\[cq]\$*
72 .  Text \[oq]\f[B]\*[@arg1]\f[]\[cq]\$*
73 .  rm @arg1
75 .c A shell command line
76 .de ShellCommand
77 .  br
78 .  IR "shell#" "\h'1m'\f[CB]\$*\f[]\/"
80 .c reference of a request or macro
81 .de request
82 .  ds @arg1 \$1
83 .  shift 1
84 .\"  Text \f[CB]\*[@arg1]\f[]\$*
85 .  Text \f[B]\*[@arg1]\f[]\$*
86 .  rm @arg1
88 .als option request
90 .c representation of an escape sequence
91 .de esc
92 .  ds @arg1 \$1
93 .  shift
94 .\"  Text \f[CB]\[rs]\*[@arg1]\f[]\$*
95 .  Text \f[B]\[rs]\*[@arg1]\&\f[]\$*
96 .  rm @arg1
98 .ec
99 .\" end of macro definitions
101 .\" from old groff_out.man
102 .ie \n(.g \
103 .  ds ic \/
104 .el \
105 .  ds ic \^
108 .\" --------------------------------------------------------------------
109 .\" Title
110 .\" --------------------------------------------------------------------
112 .TH GROFF_DIFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
113 .SH NAME
114 groff_diff \- differences between GNU troff and classical troff
117 .\" --------------------------------------------------------------------
118 .SH DESCRIPTION
119 .\" --------------------------------------------------------------------
121 This manual page describes the language differences between
122 .IR groff ,
123 the GNU
124 .I roff
125 text processing system and the classical
126 .I roff
127 formatter of the freely available Unix\~7 of the 1970s, documented in
129 .I Troff User's Manual
131 .I Osanna
133 .IR Kernighan .
134 This inludes the roff language as well as the intermediate output
135 format (troff output).
138 The section
139 .I SEE ALSO
140 gives pointers to both the classical
141 .I roff
142 and the modern
143 .I groff
144 documentation.
147 .\" --------------------------------------------------------------------
148 .SH "GROFF LANGUAGE"
149 .\" --------------------------------------------------------------------
151 In this section, all additional features of
152 .I groff
153 compared to the classical Unix\~7
154 .I troff
155 are described in detail.
158 .\" --------------------------------------------------------------------
159 .SS "Long names"
160 .\" --------------------------------------------------------------------
162 The names of number registers, fonts, strings/\:macros/\:diversions,
163 special characters (glyphs), and colors can be of any length.
165 In escape sequences, additionally to the classical
166 .BI ( xx
167 construction for a two-character name, you can use
168 .BI [ xxx ]
169 for a name of arbitrary length.
172 .BI \[rs][ xxx ]
173 Print the special character (glyph) called
174 .IR xxx .
177 .BI \[rs][ "comp1 comp2 .\|.\|." ]
178 Print composite glyph consisting of multiple components.
180 Example: `\[rs][A\~ho]' is capital letter A with ogonek which finally maps
181 to glyph name `u0041_0328'.
183 See the
184 .I groff info file
185 for details how a glyph name for a composite glyph is constructed, and
186 .BR groff_char (@MAN7EXT@)
187 for list of glyph name components used composite glyph names.
190 .BI \[rs]f[ xxx ]
191 Set font
192 .IR xxx .
194 Additionally,
195 .B \[rs]f[]
196 is a new syntax equal to
197 .BR \[rs]fP ,
198 i.e., to return to the previous font.
201 .BI \[rs]*[ "xxx arg1 arg2 .\|.\|." ]
202 Interpolate string
203 .IR xxx ,
204 taking
205 .IR arg1 ,
206 .IR arg2 ,
207 .I .\|.\|.\&
208 as arguments.
211 .BI \[rs]n[ xxx ]
212 Interpolate number register
213 .IR xxx .
216 .\" --------------------------------------------------------------------
217 .SS "Fractional pointsizes"
218 .\" --------------------------------------------------------------------
221 .I scaled point
222 is equal to
223 .B 1/sizescale
224 points, where
225 .B sizescale
226 is specified in the
227 .B DESC
228 file (1 by default).
230 There is a new scale indicator
231 .B z
232 that has the effect of multiplying by sizescale.
234 Requests and escape sequences in troff interpret arguments that
235 represent a pointsize as being in units of scaled points, but they
236 evaluate each such argument using a default scale indicator of
237 .BR z .
238 Arguments treated in this way are the argument to the
239 .B ps
240 request, the third argument to the
241 .B cs
242 request, the second and fourth arguments to the
243 .B tkf
244 request, the argument to the
245 .B \[rs]H
246 escape sequence, and those variants of the
247 .B \[rs]s
248 escape sequence that take a numeric expression as their argument.
251 For example, suppose sizescale is 1000; then a scaled point will be
252 equivalent to a millipoint; the call
253 .B .ps\ 10.25
254 is equivalent to
255 .B .ps\ 10.25z
256 and so sets the pointsize to 10250 scaled points, which is equal to
257 10.25 points.
260 The number register
261 .B \[rs]n[.s]
262 returns the pointsize in points as decimal fraction.
264 There is also a new number register
265 .B \[rs]n[.ps]
266 that returns the pointsize in scaled points.
269 It would make no sense to use the
270 .B z
271 scale indicator in a numeric expression whose default scale indicator
272 was neither
273 .B u
275 .BR z ,
276 and so
277 .B troff
278 disallows this.
280 Similarly it would make no sense to use a scaling indicator other than
281 .B z
283 .B u
284 in a numeric expression whose default scale indicator was
285 .BR z ,
286 and so
287 .B troff
288 disallows this as well.
291 There is also new scale indicator\~\c
292 .B s
293 which multiplies by the number of units in a scaled point.
295 So, for example,
296 .B \[rs]n[.ps]s
297 is equal to
298 .BR 1m .
299 Be sure not to confuse the
300 .B s
302 .B z
303 scale indicators.
306 .\" --------------------------------------------------------------------
307 .SS "Numeric expressions"
308 .\" --------------------------------------------------------------------
310 Spaces are permitted in a number expression within parentheses.
313 .B M
314 indicates a scale of 100ths of an em.
315 .B f
316 indicates a scale of 65536 units, providing fractions for color
317 definitions with the
318 .B defcolor
319 request.
321 For example, 0.5f = 32768u.
324 .IB e1 >? e2
325 The maximum of
326 .I e1
328 .IR e2 .
331 .IB e1 <? e2
332 The minimum of
333 .I e1
335 .IR e2 .
338 .BI ( c ; e )
339 Evaluate
340 .I e
341 using
342 .I c
343 as the default scaling indicator.
346 .I c
347 is missing, ignore scaling indicators in the evaluation of
348 .IR e .
351 .\" --------------------------------------------------------------------
352 .SS "New escape sequences"
353 .\" --------------------------------------------------------------------
356 .BI \[rs]A' anything '
357 This expands to
358 .B 1
360 .B 0
361 resp., depending on whether
362 .I anything
363 is or is not acceptable as the name of a string, macro, diversion, number
364 register, environment, font, or color.
365 It will return\~\c
366 .B 0
368 .I anything
369 is empty.
371 This is useful if you want to lookup user input in some sort of
372 associative table.
375 .BI \[rs]B' anything '
376 This expands to
377 .B 1
379 .B 0
380 resp., depending on whether
381 .I anything
382 is or is not a valid numeric expression.
384 It will return\~\c
385 .B 0
387 .I anything
388 is empty.
391 .BI \[rs]C' xxx '
392 Typeset glyph named
393 .IR xxx .
394 Normally it is more convenient to use
395 .BI \[rs][ xxx ]\f[R].
397 .B \[rs]C
398 has the advantage that it is compatible with recent versions of
399 .SM UNIX
400 and is available in compatibility mode.
403 .B \[rs]E
404 This is equivalent to an escape character, but it is not interpreted in
405 copy-mode.
407 For example, strings to start and end superscripting could be defined
408 like this
412 .ft CB
413 .Text .ds { \[rs]v'\-.3m'\[rs]s'\[rs]En[.s]*6u/10u'
415 .Text .ds } \[rs]s0\[rs]v'.3m'
419 The use of
420 .B \[rs]E
421 ensures that these definitions will work even if
422 .B \[rs]*{
423 gets interpreted in copy-mode (for example, by being used in a macro
424 argument).
428 .BI \[rs]F f
430 .BI \[rs]F( fm
432 .BI \[rs]F[ fam ]
433 Change font family.
435 This is the same as the
436 .B fam
437 request.
439 .B \[rs]F[]
440 switches back to the previous color (note that
441 .B \[rs]FP
442 won't work; it selects font family `P' instead).
445 .BI \[rs]m x
447 .BI \[rs]m( xx
449 .BI \[rs]m[ xxx ]
450 Set drawing color.
451 .B \[rs]m[]
452 switches back to the previous color.
455 .BI \[rs]M x
457 .BI \[rs]M( xx
459 .BI \[rs]M[ xxx ]
460 Set background color for filled objects drawn with the
461 .BI \[rs]D' .\|.\|. '
462 commands.
463 .B \[rs]M[]
464 switches back to the previous color.
467 .BI \[rs]N' n '
468 Typeset the glyph with index
469 .I n
470 in the current font.
471 .I n
472 can be any integer.
474 Most devices only have glyphs with indices between 0 and 255.
476 If the current font does not contain a glyph with that code,
477 special fonts will
478 .I not
479 be searched.
482 .B \[rs]N
483 escape sequence can be conveniently used in conjunction with the
484 .B char
485 request, for example
488 .ft CB
490 .Text .char \[rs][phone] \[rs]f(ZD\[rs]N'37'
495 The index of each glyph is given in the fourth column in the font
496 description file after the
497 .B charset
498 command.
500 It is possible to include unnamed glyphs in the font description
501 file by using a name of
502 .BR \-\-\- ;
504 .B \[rs]N
505 escape sequence is the only way to use these.
508 .BI \[rs]O n
510 .BI \[rs]O[ n ]
511 Suppressing troff output.
513 The escapes
514 .BR \[rs]02 ,
515 .BR \[rs]O3 ,
516 .BR \[rs]O4 ,
518 .B \[rs]O5
519 are intended for internal use by
520 .BR \%grohtml .
524 .B \[rs]O0
525 Disable any ditroff glyphs from being emitted to the device driver,
526 provided that the escape occurs at the outer level (see
527 .B \[rs]O3
529 .BR \[rs]O4 ).
532 .B \[rs]O1
533 Enable output of glyphs, provided that the escape occurs at the outer
534 level.
536 .B \[rs]O0
538 .B \[rs]O1
539 also reset the registers
540 .BR \[rs]n[opminx] ,
541 .BR \[rs]n[opminy] ,
542 .BR \[rs]n[opmaxx] ,
544 .B \[rs]n[opmaxy]
545 to\~-1.
547 These four registers mark the top left and bottom right hand corners
548 of a box which encompasses all written glyphs.
551 .B \[rs]O2
552 Provided that the escape occurs at the outer level, enable output of
553 glyphs and also write out to stderr the page number and four registers
554 encompassing the glyphs previously written since the last call to
555 .BR \[rs]O .
558 .B \[rs]O3
559 Begin a nesting level.
561 At start-up,
562 .B troff
563 is at outer level.
565 This is really an internal mechanism for
566 .B \%grohtml
567 while producing images.
569 They are generated by running the troff source through
570 .B troff
571 to the postscript device and
572 .B ghostscript
573 to produce images in PNG format.
576 .B \[rs]O3
577 escape will start a new page if the device is not html (to reduce the
578 possibility of images crossing a page boundary).
581 .B \[rs]O4
582 End a nesting level.
585 .BI \[rs]O5[ Pfilename ]
586 This escape is
587 .B \%grohtml
588 specific.
590 Provided that this escape occurs at the outer nesting level, write
591 .I filename
592 to stderr.
594 The position of the image,
595 .IR P ,
596 must be specified and must be one of l, r, c, or i (left, right,
597 centered, inline).
599 .I filename
600 will be associated with the production of the next inline image.
604 .BI \[rs]R' name\ \[+-]n '
605 This has the same effect as
609 .BI .nr\  name\ \[+-]n
613 .BI \[rs]s( nn
615 .BI \[rs]s\[+-]( nn
616 Set the point size to
617 .I nn
618 points;
619 .I nn
620 must be exactly two digits.
623 .BI \[rs]s[\[+-] n ]
625 .BI \[rs]s\[+-][ n ]
627 .BI \[rs]s'\[+-] n '
629 .BI \[rs]s\[+-]' n '
630 Set the point size to
631 .I n
632 scaled points;
633 .I n
634 is a numeric expression with a default scale indicator of\~\c
635 .BR z .
638 .BI \[rs]V x
640 .BI \[rs]V( xx
642 .BI \[rs]V[ xxx ]
643 Interpolate the contents of the environment variable
644 .IR xxx ,
645 as returned by
646 .BR getenv (3).
647 .B \[rs]V
648 is interpreted in copy-mode.
651 .BI \[rs]Y x
653 .BI \[rs]Y( xx
655 .BI \[rs]Y[ xxx ]
656 This is approximately equivalent to
657 .BI \[rs]X'\[rs]*[ xxx ]'\f[R].
658 However the contents of the string or macro
659 .I xxx
660 are not interpreted; also it is permitted for
661 .I xxx
662 to have been defined as a macro and thus contain newlines (it is not
663 permitted for the argument to
664 .B \[rs]X
665 to contain newlines).
667 The inclusion of newlines requires an extension to the UNIX troff
668 output format, and will confuse drivers that do not know about this
669 extension.
672 .BI \[rs]Z' anything '
673 Print anything and then restore the horizontal and vertical position;
674 .I anything
675 may not contain tabs or leaders.
678 .B \[rs]$0
679 The name by which the current macro was invoked.
682 .B als
683 request can make a macro have more than one name.
686 .B \[rs]$*
687 In a macro or string, the concatenation of all the arguments separated
688 by spaces.
691 .B \[rs]$@
692 In a macro or string, the concatenation of all the arguments with each
693 surrounded by double quotes, and separated by spaces.
696 .BI \[rs]$( nn
698 .BI \[rs]$[ nnn ]
699 In a macro or string, this gives the
700 .IR nn -th
702 .IR nnn -th
703 argument.
705 Macros and strings can have an unlimited number of arguments.
708 .BI \[rs]? anything \[rs]?
709 When used in a diversion, this will transparently embed
710 .I anything
711 in the diversion.
712 .I anything
713 is read in copy mode.
715 When the diversion is reread,
716 .I anything
717 will be interpreted.
718 .I anything
719 may not contain newlines; use
720 .B \[rs]!\&
721 if you want to embed newlines in a diversion.
723 The escape sequence
724 .B \[rs]?\&
725 is also recognised in copy mode and turned into a single internal
726 code; it is this code that terminates
727 .IR anything .
728 Thus
732 .ne 14v+\n(.Vu
733 .ft CB
735 .Text .nr x 1
736 .Text .nf
737 .Text .di d
738 .Text \[rs]?\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\c
739 .Text \[rs]nx\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]?\[rs]?
740 .Text .di
741 .Text .nr x 2
742 .Text .di e
743 .Text .d
744 .Text .di
745 .Text .nr x 3
746 .Text .di f
747 .Text .e
748 .Text .di
749 .Text .nr x 4
750 .Text .f
756 will print\~\c
757 .BR 4 .
760 .B \[rs]/
761 This increases the width of the preceding glyph so that the
762 spacing between that glyph and the following glyph will be
763 correct if the following glyph is a roman glyph.
765 .if t \{\
766 .  nop For example, if an italic f is immediately followed by a roman
767 .  nop right parenthesis, then in many fonts the top right portion of
768 .  nop the f will overlap the top left of the right parenthesis
769 .  nop producing \f[I]f\f[R])\f[R], which is ugly.
770 .  nop Inserting
771 .  B \[rs]/
772 .  nop produces
773 .  ie \n(.g \f[I]f\/\f[R])\f[R]
774 .  el       \f[I]f\|\f[R])\f[R]
775 .  nop and avoids this problem.
777 It is a good idea to use this escape sequence whenever an italic
778 glyph is immediately followed by a roman glyph without any
779 intervening space.
782 .B \[rs],
783 This modifies the spacing of the following glyph so that the
784 spacing between that glyph and the preceding glyph will
785 correct if the preceding glyph is a roman glyph.
787 .if t \{\
788 .  nop For example, inserting
789 .  B \[rs],
790 .  nop between the parenthesis and the f changes
791 .  nop \f[R](\f[I]f\f[R] to
792 .  ie \n(.g \f[R](\,\f[I]f\f[R].
793 .  el       \f[R](\^\f[I]f\f[R].
795 It is a good idea to use this escape sequence whenever a roman
796 glyph is immediately followed by an italic glyph without any
797 intervening space.
800 .B \[rs])
801 Like
802 .B \[rs]&
803 except that it behaves like a character declared with the
804 .B cflags
805 request to be transparent for the purposes of end-of-sentence
806 recognition.
809 .B \[rs]~
810 This produces an unbreakable space that stretches like a normal
811 inter-word space when a line is adjusted.
814 .B \[rs]:
815 This causes the insertion of a zero-width break point.
817 It is equal to
818 .B \[rs]%
819 within a word but without insertion of a soft hyphen character.
822 .B \[rs]#
823 Everything up to and including the next newline is ignored.
825 This is interpreted in copy mode.
827 It is like
828 .B \[rs]"
829 except that
830 .B \[rs]"
831 does not ignore the terminating newline.
834 .\" --------------------------------------------------------------------
835 .SS "New requests"
836 .\" --------------------------------------------------------------------
839 .BI .aln\  xx\ yy
840 Create an alias
841 .I xx
842 for number register object named
843 .IR yy .
844 The new name and the old name will be exactly equivalent.
847 .I yy
848 is undefined, a warning of type
849 .B reg
850 will be generated, and the request will be ignored.
853 .BI .als\  xx\ yy
854 Create an alias
855 .I xx
856 for request, string, macro, or diversion object named
857 .IR yy .
859 The new name and the old name will be exactly equivalent (it is
860 similar to a hard rather than a soft link).
863 .I yy
864 is undefined, a warning of type
865 .B mac
866 will be generated, and the request will be ignored.
869 .BR de ,
870 .BR am ,
871 .BR di ,
872 .BR da ,
873 .BR ds ,
875 .B as
876 requests only create a new object if the name of the macro, diversion
877 or string diversion is currently undefined or if it is defined to be a
878 request; normally they modify the value of an existing object.
881 .BI .ami\  xx\ yy
882 Append to macro indirectly.
884 See the
885 .B dei
886 request below for more information.
889 .BI .am1\  xx\ yy
890 Similar to
891 .BR .am , 
892 but compatibility mode is switched off during execution.
894 To be more precise, a `compatibility save' token is inserted at the
895 beginning of the macro addition, and a `compatibility restore' token at
896 the end.
898 As a consequence, the requests
899 .BR am ,
900 .BR am1 ,
901 .BR de ,
903 .B de1
904 can be intermixed freely since the compatibility save/\:restore tokens
905 only affect the macro parts defined by
906 .B .am1
908 .BR .ds1 .
911 .BI .asciify\  xx
912 This request `unformats' the diversion
913 .I xx
914 in such a way that
915 .SM ASCII
916 and space characters (and some escape sequences) that were formatted
917 and diverted into
918 .I xx
919 will be treated like ordinary input characters when
920 .I xx
921 is reread.
922 Useful for diversions in conjunction with the
923 .B .writem
924 request.
926 It can be also used for gross hacks; for example, this
930 .ne 7v+\n(.Vu
931 .ft CB
933 .Text .tr @.
934 .Text .di x
935 .Text @nr n 1
936 .Text .br
937 .Text .di
938 .Text .tr @@
939 .Text .asciify x
940 .Text .x
946 will set register\~\c
947 .B n
948 to\~1.
950 Note that glyph information (font, font size, etc.) is not preserved;
952 .B .unformat
953 instead.
956 .BI .as1\  xx\ yy
957 Similar to
958 .BR .as , 
959 but compatibility mode is switched off during expansion.
961 To be more precise, a `compatibility save' token is inserted at the
962 beginning of the string, and a `compatibility restore' token at the end.
964 As a consequence, the requests
965 .BR as ,
966 .BR as1 ,
967 .BR ds ,
969 .B ds1
970 can be intermixed freely since the compatibility save/\:restore tokens
971 only affect the (sub)strings defined by
972 .B as1
974 .BR ds1 .
977 .B .backtrace
978 Print a backtrace of the input stack on stderr.
981 .BI .blm\  xx
982 Set the blank line macro to
983 .IR xx .
984 If there is a blank line macro, it will be invoked when a blank line
985 is encountered instead of the usual troff behaviour.
988 .BI .box\  xx
990 .BI .boxa\  xx
991 These requests are similar to the
992 .B di
994 .B da
995 requests with the exception that a partially filled line will not
996 become part of the diversion (i.e., the diversion always starts with a
997 new line) but restored after ending the diversion, discarding the
998 partially filled line which possibly comes from the diversion.
1001 .B .break
1002 Break out of a while loop.
1004 See also the
1005 .B while
1007 .B continue
1008 requests.
1010 Be sure not to confuse this with the
1011 .B br
1012 request.
1015 .B .brp
1016 This is the same as
1017 .BR \[rs]p .
1020 .BI .cflags\  n\ c1\ c2\|.\|.\|.\&
1021 Characters
1022 .IR c1 ,
1023 .IR c2 ,\|.\|.\|.\&
1024 have properties determined by
1025 .IR n ,
1026 which is ORed from the following:
1029 .IP 1
1030 The character ends sentences (initially characters
1031 .B .?!\&
1032 have this property).
1034 .IP 2
1035 Lines can be broken before the character (initially no characters have
1036 this property); a line will not be broken at a character with this
1037 property unless the characters on each side both have non-zero
1038 hyphenation codes.
1040 .IP 4
1041 Lines can be broken after the character (initially characters
1042 .B \-\[rs][hy]\[rs][em]
1043 have this property); a line will not be broken at a character with
1044 this property unless the characters on each side both have non-zero
1045 hyphenation codes.
1047 .IP 8
1048 The character overlaps horizontally (initially characters
1049 .B \[rs][ul]\[rs][rn]\[rs][ru]\[rs][radicalex]\[rs][sqrtex]
1050 have this property).
1052 .IP 16
1053 The character overlaps vertically (initially character
1054 .B \[rs][br]
1055 has this property).
1057 .IP 32
1058 An end-of-sentence character followed by any number of characters with
1059 this property will be treated as the end of a sentence if followed by
1060 a newline or two spaces; in other words the character is transparent
1061 for the purposes of end-of-sentence recognition; this is the same as
1062 having a zero space factor in \*[tx] (initially characters
1063 .B \[dq]')]*\[rs](dg\[rs](rq
1064 have this property).
1068 .BI .char\  c\ string
1069 Define glyph
1070 .I c
1071 to be
1072 .IR string .
1073 Every time glyph
1074 .I c
1075 needs to be printed,
1076 .I string
1077 will be processed in a temporary environment and the result will be
1078 wrapped up into a single object.
1080 Compatibility mode will be turned off and the escape character will be
1081 set to
1082 .B \[rs]
1083 while
1084 .I string
1085 is being processed.
1087 Any emboldening, constant spacing or track kerning will be applied to
1088 this object rather than to individual glyphs in
1089 .IR string .
1092 A glyph defined by this request can be used just like a normal
1093 glyph provided by the output device.
1095 In particular other characters can be translated to it with the
1096 .B tr
1097 request; it can be made the leader character by the
1098 .B lc
1099 request; repeated patterns can be drawn with the character using the
1100 .B \[rs]l
1102 .B \[rs]L
1103 escape sequences; words containing the character can be hyphenated
1104 correctly, if the
1105 .B hcode
1106 request is used to give the character a hyphenation code.
1109 There is a special anti-recursion feature: Use of glyph within the
1110 glyph's definition will be handled like normal glyphs not
1111 defined with
1112 .BR char .
1114 A glyph definition can be removed with the
1115 .B rchar
1116 request.
1119 .BI .chop\  xx
1120 Chop the last element off macro, string, or diversion
1121 .IR xx .
1122 This is useful for removing the newline from the end of diversions
1123 that are to be interpolated as strings.
1126 .BI .close\  stream
1127 Close the stream named
1128 .IR stream ;
1129 .I stream
1130 will no longer be an acceptable argument to the
1131 .B write
1132 request.
1134 See the
1135 .B open
1136 request.
1139 .BI .composite\  glyph1\ glyph2
1140 Map glyph name
1141 .I glyph1
1142 to glyph name
1143 .I glyph2
1144 if it is used in
1145 .BI \[rs][ ... ]
1146 with more than one component.
1149 .B .continue
1150 Finish the current iteration of a while loop.
1152 See also the
1153 .B while
1155 .B break
1156 requests.
1159 .BI .color\  n
1161 .I n
1162 is non-zero or missing, enable colors (this is the default), otherwise
1163 disable them.
1166 .BI .cp\  n
1168 .I n
1169 is non-zero or missing, enable compatibility mode, otherwise disable
1172 In compatibility mode, long names are not recognised, and the
1173 incompatibilities caused by long names do not arise.
1176 .BI .defcolor\  xxx\ scheme\ color_components
1177 Define color.
1178 .I scheme
1179 can be one of the following values:
1180 .B rgb
1181 (three components),
1182 .B cym
1183 (three components),
1184 .B cmyk
1185 (four components), and
1186 .B gray
1188 .B grey
1189 (one component).
1191 Color components can be given either as a hexadecimal string or as
1192 positive decimal integers in the range 0-65535.
1194 A hexadecimal string contains all color components concatenated; it
1195 must start with either
1196 .B #
1198 .BR ## .
1199 The former specifies hex values in the range 0-255 (which are
1200 internally multiplied by\~257), the latter in the range 0-65535.
1202 Examples: #FFC0CB (pink), ##ffff0000ffff (magenta).
1204 A new scaling indicator\~\c
1205 .B f
1206 has been introduced which multiplies its value by\~65536; this makes
1207 it convenient to specify color components as fractions in the range 0
1208 to\~1.
1210 Example:
1214 .ft CB
1215 .Text .defcolor darkgreen rgb 0.1f 0.5f 0.2f
1221 Note that
1222 .B f
1223 is the default scaling indicator for the
1224 .B defcolor
1225 request, thus the above statement is equivalent to
1229 .ft CB
1230 .Text .defcolor darkgreen rgb 0.1 0.5 0.2
1236 The color named
1237 .B default
1238 (which is device-specific) can't be redefined.
1240 It is possible that the default color for
1241 .esc M
1243 .esc m
1244 is not the same.
1247 .BI .dei\  xx\ yy
1248 Define macro indirectly.
1250 The following example
1254 .ne 2v+\n(.Vu
1255 .ft CB
1257 .Text .ds xx aa
1258 .Text .ds yy bb
1259 .Text .dei xx yy
1265 is equivalent to
1269 .ft CB
1270 .Text .de aa bb
1276 .BI .de1\  xx\ yy
1277 Similar to
1278 .BR .de , 
1279 but compatibility mode is switched off during execution.
1281 On entry, the current compatibility mode is saved and restored at exit.
1284 .BI .do\  xxx
1285 Interpret
1286 .I .xxx
1287 with compatibility mode disabled.
1289 For example,
1294 .ft CB
1295 .Text .do fam T
1300 would have the same effect as
1303 .ft CB
1304 .Text .fam T
1309 except that it would work even if compatibility mode had been enabled.
1311 Note that the previous compatibility mode is restored before any files
1312 sourced by
1313 .I xxx
1314 are interpreted.
1319 .BI .ds1\  xx\ yy
1320 Similar to
1321 .BR .ds , 
1322 but compatibility mode is switched off during expansion.
1324 To be more precise, a `compatibility save' token is inserted at the
1325 beginning of the string, and a `compatibility restore' token at the end.
1328 .B .ecs
1329 Save current escape character.
1332 .B .ecr
1333 Restore escape character saved with
1334 .BR ecs .
1335 Without a previous call to
1336 .BR ecs ,
1337 .RB ` \[rs] '
1338 will be the new escape character.
1341 .BI .evc\  xx
1342 Copy the contents of environment
1343 .I xx
1344 to the current environment.
1346 No pushing or popping of environments will be done.
1349 .BI .fam\  xx
1350 Set the current font family to
1351 .IR xx .
1352 The current font family is part of the current environment.
1354 .I xx
1355 is missing, switch back to previous font family.
1357 The value at start-up is `T'.
1359 See the description of the
1360 .B sty
1361 request for more information on font families.
1364 .BI .fchar\  c\ string
1365 Define fallback glyph
1366 .I c
1367 to be
1368 .IR string .
1370 The syntax of this request is the same as the
1371 .B char
1372 request; the only difference is that a glyph defined with
1373 .B char
1374 hides the glyph with the same name in the current font, whereas a
1375 glyph defined with
1376 .B fchar
1377 is checked only if the particular glyph isn't found in the current font.
1379 This test happens before checking special fonts.
1382 .BI .fschar\  f\ c\ string
1383 Define fallback glyph
1384 .I c
1385 for font
1386 .I f
1387 to be
1388 .IR string .
1390 The syntax of this request is the same as the
1391 .B char
1392 request (with an additional argument to specify the font); a glyph
1393 defined with
1394 .B fschar
1395 is searched after the list of fonts declared with the
1396 .B fspecial
1397 request but before the list of fonts declared with
1398 .BR special .
1401 .BI .fspecial\  f\ s1\ s2\|.\|.\|.\&
1402 When the current font is
1403 .IR f ,
1404 fonts
1405 .IR s1 ,
1406 .IR s2 ,\|.\|.\|.\&
1407 will be special, that is, they will searched for glyphs not in
1408 the current font.
1410 Any fonts specified in the
1411 .B special
1412 request will be searched after fonts specified in the
1413 .B fspecial
1414 request.
1416 Without argument, reset the list of global special fonts to be empty.
1419 .BI .ftr\  f\ g
1420 Translate font
1421 .I f
1423 .IR g .
1424 Whenever a font named
1425 .I f
1426 is referred to in an
1427 .B \[rs]f
1428 escape sequence, or in the
1429 .BR ft ,
1430 .BR ul ,
1431 .BR bd ,
1432 .BR cs ,
1433 .BR tkf ,
1434 .BR special ,
1435 .BR fspecial ,
1436 .BR fp ,
1438 .BR sty
1439 requests, font
1440 .I g
1441 will be used.
1443 .I g
1444 is missing, or equal to
1445 .I f
1446 then font
1447 .I f
1448 will not be translated.
1451 .BI .hcode \ c1\ code1\ c2\ code2\|.\|.\|.\&
1452 Set the hyphenation code of character
1453 .I c1
1455 .I code1
1456 and that of
1457 .I c2
1459 .IR code2 .
1460 A hyphenation code must be a single input character (not a special
1461 character) other than a digit or a space.
1463 Initially each lower-case letter \%a-z has a hyphenation code, which is
1464 itself, and each upper-case letter \%A-Z has a hyphenation code which is
1465 the lower-case version of itself.
1467 See also the
1468 .B hpf
1469 request.
1472 .BI .hla\  lang
1473 Set the current hyphenation language to
1474 .IR lang .
1475 Hyphenation exceptions specified with the
1476 .B hw
1477 request and hyphenation patterns specified with the
1478 .B hpf
1479 request are both associated with the current hyphenation language.
1482 .B hla
1483 request is usually invoked by the
1484 .B troffrc
1485 file.
1488 .BI .hlm\  n
1489 Set the maximum number of consecutive hyphenated lines to\~\c
1490 .IR n .
1492 .I n
1493 is negative, there is no maximum.
1495 The default value is\~\-1.
1497 This value is associated with the current environment.
1499 Only lines output from an environment count towards the maximum
1500 associated with that environment.
1502 Hyphens resulting from
1503 .B \[rs]%
1504 are counted; explicit hyphens are not.
1507 .BI .hpf\  file
1508 Read hyphenation patterns from
1509 .IR file ;
1510 this will be searched for in the same way that
1511 .IB name .tmac
1512 is searched for when the
1513 .BI \-m name
1514 option is specified.
1516 It should have the same format as (simple) \*[tx] patterns files.
1518 More specifically, the following scanning rules are implemented.
1521 .IP \[bu]
1522 A percent sign starts a comment (up to the end of the line) even if
1523 preceded by a backslash.
1525 .IP \[bu]
1526 No support for `digraphs' like
1527 .BR \[rs]$ .
1529 .IP \[bu]
1530 .BI ^^ xx
1531 .RI ( x
1532 is 0-9 or a-f) and
1533 .BI ^^ x
1534 (character code of\~\c
1535 .I x
1536 in the range 0-127) are recognized; other use of
1537 .B ^
1538 causes an error.
1540 .IP \[bu]
1541 No macro expansion.
1543 .IP \[bu]
1544 .B hpf
1545 checks for the expression
1546 .B \[rs]patterns{.\|.\|.}
1547 (possibly with whitespace before and after the braces).
1549 Everything between the braces is taken as hyphenation patterns.
1551 Consequently,
1552 .B {
1554 .B }
1555 are not allowed in patterns.
1557 .IP \[bu]
1558 Similarly,
1559 .B \[rs]hyphenation{.\|.\|.}
1560 gives a list of hyphenation exceptions.
1562 .IP \[bu]
1563 .B \[rs]endinput
1564 is recognized also.
1566 .IP \[bu]
1567 For backwards compatibility, if
1568 .B \[rs]patterns
1569 is missing, the whole file is treated as a list of hyphenation patterns
1570 (only recognizing the
1571 .BR % \~\c
1572 character as the start of a comment).
1576 Use the
1577 .B hpfcode
1578 request to map the encoding used in hyphenation patterns files to
1579 .BR groff 's
1580 input encoding.
1582 The set of hyphenation patterns is associated with the current language
1583 set by the
1584 .B hla
1585 request.
1588 .B hpf
1589 request is usually invoked by the
1590 .B troffrc
1591 file; a second call replaces the old patterns with the new ones.
1594 .BI .hpfa\  file
1595 The same as
1596 .B hpf
1597 except that the hyphenation patterns from
1598 .I file
1599 are appended to the patterns already loaded in the current language.
1602 .BI .hpfcode\  a\ b\ c\ d\ .\|.\|.
1603 After reading a hyphenation patterns file with the
1604 .B hpf
1606 .B hpfa
1607 request, convert all characters with character code\~\c
1608 .I a
1609 in the recently read patterns to character code\~\c
1610 .IR b ,
1611 character code\~\c
1612 .I c
1613 to\~\c
1614 .IR d ,
1615 etc.
1617 Initially, all character codes map to themselves.
1619 The arguments of
1620 .B hpfcode
1621 must be integers in the range 0 to\~255.
1623 Note that it is even possible to use character codes which are invalid in
1624 .B groff
1625 otherwise.
1628 .BI .hym\  n
1629 Set the
1630 .I hyphenation margin
1631 to\~\c
1632 .IR n :
1633 when the current adjustment mode is not\~\c
1634 .BR b ,
1635 the line will not be hyphenated if the line is no more than
1636 .I n
1637 short.
1639 The default hyphenation margin is\~0.
1641 The default scaling indicator for this request is\~\c
1642 .IR m .
1643 The hyphenation margin is associated with the current environment.
1645 The current hyphenation margin is available in the
1646 .B \[rs]n[.hym]
1647 register.
1650 .BI .hys\  n
1651 Set the
1652 .I hyphenation space
1653 to\~\c
1654 .IR n :
1655 when the current adjustment mode is\~\c
1656 .B b
1657 don't hyphenate the line if the line can be justified by adding no
1658 more than
1659 .I n
1660 extra space to each word space.
1662 The default hyphenation space is\~0.
1664 The default scaling indicator for this request is\~\c
1665 .BR m .
1666 The hyphenation space is associated with the current environment.
1668 The current hyphenation space is available in the
1669 .B \[rs]n[.hys]
1670 register.
1673 .BI .itc\  n\ macro
1674 Variant of
1675 .B .it
1676 for which a line interrupted with
1677 .B \[rs]c
1678 counts as one input line.
1681 .BI .kern\  n
1683 .I n
1684 is non-zero or missing, enable pairwise kerning, otherwise disable it.
1687 .BI .length\  xx\ string
1688 Compute the length of
1689 .I string
1690 and return it in the number register
1691 .I xx
1692 (which is not necessarily defined before).
1695 .BI .linetabs\  n
1697 .I n
1698 is non-zero or missing, enable line-tabs mode, otherwise disable it
1699 (which is the default).
1701 In line-tabs mode, tab distances are computed relative to the
1702 (current) output line.
1704 Otherwise they are taken relative to the input line.
1706 For example, the following
1710 .ne 6v+\n(.Vu
1711 .ft CB
1713 .Text .ds x a\[rs]t\[rs]c
1714 .Text .ds y b\[rs]t\[rs]c
1715 .Text .ds z c
1716 .Text .ta 1i 3i
1717 .Text \[rs]*x
1718 .Text \[rs]*y
1719 .Text \[rs]*z
1725 yields
1729 a         b         c
1733 In line-tabs mode, the same code gives
1737 a         b                   c
1741 Line-tabs mode is associated with the current environment; the
1742 read-only number register
1743 .B \\[rs]n[.linetabs]
1744 is set to\~1 if in line-tabs mode, and 0 otherwise.
1747 .BI .mso\  file
1748 The same as the
1749 .B so
1750 request except that
1751 .I file
1752 is searched for in the same directories as macro files for the the
1753 .B \-m
1754 command line option.
1756 If the file name to be included has the form
1757 .IB name .tmac
1758 and it isn't found,
1759 .B mso
1760 tries to include
1761 .BI tmac. name
1762 instead and vice versa.
1765 .BI .nop \ anything
1766 Execute
1767 .IR anything .
1768 This is similar to `.if\ 1'.
1771 .B .nroff
1772 Make the
1773 .B n
1774 built-in condition true and the
1775 .B t
1776 built-in condition false.
1778 This can be reversed using the
1779 .B troff
1780 request.
1783 .BI .open\  stream\ filename
1784 Open
1785 .I filename
1786 for writing and associate the stream named
1787 .I stream
1788 with it.
1790 See also the
1791 .B close
1793 .B write
1794 requests.
1796 .TP 
1797 .BI .opena\  stream\ filename
1798 Like
1799 .BR open ,
1800 but if
1801 .I filename
1802 exists, append to it instead of truncating it.
1805 .BI .output\  string
1806 Emit
1807 .I string
1808 directly to the intermediate output (subject to copy-mode interpretation);
1809 this is similar to
1810 .B \[rs]!
1811 used at the top level.
1813 An initial double quote in
1814 .I string
1815 is stripped off to allow initial blanks.
1818 .B .pnr
1819 Print the names and contents of all currently defined number registers
1820 on stderr.
1823 .BI .psbb \ filename
1824 Get the bounding box of a PostScript image
1825 .IR filename .
1826 This file must conform to Adobe's Document Structuring Conventions;
1827 the command looks for a
1828 .B \%%%BoundingBox
1829 comment to extract the bounding box values.
1831 After a successful call, the coordinates (in PostScript units) of the
1832 lower left and upper right corner can be found in the registers
1833 .BR \[rs]n[llx] ,
1834 .BR \[rs]n[lly] ,
1835 .BR \[rs]n[urx] ,
1837 .BR \[rs]n[ury] ,
1838 respectively.
1840 If some error has occurred, the four registers are set to zero.
1843 .BI .pso \ command
1844 This behaves like the
1845 .B so
1846 request except that input comes from the standard output of
1847 .IR command .
1850 .B .ptr
1851 Print the names and positions of all traps (not including input line
1852 traps and diversion traps) on stderr.
1854 Empty slots in the page trap list are printed as well, because they
1855 can affect the priority of subsequently planted traps.
1858 .BI .pvs \ \[+-]n
1859 Set the post-vertical line space to
1860 .IR n ;
1861 default scale indicator is\~\c
1862 .BR p .
1864 This value will be added to each line after it has been output.
1866 With no argument, the post-vertical line space is set to its previous
1867 value.
1870 The total vertical line spacing consists of four components:
1871 .B .vs
1873 .B \[rs]x
1874 with a negative value which are applied before the line is output, and
1875 .B .pvs
1877 .B \[rs]x
1878 with a positive value which are applied after the line is output.
1881 .BI .rchar\  c1\ c2\|.\|.\|.\&
1882 Remove the definitions of glyphs
1883 .IR c1 ,
1884 .IR c2 ,\|.\|.\|.
1885 This undoes the effect of a
1886 .B char
1887 request.
1890 .B .return
1891 Within a macro, return immediately.
1893 If called with an argument, return twice, namely from the current macro and
1894 from the macro one level higher.
1896 No effect otherwise.
1899 .BI .rfschar\  c1\ c2\|.\|.\|.\&
1900 Remove the font-specific definitions of glyphs
1901 .IR c1 ,
1902 .IR c2 ,\|.\|.\|.
1903 This undoes the effect of a
1904 .B fschar
1905 request.
1908 .B .rj
1910 .BI .rj \~n
1911 Right justify the next
1912 .IR n \~\c
1913 input lines.
1915 Without an argument right justify the next input line.
1917 The number of lines to be right justified is available in the
1918 .B \[rs]n[.rj]
1919 register.
1921 This implicitly does
1922 .BR .ce \~0 .
1924 .B ce
1925 request implicitly does
1926 .BR .rj \~0 .
1929 .BI .rnn \ xx\ yy
1930 Rename number register
1931 .I xx
1933 .IR yy .
1936 .BI .schar\  c\ string
1937 Define global fallback glyph
1938 .I c
1939 to be
1940 .IR string .
1942 The syntax of this request is the same as the
1943 .B char
1944 request; a glyph defined with
1945 .B schar
1946 is searched after the list of fonts declared with the
1947 .B special
1948 request but before the mounted special fonts.
1951 .BI .shc\  c
1952 Set the soft hyphen character to
1953 .IR c .
1955 .I c
1956 is omitted, the soft hyphen character will be set to the default
1957 .BR \[rs](hy .
1958 The soft hyphen character is the glyph which will be inserted when
1959 a word is hyphenated at a line break.
1961 If the soft hyphen character does not exist in the font of the
1962 glyph immediately preceding a potential break point, then the line
1963 will not be broken at that point.
1965 Neither definitions (specified with the
1966 .B char
1967 request) nor translations (specified with the
1968 .B tr
1969 request) are considered when finding the soft hyphen character.
1972 .BI .shift\  n
1973 In a macro, shift the arguments by
1974 .I n
1975 positions: argument\~\c
1976 .I i
1977 becomes argument
1978 .IR i \- n ;
1979 arguments 1 to\~\c
1980 .I n
1981 will no longer be available.
1984 .I n
1985 is missing, arguments will be shifted by\~1.
1987 Shifting by negative amounts is currently undefined.
1990 .BI .sizes\  s1\ s2\|.\|.\|.\|sn\  [0]
1991 This command is similar to the
1992 .B sizes
1993 command of a
1994 .B DESC
1995 file.
1997 It sets the available font sizes for the current font to
1998 .IR s1 ,
1999 .IR s2 ,\|.\|.\|.\|,\~ sn
2000 scaled points.
2002 The list of sizes can be terminated by an optional\~\c
2003 .BR 0 .
2005 Each
2006 .I si
2007 can also be a range of sizes
2008 .IR m - n .
2010 Contrary to the font file command, the list can't extend over more
2011 than a single line.
2014 .BI .special\  s1\ s2\|.\|.\|.\&
2015 Fonts
2016 .IR s1 ,
2017 .IR s2 ,
2018 are special and will be searched for glyphs not in the current
2019 font.
2021 Without arguments, reset the list of special fonts to be empty.
2024 .BI .spreadwarn\  limit
2025 Make
2026 .B troff
2027 emit a warning if the additional space inserted for each space between
2028 words in an output line is larger or equal to
2029 .IR limit .
2031 A negative value is changed to zero; no argument toggles the warning on
2032 and off without changing
2033 .IR limit .
2035 The default scaling indicator is\~\c
2036 .BR m .
2038 At startup,
2039 .B spreadwarn
2040 is deactivated, and
2041 .I limit
2042 is set to 3m.
2044 For example,
2045 .B .spreadwarn\ 0.2m
2046 will cause a warning if
2047 .B troff
2048 must add 0.2m or more for each interword space in a line.
2050 This request is active only if text is justified to both margins (using
2051 .BR .ad\ b ).
2054 .BI .sty\  n\ f
2055 Associate style\~\c
2056 .I f
2057 with font position\~\c
2058 .IR n .
2059 A font position can be associated either with a font or with a style.
2061 The current font is the index of a font position and so is also either
2062 a font or a style.
2064 When it is a style, the font that is actually used is the font the
2065 name of which is the concatenation of the name of the current family
2066 and the name of the current style.
2068 For example, if the current font is\~1 and font position\~1 is
2069 associated with style\~\c
2070 .B R
2071 and the current font family is\~\c
2072 .BR T ,
2073 then font
2074 .BR TR
2075 will be used.
2077 If the current font is not a style, then the current family is ignored.
2079 When the requests
2080 .BR cs ,
2081 .BR bd ,
2082 .BR tkf ,
2083 .BR uf ,
2085 .B fspecial
2086 are applied to a style, then they will instead be applied to the
2087 member of the current family corresponding to that style.
2089 The default family can be set with the
2090 .B \-f
2091 option.
2094 .B styles
2095 command in the
2096 .SM DESC
2097 file controls which font positions (if any) are initially associated
2098 with styles rather than fonts.
2101 .BI .substring\  xx\ n1\  [ n2 ]
2102 Replace the string named
2103 .I xx
2104 with the substring defined by the indices
2105 .I n1
2107 .IR n2 .
2108 The first character in the string has index\~0.
2111 .I n2
2112 is omitted, it is taken to be equal to the string's length.
2114 If the index value
2115 .I n1
2117 .I n2
2118 is negative, it will be counted from the end of the string,
2119 going backwards:
2121 The last character has index\~-1, the character before the last
2122 character has index\~-2, etc.
2125 .BI .tkf\  f\ s1\ n1\ s2\ n2
2126 Enable track kerning for font
2127 .IR f .
2128 When the current font is
2129 .I f
2130 the width of every glyph will be increased by an amount between
2131 .I n1
2133 .IR n2 ;
2134 when the current point size is less than or equal to
2135 .I s1
2136 the width will be increased by
2137 .IR n1 ;
2138 when it is greater than or equal to
2139 .I s2
2140 the width will be increased by
2141 .IR n2 ;
2142 when the point size is greater than or equal to
2143 .I s1
2144 and less than or equal to
2145 .I s2
2146 the increase in width is a linear function of the point size.
2149 .BI .tm1\  string
2150 Similar to the
2151 .B tm
2152 request,
2153 .I string
2154 is read in copy mode and written on the standard error, but an initial
2155 double quote in
2156 .I string
2157 is stripped off to allow initial blanks.
2160 .BI .tmc\  string
2161 Similar to
2162 .B tm1
2163 but without writing a final newline.
2166 .BI .trf\  filename
2167 Transparently output the contents of file
2168 .IR filename .
2169 Each line is output as if preceded by
2170 .BR \[rs]! ;
2171 however, the lines are not subject to copy-mode interpretation.
2173 If the file does not end with a newline, then a newline will be added.
2175 For example, you can define a macro\~\c
2176 .I x
2177 containing the contents of file\~\c
2178 .IR f ,
2179 using
2183 .ne 2v+\n(.Vu
2184 .ft CB
2186 .Text .di x
2187 .Text .trf f
2188 .Text .di
2194 Unlike with the
2195 .B cf
2196 request, the file cannot contain characters such as
2197 .SM NUL
2198 that are not legal troff input characters.
2201 .BI .trin\  abcd
2202 This is the same as the
2203 .B tr
2204 request except that the
2205 .B asciify
2206 request will use the character code (if any) before the character
2207 translation.
2209 Example:
2214 .ft CB
2215 .Text .trin ax
2216 .Text .di xxx
2217 .Text a
2218 .Text .br
2219 .Text .di
2220 .Text .xxx
2221 .Text .trin aa
2222 .Text .asciify xxx
2223 .Text .xxx
2229 The result is
2230 .BR x\ a .
2232 Using
2233 .BR tr ,
2234 the result would be
2235 .BR x\ x .
2238 .BI .trnt\  abcd
2239 This is the same as the
2240 .B tr
2241 request except that the translations do not apply to text that is
2242 transparently throughput into a diversion with
2243 .BR \[rs]! .
2244 For example,
2249 .ft CB
2250 .Text .tr ab
2251 .Text .di x
2252 .Text \[rs]!.tm a
2253 .Text .di
2254 .Text .x
2260 will print\~\c
2261 .BR b ;
2263 .B trnt
2264 is used instead of
2265 .B tr
2266 it will print\~\c
2267 .BR a .
2271 .B .troff
2272 Make the
2273 .B n
2274 built-in condition false, and the
2275 .B t
2276 built-in condition true.
2278 This undoes the effect of the
2279 .B nroff
2280 request.
2283 .BI .unformat\  xx
2284 This request `unformats' the diversion
2285 .IR xx .
2286 Contrary to the
2287 .B .asciify
2288 request, which tries to convert formatted elements of the diversion
2289 back to input tokens as much as possible,
2290 .B .unformat
2291 will only handle tabs and spaces between words (usually caused by
2292 spaces or newlines in the input) specially.
2294 The former are treated as if they were input tokens, and the latter
2295 are stretchable again.
2297 Note that the vertical size of lines is not preserved.
2299 Glyph information (font, font size, space width, etc.) is retained.
2301 Useful in conjunction with the
2302 .B .box
2304 .B .boxa
2305 requests.
2308 .BI .vpt\  n
2309 Enable vertical position traps if
2310 .I n
2311 is non-zero, disable them otherwise.
2313 Vertical position traps are traps set by the
2314 .B wh
2316 .B dt
2317 requests.
2319 Traps set by the
2320 .B it
2321 request are not vertical position traps.
2323 The parameter that controls whether vertical position traps are
2324 enabled is global.
2326 Initially vertical position traps are enabled.
2329 .BI .warn\  n
2330 Control warnings.
2331 .I n
2332 is the sum of the numbers associated with each warning that is to be
2333 enabled; all other warnings will be disabled.
2335 The number associated with each warning is listed in
2336 .BR @g@troff (@MAN1EXT@).
2338 For example,
2339 .B .warn\~0
2340 will disable all warnings, and
2341 .B .warn\~1
2342 will disable all warnings except that about missing glyphs.
2345 .I n
2346 is not given, all warnings will be enabled.
2349 .BI .warnscale\  si
2350 Set the scaling indicator used in warnings to
2351 .IR si .
2353 Valid values for
2354 .I si
2356 .BR u ,
2357 .BR i ,
2358 .BR c ,
2359 .BR p ,
2361 .BR P .
2363 At startup, it is set to\~\c
2364 .BR i .
2367 .BI .while \ c\ anything
2368 While condition\~\c
2369 .I c
2370 is true, accept
2371 .I anything
2372 as input;
2373 .IR c \~\c
2374 can be any condition acceptable to an
2375 .B if
2376 request;
2377 .I anything
2378 can comprise multiple lines if the first line starts with
2379 .B \[rs]{
2380 and the last line ends with
2381 .BR \[rs]} .
2382 See also the
2383 .B break
2385 .B continue
2386 requests.
2389 .BI .write\  stream\ anything
2390 Write
2391 .I anything
2392 to the stream named
2393 .IR stream .
2394 .I stream
2395 must previously have been the subject of an
2396 .B open
2397 request.
2398 .I anything
2399 is read in copy mode;
2400 a leading\~\c
2401 .B \[dq]
2402 will be stripped.
2405 .BI .writec\  stream\ anything
2406 Similar to
2407 .B write
2408 but without writing a final newline.
2411 .BI .writem\  stream\ xx
2412 Write the contents of the macro or string
2413 .I xx
2414 to the stream named
2415 .IR stream .
2416 .I stream
2417 must previously have been the subject of an
2418 .B open
2419 request.
2420 .I xx
2421 is read in copy mode.
2424 .\" --------------------------------------------------------------------
2425 .SS "Extended escape sequences"
2426 .\" --------------------------------------------------------------------
2429 .BI \[rs]D' .\|.\|. '
2430 All drawing commands of groff's intermediate output are accepted.
2432 See subsection
2433 .B "Drawing Commands"
2434 below for more information.
2437 .\" --------------------------------------------------------------------
2438 .SS "Extended requests"
2439 .\" --------------------------------------------------------------------
2442 .BI .cf\  filename
2443 When used in a diversion, this will embed in the diversion an object
2444 which, when reread, will cause the contents of
2445 .I filename
2446 to be transparently copied through to the output.
2448 In UNIX troff, the contents of
2449 .I filename
2450 is immediately copied through to the output regardless of whether
2451 there is a current diversion; this behaviour is so anomalous that it
2452 must be considered a bug.
2455 .BI .ev\  xx
2457 .I xx
2458 is not a number, this will switch to a named environment called
2459 .IR xx .
2460 The environment should be popped with a matching
2461 .B ev
2462 request without any arguments, just as for numbered environments.
2464 There is no limit on the number of named environments; they will be
2465 created the first time that they are referenced.
2468 .BI .ss\  m\ n
2469 When two arguments are given to the
2470 .B ss
2471 request, the second argument gives the
2472 .IR "sentence space size" .
2473 If the second argument is not given, the sentence space size
2474 will be the same as the word space size.
2476 Like the word space size, the sentence space is in units of
2477 one twelfth of the spacewidth parameter for the current font.
2479 Initially both the word space size and the sentence
2480 space size are\~12.
2482 Contrary to UNIX troff, GNU troff handles this request in nroff mode
2483 also; a given value is then rounded down to the nearest multiple
2484 of\~12.
2486 The sentence space size is used in two circumstances.
2488 If the end of a sentence occurs at the end of a line in fill mode,
2489 then both an inter-word space and a sentence space will be added; if
2490 two spaces follow the end of a sentence in the middle of a line, then
2491 the second space will be a sentence space.
2493 Note that the behaviour of UNIX troff will be exactly that exhibited
2494 by GNU troff if a second argument is never given to the
2495 .B ss
2496 request.
2498 In GNU troff, as in UNIX troff, you should always follow a sentence
2499 with either a newline or two spaces.
2502 .BI .ta\  n1\ n2\|.\|.\|.nn \ T\  r1\ r2\|.\|.\|.\|rn
2503 Set tabs at positions
2504 .IR n1 ,
2505 .IR n2 ,\|.\|.\|.\|,
2506 .I nn
2507 and then set tabs at
2508 .IR nn + r1 ,
2509 .IR nn + r2 ,\|.\|.\|.\|,
2510 .IR nn + rn
2511 and then at
2512 .IR nn + rn + r1 ,
2513 .IR nn + rn + r2 ,\|.\|.\|.\|,
2514 .IR nn + rn + rn ,
2515 and so on.
2516 For example,
2520 .ft CB
2521 .Text .ta T .5i
2526 will set tabs every half an inch.
2530 .\" --------------------------------------------------------------------
2531 .SS "New number registers"
2532 .\" --------------------------------------------------------------------
2534 The following read-only registers are available:
2537 .B \[rs]n[.C]
2538 1\~if compatibility mode is in effect, 0\~otherwise.
2541 .B \[rs]n[.cdp]
2542 The depth of the last glyph added to the current environment.
2544 It is positive if the glyph extends below the baseline.
2547 .B \[rs]n[.ce]
2548 The number of lines remaining to be centered, as set by the
2549 .B ce
2550 request.
2553 .B \[rs]n[.cht]
2554 The height of the last glyph added to the current environment.
2556 It is positive if the glyph extends above the baseline.
2559 .B \[rs]n[.color]
2560 1\~if colors are enabled, 0\~otherwise.
2563 .B \[rs]n[.csk]
2564 The skew of the last glyph added to the current environment.
2567 .I skew
2568 of a glyph is how far to the right of the center of a glyph
2569 the center of an accent over that glyph should be placed.
2572 .B \[rs]n[.ev]
2573 The name or number of the current environment.
2575 This is a string-valued register.
2578 .B \[rs]n[.fam]
2579 The current font family.
2581 This is a string-valued register.
2584 .B \[rs]n[.fn]
2585 The current (internal) real font name.
2587 This is a string-valued register.
2589 If the current font is a style, the value of
2590 .B \[rs]n[.fn]
2591 is the proper concatenation of family and style name.
2594 .B \[rs]n[.fp]
2595 The number of the next free font position.
2598 .B \[rs]n[.g]
2599 Always\~1.
2601 Macros should use this to determine whether they are running under GNU
2602 troff.
2605 .B \[rs]n[.height]
2606 The current height of the font as set with
2607 .BR \[rs]H .
2610 .B \[rs]n[.hla]
2611 The current hyphenation language as set by the
2612 .B hla
2613 request.
2616 .B \[rs]n[.hlc]
2617 The number of immediately preceding consecutive hyphenated lines.
2620 .B \[rs]n[.hlm]
2621 The maximum allowed number of consecutive hyphenated lines, as set by
2623 .B hlm
2624 request.
2627 .B \[rs]n[.hy]
2628 The current hyphenation flags (as set by the
2629 .B hy
2630 request).
2633 .B \[rs]n[.hym]
2634 The current hyphenation margin (as set by the
2635 .B hym
2636 request).
2639 .B \[rs]n[.hys]
2640 The current hyphenation space (as set by the
2641 .B hys
2642 request).
2645 .B \[rs]n[.in]
2646 The indent that applies to the current output line.
2649 .B \[rs]n[.int]
2650 Set to a positive value if last output line is interrupted (i.e., if
2651 it contains
2652 .IR \[rs]c ).
2655 .B \[rs]n[.kern]
2656 1\~if pairwise kerning is enabled, 0\~otherwise.
2659 .B \[rs]n[.lg]
2660 The current ligature mode (as set by the
2661 .B lg
2662 request).
2665 .B \[rs]n[.linetabs]
2666 The current line-tabs mode (as set by the
2667 .B linetabs
2668 request).
2671 .B \[rs]n[.ll]
2672 The line length that applies to the current output line.
2675 .B \[rs]n[.lt]
2676 The title length as set by the
2677 .B lt
2678 request.
2681 .B \[rs]n[.ne]
2682 The amount of space that was needed in the last
2683 .B ne
2684 request that caused a trap to be sprung.
2686 Useful in conjunction with the
2687 .B \[rs]n[.trunc]
2688 register.
2691 .B \[rs]n[.ns]
2692 1\~if no-space mode is active, 0\~otherwise.
2695 .B \[rs]n[.pe]
2696 1\~during a page ejection caused by the
2697 .B bp
2698 request, 0\~otherwise.
2701 .B \[rs]n[.pn]
2702 The number of the next page, either the value set by a
2703 .B pn
2704 request, or the number of the current page plus\~1.
2707 .B \[rs]n[.ps]
2708 The current pointsize in scaled points.
2711 .B \[rs]n[.psr]
2712 The last-requested pointsize in scaled points.
2715 .B \[rs]n[.pvs]
2716 The current post-vertical line space as set with the
2717 .B pvs
2718 request.
2721 .B \[rs]n[.rj]
2722 The number of lines to be right-justified as set by the
2723 .B rj
2724 request.
2727 .B \[rs]n[.slant]
2728 The slant of the current font as set with
2729 .BR \[rs]S .
2732 .B \[rs]n[.sr]
2733 The last requested pointsize in points as a decimal fraction.
2735 This is a string-valued register.
2738 .B \[rs]n[.ss]
2740 .B \[rs]n[.sss]
2741 These give the values of the parameters set by the first and second
2742 arguments of the
2743 .B ss
2744 request.
2747 .B \[rs]n[.tabs]
2748 A string representation of the current tab settings suitable for use
2749 as an argument to the
2750 .B ta
2751 request.
2754 .B \[rs]n[.trunc]
2755 The amount of vertical space truncated by the most recently sprung
2756 vertical position trap, or, if the trap was sprung by a
2757 .B ne
2758 request, minus the amount of vertical motion produced by the
2759 .B ne
2760 request.
2762 In  other  words, at the point  a  trap is  sprung,  it represents the
2763 difference of  what the vertical position  would have been but for the
2764 trap, and what the vertical position actually is.
2766 Useful in conjunction with the
2767 .B \[rs]n[.ne]
2768 register.
2771 .B \[rs]n[.vpt]
2772 1\~if vertical position traps are enabled, 0\~otherwise.
2775 .B \[rs]n[.warn]
2776 The sum of the numbers associated with each of the currently enabled
2777 warnings.
2779 The number associated with each warning is listed in
2780 .BR @g@troff (@MAN1EXT@).
2783 .B \[rs]n[.x]
2784 The major version number.
2786 For example, if the version number is 1.03, then
2787 .B \[rs]n[.x]
2788 will contain\~1.
2791 .B \[rs]n[.y]
2792 The minor version number.
2794 For example, if the version number is 1.03, then
2795 .B \[rs]n[.y]
2796 will contain\~03.
2799 .B \[rs]n[.Y]
2800 The revision number of groff.
2803 .B \[rs]n[llx]
2805 .B \[rs]n[lly]
2807 .B \[rs]n[urx]
2809 .B \[rs]n[ury]
2810 These four registers are set by the
2811 .B .psbb
2812 request and contain the bounding box values (in PostScript units) of a
2813 given PostScript image.
2816 The following read/write registers are set by the
2817 .B \[rs]w
2818 escape sequence:
2821 .B \[rs]n[rst]
2823 .B \[rs]n[rsb]
2824 Like the
2825 .B st
2827 .B sb
2828 registers, but take account of the heights and depths of glyphs.
2831 .B \[rs]n[ssc]
2832 The amount of horizontal space (possibly negative) that should be
2833 added to the last glyph before a subscript.
2836 .B \[rs]n[skw]
2837 How far to right of the center of the last glyph in the
2838 .B \[rs]w
2839 argument, the center of an accent from a roman font should be placed
2840 over that glyph.
2843 Other available read/write number registers are:
2846 .B \[rs]n[c.]
2847 The current input line number.
2848 .B \[rs]n[.c]
2849 is a read-only alias to this register.
2852 .B \[rs]n[hours]
2853 The number of hours past midnight.
2855 Initialized at start-up.
2858 .B \[rs]n[hp]
2859 The current horizontal position at input line.
2862 .B \[rs]n[minutes]
2863 The number of minutes after the hour.
2865 Initialized at start-up.
2868 .B \[rs]n[seconds]
2869 The number of seconds after the minute.
2871 Initialized at start-up.
2874 .B \[rs]n[systat]
2875 The return value of the system() function executed by the last
2876 .B sy
2877 request.
2880 .B \[rs]n[slimit]
2881 If greater than\~0, the maximum number of objects on the input stack.
2883 If less than or equal to\~0, there is no limit on the number of
2884 objects on the input stack.
2886 With no limit, recursion can continue until virtual memory is
2887 exhausted.
2890 .B \[rs]n[year]
2891 The current year.
2893 Note that the traditional
2894 .B troff
2895 number register
2896 .B \[rs]n[yr]
2897 is the current year minus 1900.
2900 .\" --------------------------------------------------------------------
2901 .SS Miscellaneous
2902 .\" --------------------------------------------------------------------
2904 .B @g@troff
2905 predefines a single (read/write) string-based register,
2906 .BR \[rs]*(.T ,
2907 which contains the argument given to the
2908 .B -T
2909 command line option, namely the current output device (for example,
2910 .I latin1
2912 .IR ascii ).
2913 Note that this is not the same as the (read-only) number register
2914 .B \[rs]n[.T]
2915 which is defined to be\~1 if
2916 .B troff
2917 is called with the
2918 .B -T
2919 command line option, and zero otherwise.
2921 This behaviour is different to UNIX troff.
2924 Fonts not listed in the
2925 .SM DESC
2926 file are automatically mounted on the next available font position
2927 when they are referenced.
2929 If a font is to be mounted explicitly with the
2930 .B fp
2931 request on an unused font position, it should be mounted on the first
2932 unused font position, which can be found in the
2933 .B \[rs]n[.fp]
2934 register; although
2935 .B troff
2936 does not enforce this strictly, it will not allow a font to be mounted
2937 at a position whose number is much greater than that of any currently
2938 used position.
2941 Interpolating a string does not hide existing macro arguments.
2943 Thus in a macro, a more efficient way of doing
2946 .BI . xx\  \[rs]\[rs]$@
2951 .BI \[rs]\[rs]*[ xx ]\[rs]\[rs]  
2954 If the font description file contains pairwise kerning information,
2955 glyphs from that font will be kerned.
2957 Kerning between two glyphs can be inhibited by placing a
2958 .B \[rs]&
2959 between them.
2962 In a string comparison in a condition, characters that appear at
2963 different input levels to the first delimiter character will not be
2964 recognised as the second or third delimiters.
2966 This applies also to the
2967 .B tl
2968 request.
2970 In a
2971 .B \[rs]w
2972 escape sequence, a character that appears at a different input level
2973 to the starting delimiter character will not be recognised as the
2974 closing delimiter character.
2976 The same is true for
2977 .BR \[rs]A ,
2978 .BR \[rs]b ,
2979 .BR \[rs]B ,
2980 .BR \[rs]C ,
2981 .BR \[rs]l ,
2982 .BR \[rs]L ,
2983 .BR \[rs]o ,
2984 .BR \[rs]X ,
2986 .BR \[rs]Z .
2988 When decoding a macro or string argument that is delimited by double
2989 quotes, a character that appears at a different input level to the starting
2990 delimiter character will not be recognised as the closing delimiter
2991 character.
2993 The implementation of
2994 .B \[rs]$@
2995 ensures that the double quotes surrounding an argument will appear the
2996 same input level, which will be different to the input level of the
2997 argument itself.
2999 In a long escape name
3000 .B ]
3001 will not be recognized as a closing delimiter except when it occurs at
3002 the same input level as the opening
3003 .BR ] .
3005 In compatibility mode, no attention is paid to the input-level.
3008 There are some new types of condition:
3011 .BI .if\ r xxx
3012 True if there is a number register named
3013 .IR xxx .
3016 .BI .if\ d xxx
3017 True if there is a string, macro, diversion, or request named
3018 .IR xxx .
3021 .BI .if\ m xxx
3022 True if there is a color named
3023 .IR xxx .
3026 .BI .if\ c ch
3027 True if there is a glyph
3028 .IR ch
3029 available;
3030 .I ch
3031 is either an
3032 .SM ASCII
3033 character or a glyph (special character)
3034 .BI \[rs]( xx
3036 .BI \[rs][ xxx ]\f[R];
3037 the condition will also be true if
3038 .I ch
3039 has been defined by the
3040 .B char
3041 request.
3045 .B tr
3046 request can now map characters onto
3047 .BR \[rs]~ .
3050 It is now possible to have whitespace between the first and second dot
3051 (or the name of the ending macro) to end a macro definition.
3053 Example:
3056 .ne 6v+\n(.Vu
3057 .ft CB
3059 .Text .de foo
3060 .Text .  nop Hello, I'm `foo'.
3061 .Text .  nop I will now define `bar'.
3062 .Text .  de bar
3063 .Text .    nop Hello, I'm `bar'.
3064 .Text .  .
3065 .Text .  nop Done.
3066 .Text ..
3067 .Text .foo
3068 .Text .bar
3072 .\" --------------------------------------------------------------------
3073 .SH "INTERMEDIATE OUTPUT FORMAT"
3074 .\" --------------------------------------------------------------------
3076 This section describes the format output by GNU troff.
3078 The output format used by GNU troff is very similar to that used
3079 by Unix device-independent troff.
3081 Only the differences are documented here.
3084 .\" --------------------------------------------------------------------
3085 .SS "Units"
3086 .\" --------------------------------------------------------------------
3088 The argument to the
3089 .B s
3090 command is in scaled points (units of
3091 .RI points/ n ,
3092 where
3093 .I n
3094 is the argument to the
3095 .B sizescale
3096 command  in the DESC file).
3098 The argument to the
3099 .B x\ Height
3100 command is also in scaled points.
3103 .\" --------------------------------------------------------------------
3104 .SS "Text Commands"
3105 .\" --------------------------------------------------------------------
3108 .BI N n
3109 Print glyph with index\~\c
3110 .I n
3111 (a non-negative integer) of the current font.
3114 If the
3115 .B tcommand
3116 line is present in the DESC file, troff will use the following two
3117 commands.
3120 .BI t xxx
3121 .I xxx
3122 is any sequence of characters terminated by a space or a newline (to
3123 be more precise, it is a sequence of glyphs which are accessed with
3124 the corresponding characters); the first character should be printed at
3125 the current position, the current horizontal position should be increased
3126 by the width of the first character, and so on for each character.
3128 The width of the glyph is that given in the font file,
3129 appropriately scaled for the current point size, and rounded so that
3130 it is a multiple of the horizontal resolution.
3132 Special characters cannot be printed using this command.
3135 .BI u n\ xxx
3136 This is same as the
3137 .B t
3138 command except that after printing each character, the current
3139 horizontal position is increased by the sum of the width of that
3140 character and
3141 .IR n .
3144 Note that single characters can have the eighth bit set, as can the
3145 names of fonts and special characters.
3148 The names of glyphs and fonts can be of arbitrary length; drivers
3149 should not assume that they will be only two characters long.
3152 When a glyph is to be printed, that glyph will always be
3153 in the current font.
3155 Unlike device-independent troff, it is not necessary for drivers to
3156 search special fonts to find a glyph.
3159 For color support, some new commands have been added:
3162 .Text \f[B]mc \f[I]cyan magenta yellow\f[R]
3164 .Text \f[B]md\f[R]
3166 .Text \f[B]mg \f[I]gray\f[R]
3168 .Text \f[B]mk \f[I]cyan magenta yellow black\f[R]
3170 .Text \f[B]mr \f[I]red green blue\f[R]
3171 Set the color components of the current drawing color, using various
3172 color schemes.
3174 .B md
3175 resets the drawing color to the default value.
3177 The arguments are integers in the range 0 to 65536.
3181 .B x
3182 device control command has been extended.
3185 .Text \f[B]x u \f[I]n\f[R]
3187 .I n
3188 is\~1, start underlining of spaces.
3191 .I n
3192 is\~0, stop underlining of spaces.
3194 This is needed for the
3195 .B cu
3196 request in nroff mode and is ignored otherwise.
3199 .\" --------------------------------------------------------------------
3200 .SS "Drawing Commands"
3201 .\" --------------------------------------------------------------------
3204 .B D
3205 drawing command has been extended.
3207 These extensions will not be used by GNU pic if the
3208 .B \-n
3209 option is given.
3212 .Text \f[B]Df \f[I]n\f[R]\*[ic]\[rs]n
3213 Set the shade of gray to be used for filling solid objects to
3214 .IR n ;
3215 .I n
3216 must be an integer between 0 and 1000, where 0 corresponds solid white
3217 and 1000 to solid black, and values in between correspond to
3218 intermediate shades of gray.
3220 This applies only to solid circles, solid ellipses and solid
3221 polygons.
3223 By default, a level of 1000 will be used.
3225 Whatever color a solid object has, it should completely obscure
3226 everything beneath it.
3228 A value greater than 1000 or less than 0 can also be used: this means
3229 fill with the shade of gray that is currently being used for lines and
3230 text.
3232 Normally this will be black, but some drivers may provide a way of
3233 changing this.
3236 The corresponding
3237 .BI \[rs]D'f .\|.\|. '
3238 command shouldn't be used since its argument is always rounded to an
3239 integer multiple of the horizontal resolution which can lead to
3240 surprising results.
3243 .Text \f[B]DC \f[I]d\f[R]\*[ic]\[rs]n
3244 Draw a solid circle with a diameter of
3245 .I d
3246 with the leftmost point at the current position.
3249 .Text \f[B]DE \f[I]dx dy\f[R]\*[ic]\[rs]n
3250 Draw a solid ellipse with a horizontal diameter of
3251 .I dx
3252 and a vertical diameter of
3253 .I dy
3254 with the leftmost point at the current position.
3256 delim $$
3260 .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
3261 Draw a polygon with, for $i = 1 ,..., n+1$, the
3262 .IR i -th
3263 vertex at the current position 
3265 $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$.
3267 At the moment, GNU pic only uses this command to generate triangles
3268 and rectangles.
3271 .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
3273 Like
3274 .B Dp
3275 but draw a solid rather than outlined polygon.
3278 .Text \f[B]Dt \f[I]n\f[R]\*[ic]\[rs]n
3279 Set the current line thickness to
3280 .I n
3281 machine units.
3283 Traditionally Unix troff drivers use a line thickness proportional to
3284 the current point size; drivers should continue to do this if no
3285 .B Dt
3286 command has been given, or if a
3287 .B Dt
3288 command has been given with a negative value of
3289 .IR n .
3290 A zero value of
3291 .I n
3292 selects the smallest available line thickness.
3295 A difficulty arises in how the current position should be changed after
3296 the execution of these commands.
3298 This is not of great importance since the code generated by GNU pic
3299 does not depend on this.
3301 Given a drawing command of the form
3303 \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]
3306 where
3307 .I c
3308 is not one of
3309 .BR c ,
3310 .BR e ,
3311 .BR l ,
3312 .BR a ,
3314 .BR ~ ,
3315 Unix troff will treat each of the $x sub i$ as a horizontal quantity,
3316 and each of the $y sub i$ as a vertical quantity and will assume that
3317 the width of the drawn object is $sum from i=1 to n x sub i$,
3318 and that the height is $sum from i=1 to n y sub i$.
3320 (The assumption about the height can be seen by examining the
3321 .B st
3323 .B sb
3324 registers after using such a
3325 .B D
3326 command in a \[rs]w escape sequence).
3328 This rule also holds for all the original drawing commands with the
3329 exception of
3330 .BR De .
3331 For the sake of compatibility GNU troff also follows this rule, even
3332 though it produces an ugly result in the case of the
3333 .B Dt
3335 .BR Df ,
3336 and, to a lesser extent,
3337 .B DE
3338 commands.
3340 Thus after executing a
3341 .B D
3342 command of the form
3344 \f[B]D\f[I]c\f[R] $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ \c
3345 $x sub n$ $y sub n$\[rs]n
3348 the current position should be increased by
3350 $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
3353 Another set of extensions is
3356 .Text \f[B]DFc \f[I]cyan magenta yellow\f[R]\*[ic]\[rs]n
3358 .Text \f[B]DFd\f[R]\*[ic]\[rs]n
3360 .Text \f[B]DFg \f[I]gray\f[R]\*[ic]\[rs]n
3362 .Text \f[B]DFk \f[I]cyan magenta yellow black\f[R]\*[ic]\[rs]n
3364 .Text \f[B]DFr \f[I]red green blue\f[R]\*[ic]\[rs]n
3365 Set the color components of the filling color similar to the
3366 .B m
3367 commands above.
3370 The current position isn't changed by those colour commands (contrary to
3371 .BR Df ).
3374 .\" --------------------------------------------------------------------
3375 .SS "Device Control Commands"
3376 .\" --------------------------------------------------------------------
3378 There is a continuation convention which permits the argument to the
3379 .B x\ X
3380 command to contain newlines: when outputting the argument to the
3381 .B x\ X
3382 command, GNU troff will follow each newline in the argument with a
3383 .B +
3384 character (as usual, it will terminate the entire argument with a
3385 newline); thus if the line after the line containing the
3386 .B x\ X
3387 command starts with
3388 .BR + ,
3389 then the newline ending the line containing the
3390 .B x\ X
3391 command should be treated as part of the argument to the
3392 .B x\ X
3393 command, the
3394 .B +
3395 should be ignored, and the part of the line following the
3396 .B +
3397 should be treated like the part of the line following the
3398 .B x\ X
3399 command.
3402 The first three output commands are guaranteed to be:
3404 .BI x\ T\  device
3406 .BI x\ res\  n\ h\ v
3408 .B x init
3411 .\" --------------------------------------------------------------------
3412 .SH INCOMPATIBILITIES
3413 .\" --------------------------------------------------------------------
3415 In spite of the many extensions, groff has retained compatibility to
3416 classical troff to a large degree.
3418 For the cases where the extensions lead to collisions, a special
3419 compatibility mode with the restricted, old functionality was created
3420 for groff.
3423 .\" --------------------------------------------------------------------
3424 .SS "Groff Language"
3425 .\" --------------------------------------------------------------------
3427 .I groff
3428 provides a
3429 .B compatibility mode
3430 that allows to process roff code written for classical
3431 .troff
3432 or for other implementations of roff in a consistent way.
3435 Compatibility mode can be turned on with the
3436 .option \-C
3437 command line option, and turned on or off with the
3438 .request .cp
3439 request.
3441 The number register
3442 .esc n(.C
3443 is\~1 if compatibility mode is on, 0\~otherwise.
3446 This became necessary because the GNU concept for long names causes
3447 some incompatibilities.
3448 .I Classical troff
3449 interprets
3451 .request .dsabcd
3454 as defining a string
3455 .B ab
3456 with contents
3457 .BR cd .
3459 .IR groff
3460 mode, this will be considered as a call of a macro named
3461 .request dsabcd .
3464 Also
3465 .I classical troff
3466 interprets
3467 .esc *[
3469 .esc n[
3470 as references to a string or number register called
3471 .request [
3472 while
3473 .I groff
3474 takes this as the start of a long name.
3478 .IR "compatibility mode" ,
3479 groff interprets these things in the traditional way; so long
3480 names are not recognized.
3483 On the other hand, groff in
3484 .I GNU native mode
3485 does not allow to use the single-character escapes
3486 .esc \[rs]
3487 (backslash),
3488 .esc |
3489 (vertical bar),
3490 .esc ^
3491 (caret),
3492 .esc &
3493 (ampersand),
3494 .esc {
3495 (opening brace),
3496 .esc }
3497 (closing brace),
3498 .squoted "\[rs]\ "
3499 (space),
3500 .esc '
3501 (single quote),
3502 .esc `
3503 (backquote),
3504 .esc \-
3505 (minus),
3506 .esc _
3507 (underline),
3508 .esc !
3509 (bang),
3510 .esc %
3511 (percent),
3513 .esc c
3514 (character c) in names of strings, macros, diversions, number
3515 registers, fonts or environments, whereas
3516 .I classical troff
3517 does.
3521 .esc A
3522 escape sequence can be helpful in avoiding these escape sequences in
3523 names.
3526 Fractional pointsizes cause one noteworthy incompatibility.
3529 .I classical
3530 .IR troff ,
3532 .request ps
3533 request ignores scale indicators and so
3536 .B .ps\~10u
3540 will set the pointsize to 10\~points, whereas in groff native mode the
3541 pointsize will be set to 10\~scaled points.
3545 .I groff
3546 mode, there is a fundamental difference between unformatted input
3547 characters, and formatted output characters (glyphs).
3549 Everything that affects how a glyph will be output is
3550 stored with the glyph; once a glyph has been
3551 constructed it is unaffected by any subsequent requests that are
3552 executed, including the
3553 .request bd ,
3554 .request cs ,
3555 .request tkf ,
3556 .request tr ,
3558 .request fp
3559 requests.
3562 Normally glyphs are constructed from input characters at
3563 the moment immediately before the glyph is added to the current
3564 output line.
3566 Macros, diversions and strings are all, in fact, the same type of
3567 object; they contain lists of input characters and glyphs
3568 in any combination.
3571 Special characters can be both; before being added to the output, they
3572 act as input entities, afterwards they denote glyphs.
3575 A glyph does not behave like an input character for the
3576 purposes of macro processing; it does not inherit any of the special
3577 properties that the input character from which it was constructed
3578 might have had.
3580 The following example will make things clearer.
3585 .ft CB
3586 .Text .di x
3587 .Text \[rs]\[rs]\[rs]\[rs]
3588 .Text .br
3589 .Text .di
3590 .Text .x
3597 .I GNU mode
3598 this will be printed as
3599 .esc \[rs] .
3600 So each pair of input backslashes
3601 .squoted \[rs]\[rs]
3602 is turned into a single output backslash glyph
3603 .squoted \[rs]
3604 and the resulting output backslashes are not interpreted as escape
3605 characters when they are reread.
3608 .I Classical troff
3609 would interpret them as escape characters when they were reread and
3610 would end up printing a single backslash
3611 .squoted \[rs] .
3614 In GNU, the correct way to get a printable version of the backslash
3615 character
3616 .squoted \[rs]
3617 is the
3618 .esc (rs
3619 escape sequence, but classical troff does not provide a clean feature
3620 for getting a non-syntactical backslash.
3622 A close method is the printable version of the current escape
3623 character using the
3624 .esc e
3625 escape sequence; this works if the current escape character is not
3626 redefined.
3628 It works in both GNU mode and compatibility mode, while dirty tricks
3629 like specifying a sequence of multiple backslashes do not work
3630 reliably; for the different handling in diversions, macro definitions,
3631 or text mode quickly leads to a confusion about the necessary number of
3632 backslashes.
3635 To store an escape sequence in a diversion that will be interpreted
3636 when the diversion is reread, either the traditional
3637 .esc !
3638 transparent output facility or the
3640 .esc ?
3641 escape sequence can be used.
3644 .\" --------------------------------------------------------------------
3645 .SS "Intermediate Output"
3646 .\" --------------------------------------------------------------------
3648 The groff intermediate output format is in a state of evolution.
3650 So far it has some incompatibilities, but it is intended to establish
3651 a full compatibility to the classical troff output format.
3653 Actually the following incompatibilities exist:
3655 .Topic
3656 The positioning after the drawing of the polygons conflicts with the
3657 classical definition.
3659 .Topic
3660 The intermediate output cannot be rescaled to other devices as
3661 classical "device-independent" troff did.
3664 .\" --------------------------------------------------------------------
3665 .SH AUTHORS
3666 .\" --------------------------------------------------------------------
3668 Copyright (C) 1989, 2001, 2002, 2003 Free Software Foundation, Inc.
3671 This document is distributed under the terms of the FDL (GNU Free
3672 Documentation License) version 1.1 or later.
3674 You should have received a copy of the FDL on your system, it is also
3675 available on-line at the
3676 .URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
3678 This document was written by James Clark, with modifications by
3679 .MTO wl@gnu.org "Werner Lemberg"
3681 .MTO bwarken@mayn.de "Bernd Warken" .
3684 This document is part of
3685 .IR groff ,
3686 the GNU roff distribution.
3688 Formerly, the contents of this document was kept in the manual
3689 page
3690 .BR @g@troff (@MAN1EXT@).
3691 Only the parts dealing with the language aspects of the different
3692 .I roff
3693 systems were carried over into this document.
3696 .I troff
3697 command line options and warnings are still documented in
3698 .BR @g@troff (@MAN1EXT@).
3700 .\" --------------------------------------------------------------------
3701 .SH "SEE ALSO"
3702 .\" --------------------------------------------------------------------
3705 .I groff info
3706 .IR file ,
3707 cf.\&
3708 .BR info (1)
3709 presents all groff documentation within a single document.
3712 .BR groff (@MAN1EXT@)
3713 A list of all documentation around
3714 .IR groff .
3717 .BR groff (@MAN7EXT@)
3718 A description of the
3719 .I groff
3720 language, including a short, but complete reference of all predefined
3721 requests, registers, and escapes of plain
3722 .IR groff .
3723 From the command line, this is called using
3726 .ShellCommand man\~7\~groff
3729 .BR roff (@MAN7EXT@)
3730 A survey of
3731 .I roff
3732 systems, including pointers to further historical documentation.
3735 .RI [ CSTR\~#54\/ ]
3737 .I Nroff/\:Troff User's Manual
3739 .I J.\& F.\& Osanna
3740 of 1976 in the revision of
3741 .I Brian Kernighan
3742 of 1992, being the
3743 .URL http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz \
3744      "classical troff documentation" .
3747 .\" --------------------------------------------------------------------
3748 .\" Emacs variables
3749 .\" --------------------------------------------------------------------
3751 .\" Local Variables:
3752 .\" mode: nroff
3753 .\" End: