* doc/groff.texinfo: Improve documentation of `ad'.
[s-roff.git] / man / groff_diff.man
blobf34e3522dad32ff19e54a0854468dac42ec83b01
1 '\" e
2 .\" The above line should force the use of eqn as a preprocessor
3 .ig
4 groff_diff.man
6 Last update : 10 Feb 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, for example in
171 .TP \w'\[rs]f[xxx]'u+3n
172 .BI \[rs][ xxx ]
173 Print the special character (glyph) called
174 .IR xxx .
177 .BI \[rs]f[ xxx ]
178 Set font
179 .IR xxx .
181 Additionally,
182 .B \[rs]f[]
183 is a new syntax equal to
184 .BR \[rs]fP ,
185 i.e., to return to the previous font.
188 .BI \[rs]*[ "xxx arg1 arg2 .\|.\|." ]
189 Interpolate string
190 .IR xxx ,
191 taking
192 .IR arg1 ,
193 .IR arg2 ,
194 .I .\|.\|.\&
195 as arguments.
198 .BI \[rs]n[ xxx ]
199 Interpolate number register
200 .IR xxx .
203 .\" --------------------------------------------------------------------
204 .SS "Fractional pointsizes"
205 .\" --------------------------------------------------------------------
208 .I scaled point
209 is equal to
210 .B 1/sizescale
211 points, where
212 .B sizescale
213 is specified in the
214 .B DESC
215 file (1 by default).
217 There is a new scale indicator
218 .B z
219 that has the effect of multiplying by sizescale.
221 Requests and escape sequences in troff interpret arguments that
222 represent a pointsize as being in units of scaled points, but they
223 evaluate each such argument using a default scale indicator of
224 .BR z .
225 Arguments treated in this way are the argument to the
226 .B ps
227 request, the third argument to the
228 .B cs
229 request, the second and fourth arguments to the
230 .B tkf
231 request, the argument to the
232 .B \[rs]H
233 escape sequence, and those variants of the
234 .B \[rs]s
235 escape sequence that take a numeric expression as their argument.
238 For example, suppose sizescale is 1000; then a scaled point will be
239 equivalent to a millipoint; the call
240 .B .ps\ 10.25
241 is equivalent to
242 .B .ps\ 10.25z
243 and so sets the pointsize to 10250 scaled points, which is equal to
244 10.25 points.
247 The number register
248 .B \[rs]n[.s]
249 returns the pointsize in points as decimal fraction.
251 There is also a new number register
252 .B \[rs]n[.ps]
253 that returns the pointsize in scaled points.
256 It would make no sense to use the
257 .B z
258 scale indicator in a numeric expression whose default scale indicator
259 was neither
260 .B u
262 .BR z ,
263 and so
264 .B troff
265 disallows this.
267 Similarly it would make no sense to use a scaling indicator other than
268 .B z
270 .B u
271 in a numeric expression whose default scale indicator was
272 .BR z ,
273 and so
274 .B troff
275 disallows this as well.
278 There is also new scale indicator\~\c
279 .B s
280 which multiplies by the number of units in a scaled point.
282 So, for example,
283 .B \[rs]n[.ps]s
284 is equal to
285 .BR 1m .
286 Be sure not to confuse the
287 .B s
289 .B z
290 scale indicators.
293 .\" --------------------------------------------------------------------
294 .SS "Numeric expressions"
295 .\" --------------------------------------------------------------------
297 Spaces are permitted in a number expression within parentheses.
300 .B M
301 indicates a scale of 100ths of an em.
302 .B f
303 indicates a scale of 65536 units, providing fractions for color
304 definitions with the
305 .B defcolor
306 request.
308 For example, 0.5f = 32768u.
311 .IB e1 >? e2
312 The maximum of
313 .I e1
315 .IR e2 .
318 .IB e1 <? e2
319 The minimum of
320 .I e1
322 .IR e2 .
325 .BI ( c ; e )
326 Evaluate
327 .I e
328 using
329 .I c
330 as the default scaling indicator.
333 .I c
334 is missing, ignore scaling indicators in the evaluation of
335 .IR e .
338 .\" --------------------------------------------------------------------
339 .SS "New escape sequences"
340 .\" --------------------------------------------------------------------
343 .BI \[rs]A' anything '
344 This expands to
345 .B 1
347 .B 0
348 resp., depending on whether
349 .I anything
350 is or is not acceptable as the name of a string, macro, diversion, number
351 register, environment, font, or color.
352 It will return\~\c
353 .B 0
355 .I anything
356 is empty.
358 This is useful if you want to lookup user input in some sort of
359 associative table.
362 .BI \[rs]B' anything '
363 This expands to
364 .B 1
366 .B 0
367 resp., depending on whether
368 .I anything
369 is or is not a valid numeric expression.
371 It will return\~\c
372 .B 0
374 .I anything
375 is empty.
378 .BI \[rs]C' xxx '
379 Typeset glyph named
380 .IR xxx .
381 Normally it is more convenient to use
382 .BI \[rs][ xxx ]\f[R].
384 .B \[rs]C
385 has the advantage that it is compatible with recent versions of
386 .SM UNIX
387 and is available in compatibility mode.
390 .B \[rs]E
391 This is equivalent to an escape character, but it is not interpreted in
392 copy-mode.
394 For example, strings to start and end superscripting could be defined
395 like this
399 .ft CB
400 .Text .ds { \[rs]v'\-.3m'\[rs]s'\[rs]En[.s]*6u/10u'
402 .Text .ds } \[rs]s0\[rs]v'.3m'
406 The use of
407 .B \[rs]E
408 ensures that these definitions will work even if
409 .B \[rs]*{
410 gets interpreted in copy-mode (for example, by being used in a macro
411 argument).
415 .BI \[rs]F f
417 .BI \[rs]F( fm
419 .BI \[rs]F[ fam ]
420 Change font family.
422 This is the same as the
423 .B fam
424 request.
426 .B \[rs]F[]
427 switches back to the previous color (note that
428 .B \[rs]FP
429 won't work; it selects font family `P' instead).
432 .BI \[rs]m x
434 .BI \[rs]m( xx
436 .BI \[rs]m[ xxx ]
437 Set drawing color.
438 .B \[rs]m[]
439 switches back to the previous color.
442 .BI \[rs]M x
444 .BI \[rs]M( xx
446 .BI \[rs]M[ xxx ]
447 Set background color for filled objects drawn with the
448 .BI \[rs]D' .\|.\|. '
449 commands.
450 .B \[rs]M[]
451 switches back to the previous color.
454 .BI \[rs]N' n '
455 Typeset the glyph with index
456 .I n
457 in the current font.
458 .I n
459 can be any integer.
461 Most devices only have glyphs with indices between 0 and 255.
463 If the current font does not contain a glyph with that code,
464 special fonts will
465 .I not
466 be searched.
469 .B \[rs]N
470 escape sequence can be conveniently used in conjunction with the
471 .B char
472 request, for example
475 .ft CB
477 .Text .char \[rs][phone] \[rs]f(ZD\[rs]N'37'
482 The index of each glyph is given in the fourth column in the font
483 description file after the
484 .B charset
485 command.
487 It is possible to include unnamed glyphs in the font description
488 file by using a name of
489 .BR \-\-\- ;
491 .B \[rs]N
492 escape sequence is the only way to use these.
495 .BI \[rs]O n
497 .BI \[rs]O[ n ]
498 Suppressing troff output.
500 The escapes
501 .BR \[rs]02 ,
502 .BR \[rs]O3 ,
503 .BR \[rs]O4 ,
505 .B \[rs]O5
506 are intended for internal use by
507 .BR \%grohtml .
511 .B \[rs]O0
512 Disable any ditroff glyphs from being emitted to the device driver,
513 provided that the escape occurs at the outer level (see
514 .B \[rs]O3
516 .BR \[rs]O4 ).
519 .B \[rs]O1
520 Enable output of glyphs, provided that the escape occurs at the outer
521 level.
523 .B \[rs]O0
525 .B \[rs]O1
526 also reset the registers
527 .BR \[rs]n[opminx] ,
528 .BR \[rs]n[opminy] ,
529 .BR \[rs]n[opmaxx] ,
531 .B \[rs]n[opmaxy]
532 to\~-1.
534 These four registers mark the top left and bottom right hand corners
535 of a box which encompasses all written glyphs.
538 .B \[rs]O2
539 Provided that the escape occurs at the outer level, enable output of
540 glyphs and also write out to stderr the page number and four registers
541 encompassing the glyphs previously written since the last call to
542 .BR \[rs]O .
545 .B \[rs]O3
546 Begin a nesting level.
548 At start-up,
549 .B troff
550 is at outer level.
552 This is really an internal mechanism for
553 .B \%grohtml
554 while producing images.
556 They are generated by running the troff source through
557 .B troff
558 to the postscript device and
559 .B ghostscript
560 to produce images in PNG format.
563 .B \[rs]O3
564 escape will start a new page if the device is not html (to reduce the
565 possibility of images crossing a page boundary).
568 .B \[rs]O4
569 End a nesting level.
572 .BI \[rs]O5[ Pfilename ]
573 This escape is
574 .B \%grohtml
575 specific.
577 Provided that this escape occurs at the outer nesting level, write
578 .I filename
579 to stderr.
581 The position of the image,
582 .IR P ,
583 must be specified and must be one of l, r, c, or i (left, right,
584 centered, inline).
586 .I filename
587 will be associated with the production of the next inline image.
591 .BI \[rs]R' name\ \[+-]n '
592 This has the same effect as
596 .BI .nr\  name\ \[+-]n
600 .BI \[rs]s( nn
602 .BI \[rs]s\[+-]( nn
603 Set the point size to
604 .I nn
605 points;
606 .I nn
607 must be exactly two digits.
610 .BI \[rs]s[\[+-] n ]
612 .BI \[rs]s\[+-][ n ]
614 .BI \[rs]s'\[+-] n '
616 .BI \[rs]s\[+-]' n '
617 Set the point size to
618 .I n
619 scaled points;
620 .I n
621 is a numeric expression with a default scale indicator of\~\c
622 .BR z .
625 .BI \[rs]V x
627 .BI \[rs]V( xx
629 .BI \[rs]V[ xxx ]
630 Interpolate the contents of the environment variable
631 .IR xxx ,
632 as returned by
633 .BR getenv (3).
634 .B \[rs]V
635 is interpreted in copy-mode.
638 .BI \[rs]Y x
640 .BI \[rs]Y( xx
642 .BI \[rs]Y[ xxx ]
643 This is approximately equivalent to
644 .BI \[rs]X'\[rs]*[ xxx ]'\f[R].
645 However the contents of the string or macro
646 .I xxx
647 are not interpreted; also it is permitted for
648 .I xxx
649 to have been defined as a macro and thus contain newlines (it is not
650 permitted for the argument to
651 .B \[rs]X
652 to contain newlines).
654 The inclusion of newlines requires an extension to the UNIX troff
655 output format, and will confuse drivers that do not know about this
656 extension.
659 .BI \[rs]Z' anything '
660 Print anything and then restore the horizontal and vertical position;
661 .I anything
662 may not contain tabs or leaders.
665 .B \[rs]$0
666 The name by which the current macro was invoked.
669 .B als
670 request can make a macro have more than one name.
673 .B \[rs]$*
674 In a macro or string, the concatenation of all the arguments separated
675 by spaces.
678 .B \[rs]$@
679 In a macro or string, the concatenation of all the arguments with each
680 surrounded by double quotes, and separated by spaces.
683 .BI \[rs]$( nn
685 .BI \[rs]$[ nnn ]
686 In a macro or string, this gives the
687 .IR nn -th
689 .IR nnn -th
690 argument.
692 Macros and strings can have an unlimited number of arguments.
695 .BI \[rs]? anything \[rs]?
696 When used in a diversion, this will transparently embed
697 .I anything
698 in the diversion.
699 .I anything
700 is read in copy mode.
702 When the diversion is reread,
703 .I anything
704 will be interpreted.
705 .I anything
706 may not contain newlines; use
707 .B \[rs]!\&
708 if you want to embed newlines in a diversion.
710 The escape sequence
711 .B \[rs]?\&
712 is also recognised in copy mode and turned into a single internal
713 code; it is this code that terminates
714 .IR anything .
715 Thus
719 .ne 14v+\n(.Vu
720 .ft CB
722 .Text .nr x 1
723 .Text .nf
724 .Text .di d
725 .Text \[rs]?\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\c
726 .Text \[rs]nx\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]?\[rs]?
727 .Text .di
728 .Text .nr x 2
729 .Text .di e
730 .Text .d
731 .Text .di
732 .Text .nr x 3
733 .Text .di f
734 .Text .e
735 .Text .di
736 .Text .nr x 4
737 .Text .f
743 will print\~\c
744 .BR 4 .
747 .B \[rs]/
748 This increases the width of the preceding glyph so that the
749 spacing between that glyph and the following glyph will be
750 correct if the following glyph is a roman glyph.
752 .if t \{\
753 .  nop For example, if an italic f is immediately followed by a roman
754 .  nop right parenthesis, then in many fonts the top right portion of
755 .  nop the f will overlap the top left of the right parenthesis
756 .  nop producing \f[I]f\f[R])\f[R], which is ugly.
757 .  nop Inserting
758 .  B \[rs]/
759 .  nop produces
760 .  ie \n(.g \f[I]f\/\f[R])\f[R]
761 .  el       \f[I]f\|\f[R])\f[R]
762 .  nop and avoids this problem.
764 It is a good idea to use this escape sequence whenever an italic
765 glyph is immediately followed by a roman glyph without any
766 intervening space.
769 .B \[rs],
770 This modifies the spacing of the following glyph so that the
771 spacing between that glyph and the preceding glyph will
772 correct if the preceding glyph is a roman glyph.
774 .if t \{\
775 .  nop For example, inserting
776 .  B \[rs],
777 .  nop between the parenthesis and the f changes
778 .  nop \f[R](\f[I]f\f[R] to
779 .  ie \n(.g \f[R](\,\f[I]f\f[R].
780 .  el       \f[R](\^\f[I]f\f[R].
782 It is a good idea to use this escape sequence whenever a roman
783 glyph is immediately followed by an italic glyph without any
784 intervening space.
787 .B \[rs])
788 Like
789 .B \[rs]&
790 except that it behaves like a character declared with the
791 .B cflags
792 request to be transparent for the purposes of end-of-sentence
793 recognition.
796 .B \[rs]~
797 This produces an unbreakable space that stretches like a normal
798 inter-word space when a line is adjusted.
801 .B \[rs]:
802 This causes the insertion of a zero-width break point.
804 It is equal to
805 .B \[rs]%
806 within a word but without insertion of a soft hyphen character.
809 .B \[rs]#
810 Everything up to and including the next newline is ignored.
812 This is interpreted in copy mode.
814 It is like
815 .B \[rs]"
816 except that
817 .B \[rs]"
818 does not ignore the terminating newline.
821 .\" --------------------------------------------------------------------
822 .SS "New requests"
823 .\" --------------------------------------------------------------------
826 .BI .aln\  xx\ yy
827 Create an alias
828 .I xx
829 for number register object named
830 .IR yy .
831 The new name and the old name will be exactly equivalent.
834 .I yy
835 is undefined, a warning of type
836 .B reg
837 will be generated, and the request will be ignored.
840 .BI .als\  xx\ yy
841 Create an alias
842 .I xx
843 for request, string, macro, or diversion object named
844 .IR yy .
846 The new name and the old name will be exactly equivalent (it is
847 similar to a hard rather than a soft link).
850 .I yy
851 is undefined, a warning of type
852 .B mac
853 will be generated, and the request will be ignored.
856 .BR de ,
857 .BR am ,
858 .BR di ,
859 .BR da ,
860 .BR ds ,
862 .B as
863 requests only create a new object if the name of the macro, diversion
864 or string diversion is currently undefined or if it is defined to be a
865 request; normally they modify the value of an existing object.
868 .BI .ami\  xx\ yy
869 Append to macro indirectly.
871 See the
872 .B dei
873 request below for more information.
876 .BI .am1\  xx\ yy
877 Similar to
878 .BR .am , 
879 but compatibility mode is switched off during execution.
881 To be more precise, a `compatibility save' token is inserted at the
882 beginning of the macro addition, and a `compatibility restore' token at
883 the end.
885 As a consequence, the requests
886 .BR am ,
887 .BR am1 ,
888 .BR de ,
890 .B de1
891 can be intermixed freely since the compatibility save/\:restore tokens
892 only affect the macro parts defined by
893 .B .am1
895 .BR .ds1 .
898 .BI .asciify\  xx
899 This request `unformats' the diversion
900 .I xx
901 in such a way that
902 .SM ASCII
903 and space characters (and some escape sequences) that were formatted
904 and diverted into
905 .I xx
906 will be treated like ordinary input characters when
907 .I xx
908 is reread.
909 Useful for diversions in conjunction with the
910 .B .writem
911 request.
913 It can be also used for gross hacks; for example, this
917 .ne 7v+\n(.Vu
918 .ft CB
920 .Text .tr @.
921 .Text .di x
922 .Text @nr n 1
923 .Text .br
924 .Text .di
925 .Text .tr @@
926 .Text .asciify x
927 .Text .x
933 will set register\~\c
934 .B n
935 to\~1.
937 Note that glyph information (font, font size, etc.) is not preserved;
939 .B .unformat
940 instead.
943 .BI .as1\  xx\ yy
944 Similar to
945 .BR .as , 
946 but compatibility mode is switched off during expansion.
948 To be more precise, a `compatibility save' token is inserted at the
949 beginning of the string, and a `compatibility restore' token at the end.
951 As a consequence, the requests
952 .BR as ,
953 .BR as1 ,
954 .BR ds ,
956 .B ds1
957 can be intermixed freely since the compatibility save/\:restore tokens
958 only affect the (sub)strings defined by
959 .B as1
961 .BR ds1 .
964 .B .backtrace
965 Print a backtrace of the input stack on stderr.
968 .BI .blm\  xx
969 Set the blank line macro to
970 .IR xx .
971 If there is a blank line macro, it will be invoked when a blank line
972 is encountered instead of the usual troff behaviour.
975 .BI .box\  xx
977 .BI .boxa\  xx
978 These requests are similar to the
979 .B di
981 .B da
982 requests with the exception that a partially filled line will not
983 become part of the diversion (i.e., the diversion always starts with a
984 new line) but restored after ending the diversion, discarding the
985 partially filled line which possibly comes from the diversion.
988 .B .break
989 Break out of a while loop.
991 See also the
992 .B while
994 .B continue
995 requests.
997 Be sure not to confuse this with the
998 .B br
999 request.
1002 .B .brp
1003 This is the same as
1004 .BR \[rs]p .
1007 .BI .cflags\  n\ c1\ c2\|.\|.\|.\&
1008 Characters
1009 .IR c1 ,
1010 .IR c2 ,\|.\|.\|.\&
1011 have properties determined by
1012 .IR n ,
1013 which is ORed from the following:
1016 .IP 1
1017 The character ends sentences (initially characters
1018 .B .?!\&
1019 have this property).
1021 .IP 2
1022 Lines can be broken before the character (initially no characters have
1023 this property); a line will not be broken at a character with this
1024 property unless the characters on each side both have non-zero
1025 hyphenation codes.
1027 .IP 4
1028 Lines can be broken after the character (initially characters
1029 .B \-\[rs][hy]\[rs][em]
1030 have this property); a line will not be broken at a character with
1031 this property unless the characters on each side both have non-zero
1032 hyphenation codes.
1034 .IP 8
1035 The character overlaps horizontally (initially characters
1036 .B \[rs][ul]\[rs][rn]\[rs][ru]\[rs][radicalex]\[rs][sqrtex]
1037 have this property).
1039 .IP 16
1040 The character overlaps vertically (initially character
1041 .B \[rs][br]
1042 has this property).
1044 .IP 32
1045 An end-of-sentence character followed by any number of characters with
1046 this property will be treated as the end of a sentence if followed by
1047 a newline or two spaces; in other words the character is transparent
1048 for the purposes of end-of-sentence recognition; this is the same as
1049 having a zero space factor in \*[tx] (initially characters
1050 .B \[dq]')]*\[rs](dg\[rs](rq
1051 have this property).
1055 .BI .char\  c\ string
1056 Define glyph
1057 .I c
1058 to be
1059 .IR string .
1060 Every time glyph
1061 .I c
1062 needs to be printed,
1063 .I string
1064 will be processed in a temporary environment and the result will be
1065 wrapped up into a single object.
1067 Compatibility mode will be turned off and the escape character will be
1068 set to
1069 .B \[rs]
1070 while
1071 .I string
1072 is being processed.
1074 Any emboldening, constant spacing or track kerning will be applied to
1075 this object rather than to individual glyphs in
1076 .IR string .
1079 A glyph defined by this request can be used just like a normal
1080 glyph provided by the output device.
1082 In particular other characters can be translated to it with the
1083 .B tr
1084 request; it can be made the leader character by the
1085 .B lc
1086 request; repeated patterns can be drawn with the character using the
1087 .B \[rs]l
1089 .B \[rs]L
1090 escape sequences; words containing the character can be hyphenated
1091 correctly, if the
1092 .B hcode
1093 request is used to give the character a hyphenation code.
1096 There is a special anti-recursion feature: Use of glyph within the
1097 glyph's definition will be handled like normal glyphs not
1098 defined with
1099 .BR char .
1101 A glyph definition can be removed with the
1102 .B rchar
1103 request.
1106 .BI .chop\  xx
1107 Chop the last element off macro, string, or diversion
1108 .IR xx .
1109 This is useful for removing the newline from the end of diversions
1110 that are to be interpolated as strings.
1113 .BI .close\  stream
1114 Close the stream named
1115 .IR stream ;
1116 .I stream
1117 will no longer be an acceptable argument to the
1118 .B write
1119 request.
1121 See the
1122 .B open
1123 request.
1126 .B .continue
1127 Finish the current iteration of a while loop.
1129 See also the
1130 .B while
1132 .B break
1133 requests.
1136 .BI .color\  n
1138 .I n
1139 is non-zero or missing, enable colors (this is the default), otherwise
1140 disable them.
1143 .BI .cp\  n
1145 .I n
1146 is non-zero or missing, enable compatibility mode, otherwise disable
1149 In compatibility mode, long names are not recognised, and the
1150 incompatibilities caused by long names do not arise.
1153 .BI .defcolor\  xxx\ scheme\ color_components
1154 Define color.
1155 .I scheme
1156 can be one of the following values:
1157 .B rgb
1158 (three components),
1159 .B cym
1160 (three components),
1161 .B cmyk
1162 (four components), and
1163 .B gray
1165 .B grey
1166 (one component).
1168 Color components can be given either as a hexadecimal string or as
1169 positive decimal integers in the range 0-65535.
1171 A hexadecimal string contains all color components concatenated; it
1172 must start with either
1173 .B #
1175 .BR ## .
1176 The former specifies hex values in the range 0-255 (which are
1177 internally multiplied by\~257), the latter in the range 0-65535.
1179 Examples: #FFC0CB (pink), ##ffff0000ffff (magenta).
1181 A new scaling indicator\~\c
1182 .B f
1183 has been introduced which multiplies its value by\~65536; this makes
1184 it convenient to specify color components as fractions in the range 0
1185 to\~1.
1187 Example:
1191 .ft CB
1192 .Text .defcolor darkgreen rgb 0.1f 0.5f 0.2f
1198 Note that
1199 .B f
1200 is the default scaling indicator for the
1201 .B defcolor
1202 request, thus the above statement is equivalent to
1206 .ft CB
1207 .Text .defcolor darkgreen rgb 0.1 0.5 0.2
1213 The color named
1214 .B default
1215 (which is device-specific) can't be redefined.
1217 It is possible that the default color for
1218 .esc M
1220 .esc m
1221 is not the same.
1224 .BI .dei\  xx\ yy
1225 Define macro indirectly.
1227 The following example
1231 .ne 2v+\n(.Vu
1232 .ft CB
1234 .Text .ds xx aa
1235 .Text .ds yy bb
1236 .Text .dei xx yy
1242 is equivalent to
1246 .ft CB
1247 .Text .de aa bb
1253 .BI .de1\  xx\ yy
1254 Similar to
1255 .BR .de , 
1256 but compatibility mode is switched off during execution.
1258 On entry, the current compatibility mode is saved and restored at exit.
1261 .BI .do\  xxx
1262 Interpret
1263 .I .xxx
1264 with compatibility mode disabled.
1266 For example,
1271 .ft CB
1272 .Text .do fam T
1277 would have the same effect as
1280 .ft CB
1281 .Text .fam T
1286 except that it would work even if compatibility mode had been enabled.
1288 Note that the previous compatibility mode is restored before any files
1289 sourced by
1290 .I xxx
1291 are interpreted.
1296 .BI .ds1\  xx\ yy
1297 Similar to
1298 .BR .ds , 
1299 but compatibility mode is switched off during expansion.
1301 To be more precise, a `compatibility save' token is inserted at the
1302 beginning of the string, and a `compatibility restore' token at the end.
1305 .B .ecs
1306 Save current escape character.
1309 .B .ecr
1310 Restore escape character saved with
1311 .BR ecs .
1312 Without a previous call to
1313 .BR ecs ,
1314 .RB ` \[rs] '
1315 will be the new escape character.
1318 .BI .evc\  xx
1319 Copy the contents of environment
1320 .I xx
1321 to the current environment.
1323 No pushing or popping of environments will be done.
1326 .BI .fam\  xx
1327 Set the current font family to
1328 .IR xx .
1329 The current font family is part of the current environment.
1331 .I xx
1332 is missing, switch back to previous font family.
1334 The value at start-up is `T'.
1336 See the description of the
1337 .B sty
1338 request for more information on font families.
1341 .BI .fchar\  c\ string
1342 Define fallback glyph
1343 .I c
1344 to be
1345 .IR string .
1347 The syntax of this request is the same as the
1348 .B char
1349 request; the only difference is that a glyph defined with
1350 .B char
1351 hides the glyph with the same name in the current font, whereas a
1352 glyph defined with
1353 .B fchar
1354 is checked only if the particular glyph isn't found in the current font.
1356 This test happens before checking special fonts.
1359 .BI .fschar\  f\ c\ string
1360 Define fallback glyph
1361 .I c
1362 for font
1363 .I f
1364 to be
1365 .IR string .
1367 The syntax of this request is the same as the
1368 .B char
1369 request (with an additional argument to specify the font); a glyph
1370 defined with
1371 .B fschar
1372 is searched after the list of fonts declared with the
1373 .B fspecial
1374 request but before the list of fonts declared with
1375 .BR special .
1378 .BI .fspecial\  f\ s1\ s2\|.\|.\|.\&
1379 When the current font is
1380 .IR f ,
1381 fonts
1382 .IR s1 ,
1383 .IR s2 ,\|.\|.\|.\&
1384 will be special, that is, they will searched for glyphs not in
1385 the current font.
1387 Any fonts specified in the
1388 .B special
1389 request will be searched after fonts specified in the
1390 .B fspecial
1391 request.
1393 Without argument, reset the list of global special fonts to be empty.
1396 .BI .ftr\  f\ g
1397 Translate font
1398 .I f
1400 .IR g .
1401 Whenever a font named
1402 .I f
1403 is referred to in an
1404 .B \[rs]f
1405 escape sequence, or in the
1406 .BR ft ,
1407 .BR ul ,
1408 .BR bd ,
1409 .BR cs ,
1410 .BR tkf ,
1411 .BR special ,
1412 .BR fspecial ,
1413 .BR fp ,
1415 .BR sty
1416 requests, font
1417 .I g
1418 will be used.
1420 .I g
1421 is missing, or equal to
1422 .I f
1423 then font
1424 .I f
1425 will not be translated.
1428 .BI .hcode \ c1\ code1\ c2\ code2\|.\|.\|.\&
1429 Set the hyphenation code of character
1430 .I c1
1432 .I code1
1433 and that of
1434 .I c2
1436 .IR code2 .
1437 A hyphenation code must be a single input character (not a special
1438 character) other than a digit or a space.
1440 Initially each lower-case letter \%a-z has a hyphenation code, which is
1441 itself, and each upper-case letter \%A-Z has a hyphenation code which is
1442 the lower-case version of itself.
1444 See also the
1445 .B hpf
1446 request.
1449 .BI .hla\  lang
1450 Set the current hyphenation language to
1451 .IR lang .
1452 Hyphenation exceptions specified with the
1453 .B hw
1454 request and hyphenation patterns specified with the
1455 .B hpf
1456 request are both associated with the current hyphenation language.
1459 .B hla
1460 request is usually invoked by the
1461 .B troffrc
1462 file.
1465 .BI .hlm\  n
1466 Set the maximum number of consecutive hyphenated lines to\~\c
1467 .IR n .
1469 .I n
1470 is negative, there is no maximum.
1472 The default value is\~\-1.
1474 This value is associated with the current environment.
1476 Only lines output from an environment count towards the maximum
1477 associated with that environment.
1479 Hyphens resulting from
1480 .B \[rs]%
1481 are counted; explicit hyphens are not.
1484 .BI .hpf\  file
1485 Read hyphenation patterns from
1486 .IR file ;
1487 this will be searched for in the same way that
1488 .IB name .tmac
1489 is searched for when the
1490 .BI \-m name
1491 option is specified.
1493 It should have the same format as (simple) \*[tx] patterns files.
1495 More specifically, the following scanning rules are implemented.
1498 .IP \[bu]
1499 A percent sign starts a comment (up to the end of the line) even if
1500 preceded by a backslash.
1502 .IP \[bu]
1503 No support for `digraphs' like
1504 .BR \[rs]$ .
1506 .IP \[bu]
1507 .BI ^^ xx
1508 .RI ( x
1509 is 0-9 or a-f) and
1510 .BI ^^ x
1511 (character code of\~\c
1512 .I x
1513 in the range 0-127) are recognized; other use of
1514 .B ^
1515 causes an error.
1517 .IP \[bu]
1518 No macro expansion.
1520 .IP \[bu]
1521 .B hpf
1522 checks for the expression
1523 .B \[rs]patterns{.\|.\|.}
1524 (possibly with whitespace before and after the braces).
1526 Everything between the braces is taken as hyphenation patterns.
1528 Consequently,
1529 .B {
1531 .B }
1532 are not allowed in patterns.
1534 .IP \[bu]
1535 Similarly,
1536 .B \[rs]hyphenation{.\|.\|.}
1537 gives a list of hyphenation exceptions.
1539 .IP \[bu]
1540 .B \[rs]endinput
1541 is recognized also.
1543 .IP \[bu]
1544 For backwards compatibility, if
1545 .B \[rs]patterns
1546 is missing, the whole file is treated as a list of hyphenation patterns
1547 (only recognizing the
1548 .BR % \~\c
1549 character as the start of a comment).
1553 Use the
1554 .B hpfcode
1555 request to map the encoding used in hyphenation patterns files to
1556 .BR groff 's
1557 input encoding.
1559 The set of hyphenation patterns is associated with the current language
1560 set by the
1561 .B hla
1562 request.
1565 .B hpf
1566 request is usually invoked by the
1567 .B troffrc
1568 file; a second call replaces the old patterns with the new ones.
1571 .BI .hpfa\  file
1572 The same as
1573 .B hpf
1574 except that the hyphenation patterns from
1575 .I file
1576 are appended to the patterns already loaded in the current language.
1579 .BI .hpfcode\  a\ b\ c\ d\ .\|.\|.
1580 After reading a hyphenation patterns file with the
1581 .B hpf
1583 .B hpfa
1584 request, convert all characters with character code\~\c
1585 .I a
1586 in the recently read patterns to character code\~\c
1587 .IR b ,
1588 character code\~\c
1589 .I c
1590 to\~\c
1591 .IR d ,
1592 etc.
1594 Initially, all character codes map to themselves.
1596 The arguments of
1597 .B hpfcode
1598 must be integers in the range 0 to\~255.
1600 Note that it is even possible to use character codes which are invalid in
1601 .B groff
1602 otherwise.
1605 .BI .hym\  n
1606 Set the
1607 .I hyphenation margin
1608 to\~\c
1609 .IR n :
1610 when the current adjustment mode is not\~\c
1611 .BR b ,
1612 the line will not be hyphenated if the line is no more than
1613 .I n
1614 short.
1616 The default hyphenation margin is\~0.
1618 The default scaling indicator for this request is\~\c
1619 .IR m .
1620 The hyphenation margin is associated with the current environment.
1622 The current hyphenation margin is available in the
1623 .B \[rs]n[.hym]
1624 register.
1627 .BI .hys\  n
1628 Set the
1629 .I hyphenation space
1630 to\~\c
1631 .IR n :
1632 when the current adjustment mode is\~\c
1633 .B b
1634 don't hyphenate the line if the line can be justified by adding no
1635 more than
1636 .I n
1637 extra space to each word space.
1639 The default hyphenation space is\~0.
1641 The default scaling indicator for this request is\~\c
1642 .BR m .
1643 The hyphenation space is associated with the current environment.
1645 The current hyphenation space is available in the
1646 .B \[rs]n[.hys]
1647 register.
1650 .BI .itc\  n\ macro
1651 Variant of
1652 .B .it
1653 for which a line interrupted with
1654 .B \[rs]c
1655 counts as one input line.
1658 .BI .kern\  n
1660 .I n
1661 is non-zero or missing, enable pairwise kerning, otherwise disable it.
1664 .BI .length\  xx\ string
1665 Compute the length of
1666 .I string
1667 and return it in the number register
1668 .I xx
1669 (which is not necessarily defined before).
1672 .BI .linetabs\  n
1674 .I n
1675 is non-zero or missing, enable line-tabs mode, otherwise disable it
1676 (which is the default).
1678 In line-tabs mode, tab distances are computed relative to the
1679 (current) output line.
1681 Otherwise they are taken relative to the input line.
1683 For example, the following
1687 .ne 6v+\n(.Vu
1688 .ft CB
1690 .Text .ds x a\[rs]t\[rs]c
1691 .Text .ds y b\[rs]t\[rs]c
1692 .Text .ds z c
1693 .Text .ta 1i 3i
1694 .Text \[rs]*x
1695 .Text \[rs]*y
1696 .Text \[rs]*z
1702 yields
1706 a         b         c
1710 In line-tabs mode, the same code gives
1714 a         b                   c
1718 Line-tabs mode is associated with the current environment; the
1719 read-only number register
1720 .B \\[rs]n[.linetabs]
1721 is set to\~1 if in line-tabs mode, and 0 otherwise.
1724 .BI .mso\  file
1725 The same as the
1726 .B so
1727 request except that
1728 .I file
1729 is searched for in the same directories as macro files for the the
1730 .B \-m
1731 command line option.
1733 If the file name to be included has the form
1734 .IB name .tmac
1735 and it isn't found,
1736 .B mso
1737 tries to include
1738 .BI tmac. name
1739 instead and vice versa.
1742 .BI .nop \ anything
1743 Execute
1744 .IR anything .
1745 This is similar to `.if\ 1'.
1748 .B .nroff
1749 Make the
1750 .B n
1751 built-in condition true and the
1752 .B t
1753 built-in condition false.
1755 This can be reversed using the
1756 .B troff
1757 request.
1760 .BI .open\  stream\ filename
1761 Open
1762 .I filename
1763 for writing and associate the stream named
1764 .I stream
1765 with it.
1767 See also the
1768 .B close
1770 .B write
1771 requests.
1773 .TP 
1774 .BI .opena\  stream\ filename
1775 Like
1776 .BR open ,
1777 but if
1778 .I filename
1779 exists, append to it instead of truncating it.
1782 .BI .output\  string
1783 Emit
1784 .I string
1785 directly to the intermediate output (subject to copy-mode interpretation);
1786 this is similar to
1787 .B \[rs]!
1788 used at the top level.
1790 An initial double quote in
1791 .I string
1792 is stripped off to allow initial blanks.
1795 .B .pnr
1796 Print the names and contents of all currently defined number registers
1797 on stderr.
1800 .BI .psbb \ filename
1801 Get the bounding box of a PostScript image
1802 .IR filename .
1803 This file must conform to Adobe's Document Structuring Conventions;
1804 the command looks for a
1805 .B \%%%BoundingBox
1806 comment to extract the bounding box values.
1808 After a successful call, the coordinates (in PostScript units) of the
1809 lower left and upper right corner can be found in the registers
1810 .BR \[rs]n[llx] ,
1811 .BR \[rs]n[lly] ,
1812 .BR \[rs]n[urx] ,
1814 .BR \[rs]n[ury] ,
1815 respectively.
1817 If some error has occurred, the four registers are set to zero.
1820 .BI .pso \ command
1821 This behaves like the
1822 .B so
1823 request except that input comes from the standard output of
1824 .IR command .
1827 .B .ptr
1828 Print the names and positions of all traps (not including input line
1829 traps and diversion traps) on stderr.
1831 Empty slots in the page trap list are printed as well, because they
1832 can affect the priority of subsequently planted traps.
1835 .BI .pvs \ \[+-]n
1836 Set the post-vertical line space to
1837 .IR n ;
1838 default scale indicator is\~\c
1839 .BR p .
1841 This value will be added to each line after it has been output.
1843 With no argument, the post-vertical line space is set to its previous
1844 value.
1847 The total vertical line spacing consists of four components:
1848 .B .vs
1850 .B \[rs]x
1851 with a negative value which are applied before the line is output, and
1852 .B .pvs
1854 .B \[rs]x
1855 with a positive value which are applied after the line is output.
1858 .BI .rchar\  c1\ c2\|.\|.\|.\&
1859 Remove the definitions of glyphs
1860 .IR c1 ,
1861 .IR c2 ,\|.\|.\|.
1862 This undoes the effect of a
1863 .B char
1864 request.
1867 .B .return
1868 Within a macro, return immediately.
1870 No effect otherwise.
1873 .BI .rfschar\  c1\ c2\|.\|.\|.\&
1874 Remove the font-specific definitions of glyphs
1875 .IR c1 ,
1876 .IR c2 ,\|.\|.\|.
1877 This undoes the effect of a
1878 .B fschar
1879 request.
1882 .B .rj
1884 .BI .rj \~n
1885 Right justify the next
1886 .IR n \~\c
1887 input lines.
1889 Without an argument right justify the next input line.
1891 The number of lines to be right justified is available in the
1892 .B \[rs]n[.rj]
1893 register.
1895 This implicitly does
1896 .BR .ce \~0 .
1898 .B ce
1899 request implicitly does
1900 .BR .rj \~0 .
1903 .BI .rnn \ xx\ yy
1904 Rename number register
1905 .I xx
1907 .IR yy .
1910 .BI .schar\  c\ string
1911 Define global fallback glyph
1912 .I c
1913 to be
1914 .IR string .
1916 The syntax of this request is the same as the
1917 .B char
1918 request; a glyph defined with
1919 .B schar
1920 is searched after the list of fonts declared with the
1921 .B special
1922 request but before the mounted special fonts.
1925 .BI .shc\  c
1926 Set the soft hyphen character to
1927 .IR c .
1929 .I c
1930 is omitted, the soft hyphen character will be set to the default
1931 .BR \[rs](hy .
1932 The soft hyphen character is the glyph which will be inserted when
1933 a word is hyphenated at a line break.
1935 If the soft hyphen character does not exist in the font of the
1936 glyph immediately preceding a potential break point, then the line
1937 will not be broken at that point.
1939 Neither definitions (specified with the
1940 .B char
1941 request) nor translations (specified with the
1942 .B tr
1943 request) are considered when finding the soft hyphen character.
1946 .BI .shift\  n
1947 In a macro, shift the arguments by
1948 .I n
1949 positions: argument\~\c
1950 .I i
1951 becomes argument
1952 .IR i \- n ;
1953 arguments 1 to\~\c
1954 .I n
1955 will no longer be available.
1958 .I n
1959 is missing, arguments will be shifted by\~1.
1961 Shifting by negative amounts is currently undefined.
1964 .BI .sizes\  s1\ s2\|.\|.\|.\|sn\  [0]
1965 This command is similar to the
1966 .B sizes
1967 command of a
1968 .B DESC
1969 file.
1971 It sets the available font sizes for the current font to
1972 .IR s1 ,
1973 .IR s2 ,\|.\|.\|.\|,\~ sn
1974 scaled points.
1976 The list of sizes can be terminated by an optional\~\c
1977 .BR 0 .
1979 Each
1980 .I si
1981 can also be a range of sizes
1982 .IR m - n .
1984 Contrary to the font file command, the list can't extend over more
1985 than a single line.
1988 .BI .special\  s1\ s2\|.\|.\|.\&
1989 Fonts
1990 .IR s1 ,
1991 .IR s2 ,
1992 are special and will be searched for glyphs not in the current
1993 font.
1995 Without arguments, reset the list of special fonts to be empty.
1998 .BI .spreadwarn\  limit
1999 Make
2000 .B troff
2001 emit a warning if the additional space inserted for each space between
2002 words in an output line is larger or equal to
2003 .IR limit .
2005 A negative value is changed to zero; no argument toggles the warning on
2006 and off without changing
2007 .IR limit .
2009 The default scaling indicator is\~\c
2010 .BR m .
2012 At startup,
2013 .B spreadwarn
2014 is deactivated, and
2015 .I limit
2016 is set to 3m.
2018 For example,
2019 .B .spreadwarn\ 0.2m
2020 will cause a warning if
2021 .B troff
2022 must add 0.2m or more for each interword space in a line.
2024 This request is active only if text is justified to both margins (using
2025 .BR .ad\ b ).
2028 .BI .sty\  n\ f
2029 Associate style\~\c
2030 .I f
2031 with font position\~\c
2032 .IR n .
2033 A font position can be associated either with a font or with a style.
2035 The current font is the index of a font position and so is also either
2036 a font or a style.
2038 When it is a style, the font that is actually used is the font the
2039 name of which is the concatenation of the name of the current family
2040 and the name of the current style.
2042 For example, if the current font is\~1 and font position\~1 is
2043 associated with style\~\c
2044 .B R
2045 and the current font family is\~\c
2046 .BR T ,
2047 then font
2048 .BR TR
2049 will be used.
2051 If the current font is not a style, then the current family is ignored.
2053 When the requests
2054 .BR cs ,
2055 .BR bd ,
2056 .BR tkf ,
2057 .BR uf ,
2059 .B fspecial
2060 are applied to a style, then they will instead be applied to the
2061 member of the current family corresponding to that style.
2063 The default family can be set with the
2064 .B \-f
2065 option.
2068 .B styles
2069 command in the
2070 .SM DESC
2071 file controls which font positions (if any) are initially associated
2072 with styles rather than fonts.
2075 .BI .substring\  xx\ n1\  [ n2 ]
2076 Replace the string named
2077 .I xx
2078 with the substring defined by the indices
2079 .I n1
2081 .IR n2 .
2082 The first character in the string has index\~0.
2085 .I n2
2086 is omitted, it is taken to be equal to the string's length.
2088 If the index value
2089 .I n1
2091 .I n2
2092 is negative, it will be counted from the end of the string,
2093 going backwards:
2095 The last character has index\~-1, the character before the last
2096 character has index\~-2, etc.
2099 .BI .tkf\  f\ s1\ n1\ s2\ n2
2100 Enable track kerning for font
2101 .IR f .
2102 When the current font is
2103 .I f
2104 the width of every glyph will be increased by an amount between
2105 .I n1
2107 .IR n2 ;
2108 when the current point size is less than or equal to
2109 .I s1
2110 the width will be increased by
2111 .IR n1 ;
2112 when it is greater than or equal to
2113 .I s2
2114 the width will be increased by
2115 .IR n2 ;
2116 when the point size is greater than or equal to
2117 .I s1
2118 and less than or equal to
2119 .I s2
2120 the increase in width is a linear function of the point size.
2123 .BI .tm1\  string
2124 Similar to the
2125 .B tm
2126 request,
2127 .I string
2128 is read in copy mode and written on the standard error, but an initial
2129 double quote in
2130 .I string
2131 is stripped off to allow initial blanks.
2134 .BI .tmc\  string
2135 Similar to
2136 .B tm1
2137 but without writing a final newline.
2140 .BI .trf\  filename
2141 Transparently output the contents of file
2142 .IR filename .
2143 Each line is output as if preceded by
2144 .BR \[rs]! ;
2145 however, the lines are not subject to copy-mode interpretation.
2147 If the file does not end with a newline, then a newline will be added.
2149 For example, you can define a macro\~\c
2150 .I x
2151 containing the contents of file\~\c
2152 .IR f ,
2153 using
2157 .ne 2v+\n(.Vu
2158 .ft CB
2160 .Text .di x
2161 .Text .trf f
2162 .Text .di
2168 Unlike with the
2169 .B cf
2170 request, the file cannot contain characters such as
2171 .SM NUL
2172 that are not legal troff input characters.
2175 .BI .trin\  abcd
2176 This is the same as the
2177 .B tr
2178 request except that the
2179 .B asciify
2180 request will use the character code (if any) before the character
2181 translation.
2183 Example:
2188 .ft CB
2189 .Text .trin ax
2190 .Text .di xxx
2191 .Text a
2192 .Text .br
2193 .Text .di
2194 .Text .xxx
2195 .Text .trin aa
2196 .Text .asciify xxx
2197 .Text .xxx
2203 The result is
2204 .BR x\ a .
2206 Using
2207 .BR tr ,
2208 the result would be
2209 .BR x\ x .
2212 .BI .trnt\  abcd
2213 This is the same as the
2214 .B tr
2215 request except that the translations do not apply to text that is
2216 transparently throughput into a diversion with
2217 .BR \[rs]! .
2218 For example,
2223 .ft CB
2224 .Text .tr ab
2225 .Text .di x
2226 .Text \[rs]!.tm a
2227 .Text .di
2228 .Text .x
2234 will print\~\c
2235 .BR b ;
2237 .B trnt
2238 is used instead of
2239 .B tr
2240 it will print\~\c
2241 .BR a .
2245 .B .troff
2246 Make the
2247 .B n
2248 built-in condition false, and the
2249 .B t
2250 built-in condition true.
2252 This undoes the effect of the
2253 .B nroff
2254 request.
2257 .BI .unformat\  xx
2258 This request `unformats' the diversion
2259 .IR xx .
2260 Contrary to the
2261 .B .asciify
2262 request, which tries to convert formatted elements of the diversion
2263 back to input tokens as much as possible,
2264 .B .unformat
2265 will only handle tabs and spaces between words (usually caused by
2266 spaces or newlines in the input) specially.
2268 The former are treated as if they were input tokens, and the latter
2269 are stretchable again.
2271 Note that the vertical size of lines is not preserved.
2273 Glyph information (font, font size, space width, etc.) is retained.
2275 Useful in conjunction with the
2276 .B .box
2278 .B .boxa
2279 requests.
2282 .BI .vpt\  n
2283 Enable vertical position traps if
2284 .I n
2285 is non-zero, disable them otherwise.
2287 Vertical position traps are traps set by the
2288 .B wh
2290 .B dt
2291 requests.
2293 Traps set by the
2294 .B it
2295 request are not vertical position traps.
2297 The parameter that controls whether vertical position traps are
2298 enabled is global.
2300 Initially vertical position traps are enabled.
2303 .BI .warn\  n
2304 Control warnings.
2305 .I n
2306 is the sum of the numbers associated with each warning that is to be
2307 enabled; all other warnings will be disabled.
2309 The number associated with each warning is listed in
2310 .BR @g@troff (@MAN1EXT@).
2312 For example,
2313 .B .warn\~0
2314 will disable all warnings, and
2315 .B .warn\~1
2316 will disable all warnings except that about missing glyphs.
2319 .I n
2320 is not given, all warnings will be enabled.
2323 .BI .warnscale\  si
2324 Set the scaling indicator used in warnings to
2325 .IR si .
2327 Valid values for
2328 .I si
2330 .BR u ,
2331 .BR i ,
2332 .BR c ,
2333 .BR p ,
2335 .BR P .
2337 At startup, it is set to\~\c
2338 .BR i .
2341 .BI .while \ c\ anything
2342 While condition\~\c
2343 .I c
2344 is true, accept
2345 .I anything
2346 as input;
2347 .IR c \~\c
2348 can be any condition acceptable to an
2349 .B if
2350 request;
2351 .I anything
2352 can comprise multiple lines if the first line starts with
2353 .B \[rs]{
2354 and the last line ends with
2355 .BR \[rs]} .
2356 See also the
2357 .B break
2359 .B continue
2360 requests.
2363 .BI .write\  stream\ anything
2364 Write
2365 .I anything
2366 to the stream named
2367 .IR stream .
2368 .I stream
2369 must previously have been the subject of an
2370 .B open
2371 request.
2372 .I anything
2373 is read in copy mode;
2374 a leading\~\c
2375 .B \[dq]
2376 will be stripped.
2379 .BI .writec\  stream\ anything
2380 Similar to
2381 .B write
2382 but without writing a final newline.
2385 .BI .writem\  stream\ xx
2386 Write the contents of the macro or string
2387 .I xx
2388 to the stream named
2389 .IR stream .
2390 .I stream
2391 must previously have been the subject of an
2392 .B open
2393 request.
2394 .I xx
2395 is read in copy mode.
2398 .\" --------------------------------------------------------------------
2399 .SS "Extended requests"
2400 .\" --------------------------------------------------------------------
2403 .BI .cf\  filename
2404 When used in a diversion, this will embed in the diversion an object
2405 which, when reread, will cause the contents of
2406 .I filename
2407 to be transparently copied through to the output.
2409 In UNIX troff, the contents of
2410 .I filename
2411 is immediately copied through to the output regardless of whether
2412 there is a current diversion; this behaviour is so anomalous that it
2413 must be considered a bug.
2416 .BI .ev\  xx
2418 .I xx
2419 is not a number, this will switch to a named environment called
2420 .IR xx .
2421 The environment should be popped with a matching
2422 .B ev
2423 request without any arguments, just as for numbered environments.
2425 There is no limit on the number of named environments; they will be
2426 created the first time that they are referenced.
2429 .BI .ss\  m\ n
2430 When two arguments are given to the
2431 .B ss
2432 request, the second argument gives the
2433 .IR "sentence space size" .
2434 If the second argument is not given, the sentence space size
2435 will be the same as the word space size.
2437 Like the word space size, the sentence space is in units of
2438 one twelfth of the spacewidth parameter for the current font.
2440 Initially both the word space size and the sentence
2441 space size are\~12.
2443 Contrary to UNIX troff, GNU troff handles this request in nroff mode
2444 also; a given value is then rounded down to the nearest multiple
2445 of\~12.
2447 The sentence space size is used in two circumstances.
2449 If the end of a sentence occurs at the end of a line in fill mode,
2450 then both an inter-word space and a sentence space will be added; if
2451 two spaces follow the end of a sentence in the middle of a line, then
2452 the second space will be a sentence space.
2454 Note that the behaviour of UNIX troff will be exactly that exhibited
2455 by GNU troff if a second argument is never given to the
2456 .B ss
2457 request.
2459 In GNU troff, as in UNIX troff, you should always follow a sentence
2460 with either a newline or two spaces.
2463 .BI .ta\  n1\ n2\|.\|.\|.nn \ T\  r1\ r2\|.\|.\|.\|rn
2464 Set tabs at positions
2465 .IR n1 ,
2466 .IR n2 ,\|.\|.\|.\|,
2467 .I nn
2468 and then set tabs at
2469 .IR nn + r1 ,
2470 .IR nn + r2 ,\|.\|.\|.\|,
2471 .IR nn + rn
2472 and then at
2473 .IR nn + rn + r1 ,
2474 .IR nn + rn + r2 ,\|.\|.\|.\|,
2475 .IR nn + rn + rn ,
2476 and so on.
2477 For example,
2481 .ft CB
2482 .Text .ta T .5i
2487 will set tabs every half an inch.
2491 .\" --------------------------------------------------------------------
2492 .SS "New number registers"
2493 .\" --------------------------------------------------------------------
2495 The following read-only registers are available:
2498 .B \[rs]n[.C]
2499 1\~if compatibility mode is in effect, 0\~otherwise.
2502 .B \[rs]n[.cdp]
2503 The depth of the last glyph added to the current environment.
2505 It is positive if the glyph extends below the baseline.
2508 .B \[rs]n[.ce]
2509 The number of lines remaining to be centered, as set by the
2510 .B ce
2511 request.
2514 .B \[rs]n[.cht]
2515 The height of the last glyph added to the current environment.
2517 It is positive if the glyph extends above the baseline.
2520 .B \[rs]n[.color]
2521 1\~if colors are enabled, 0\~otherwise.
2524 .B \[rs]n[.csk]
2525 The skew of the last glyph added to the current environment.
2528 .I skew
2529 of a glyph is how far to the right of the center of a glyph
2530 the center of an accent over that glyph should be placed.
2533 .B \[rs]n[.ev]
2534 The name or number of the current environment.
2536 This is a string-valued register.
2539 .B \[rs]n[.fam]
2540 The current font family.
2542 This is a string-valued register.
2545 .B \[rs]n[.fn]
2546 The current (internal) real font name.
2548 This is a string-valued register.
2550 If the current font is a style, the value of
2551 .B \[rs]n[.fn]
2552 is the proper concatenation of family and style name.
2555 .B \[rs]n[.fp]
2556 The number of the next free font position.
2559 .B \[rs]n[.g]
2560 Always\~1.
2562 Macros should use this to determine whether they are running under GNU
2563 troff.
2566 .B \[rs]n[.hla]
2567 The current hyphenation language as set by the
2568 .B hla
2569 request.
2572 .B \[rs]n[.hlc]
2573 The number of immediately preceding consecutive hyphenated lines.
2576 .B \[rs]n[.hlm]
2577 The maximum allowed number of consecutive hyphenated lines, as set by
2579 .B hlm
2580 request.
2583 .B \[rs]n[.hy]
2584 The current hyphenation flags (as set by the
2585 .B hy
2586 request).
2589 .B \[rs]n[.hym]
2590 The current hyphenation margin (as set by the
2591 .B hym
2592 request).
2595 .B \[rs]n[.hys]
2596 The current hyphenation space (as set by the
2597 .B hys
2598 request).
2601 .B \[rs]n[.in]
2602 The indent that applies to the current output line.
2605 .B \[rs]n[.int]
2606 Set to a positive value if last output line is interrupted (i.e., if
2607 it contains
2608 .IR \[rs]c ).
2611 .B \[rs]n[.kern]
2612 1\~if pairwise kerning is enabled, 0\~otherwise.
2615 .B \[rs]n[.lg]
2616 The current ligature mode (as set by the
2617 .B lg
2618 request).
2621 .B \[rs]n[.linetabs]
2622 The current line-tabs mode (as set by the
2623 .B linetabs
2624 request).
2627 .B \[rs]n[.ll]
2628 The line length that applies to the current output line.
2631 .B \[rs]n[.lt]
2632 The title length as set by the
2633 .B lt
2634 request.
2637 .B \[rs]n[.ne]
2638 The amount of space that was needed in the last
2639 .B ne
2640 request that caused a trap to be sprung.
2642 Useful in conjunction with the
2643 .B \[rs]n[.trunc]
2644 register.
2647 .B \[rs]n[.ns]
2648 1\~if no-space mode is active, 0\~otherwise.
2651 .B \[rs]n[.pe]
2652 1\~during a page ejection caused by the
2653 .B bp
2654 request, 0\~otherwise.
2657 .B \[rs]n[.pn]
2658 The number of the next page, either the value set by a
2659 .B pn
2660 request, or the number of the current page plus\~1.
2663 .B \[rs]n[.ps]
2664 The current pointsize in scaled points.
2667 .B \[rs]n[.psr]
2668 The last-requested pointsize in scaled points.
2671 .B \[rs]n[.pvs]
2672 The current post-vertical line space as set with the
2673 .B pvs
2674 request.
2677 .B \[rs]n[.rj]
2678 The number of lines to be right-justified as set by the
2679 .B rj
2680 request.
2683 .B \[rs]n[.sr]
2684 The last requested pointsize in points as a decimal fraction.
2686 This is a string-valued register.
2689 .B \[rs]n[.ss]
2691 .B \[rs]n[.sss]
2692 These give the values of the parameters set by the first and second
2693 arguments of the
2694 .B ss
2695 request.
2698 .B \[rs]n[.tabs]
2699 A string representation of the current tab settings suitable for use
2700 as an argument to the
2701 .B ta
2702 request.
2705 .B \[rs]n[.trunc]
2706 The amount of vertical space truncated by the most recently sprung
2707 vertical position trap, or, if the trap was sprung by a
2708 .B ne
2709 request, minus the amount of vertical motion produced by the
2710 .B ne
2711 request.
2713 In  other  words, at the point  a  trap is  sprung,  it represents the
2714 difference of  what the vertical position  would have been but for the
2715 trap, and what the vertical position actually is.
2717 Useful in conjunction with the
2718 .B \[rs]n[.ne]
2719 register.
2722 .B \[rs]n[.vpt]
2723 1\~if vertical position traps are enabled, 0\~otherwise.
2726 .B \[rs]n[.warn]
2727 The sum of the numbers associated with each of the currently enabled
2728 warnings.
2730 The number associated with each warning is listed in
2731 .BR @g@troff (@MAN1EXT@).
2734 .B \[rs]n[.x]
2735 The major version number.
2737 For example, if the version number is 1.03, then
2738 .B \[rs]n[.x]
2739 will contain\~1.
2742 .B \[rs]n[.y]
2743 The minor version number.
2745 For example, if the version number is 1.03, then
2746 .B \[rs]n[.y]
2747 will contain\~03.
2750 .B \[rs]n[.Y]
2751 The revision number of groff.
2754 .B \[rs]n[llx]
2756 .B \[rs]n[lly]
2758 .B \[rs]n[urx]
2760 .B \[rs]n[ury]
2761 These four registers are set by the
2762 .B .psbb
2763 request and contain the bounding box values (in PostScript units) of a
2764 given PostScript image.
2767 The following read/write registers are set by the
2768 .B \[rs]w
2769 escape sequence:
2772 .B \[rs]n[rst]
2774 .B \[rs]n[rsb]
2775 Like the
2776 .B st
2778 .B sb
2779 registers, but take account of the heights and depths of glyphs.
2782 .B \[rs]n[ssc]
2783 The amount of horizontal space (possibly negative) that should be
2784 added to the last glyph before a subscript.
2787 .B \[rs]n[skw]
2788 How far to right of the center of the last glyph in the
2789 .B \[rs]w
2790 argument, the center of an accent from a roman font should be placed
2791 over that glyph.
2794 Other available read/write number registers are:
2797 .B \[rs]n[c.]
2798 The current input line number.
2799 .B \[rs]n[.c]
2800 is a read-only alias to this register.
2803 .B \[rs]n[hours]
2804 The number of hours past midnight.
2806 Initialized at start-up.
2809 .B \[rs]n[hp]
2810 The current horizontal position at input line.
2813 .B \[rs]n[minutes]
2814 The number of minutes after the hour.
2816 Initialized at start-up.
2819 .B \[rs]n[seconds]
2820 The number of seconds after the minute.
2822 Initialized at start-up.
2825 .B \[rs]n[systat]
2826 The return value of the system() function executed by the last
2827 .B sy
2828 request.
2831 .B \[rs]n[slimit]
2832 If greater than\~0, the maximum number of objects on the input stack.
2834 If less than or equal to\~0, there is no limit on the number of
2835 objects on the input stack.
2837 With no limit, recursion can continue until virtual memory is
2838 exhausted.
2841 .B \[rs]n[year]
2842 The current year.
2844 Note that the traditional
2845 .B troff
2846 number register
2847 .B \[rs]n[yr]
2848 is the current year minus 1900.
2851 .\" --------------------------------------------------------------------
2852 .SS Miscellaneous
2853 .\" --------------------------------------------------------------------
2855 .B @g@troff
2856 predefines a single (read/write) string-based register,
2857 .BR \[rs]*(.T ,
2858 which contains the argument given to the
2859 .B -T
2860 command line option, namely the current output device (for example,
2861 .I latin1
2863 .IR ascii ).
2864 Note that this is not the same as the (read-only) number register
2865 .B \[rs]n[.T]
2866 which is defined to be\~1 if
2867 .B troff
2868 is called with the
2869 .B -T
2870 command line option, and zero otherwise.
2872 This behaviour is different to UNIX troff.
2875 Fonts not listed in the
2876 .SM DESC
2877 file are automatically mounted on the next available font position
2878 when they are referenced.
2880 If a font is to be mounted explicitly with the
2881 .B fp
2882 request on an unused font position, it should be mounted on the first
2883 unused font position, which can be found in the
2884 .B \[rs]n[.fp]
2885 register; although
2886 .B troff
2887 does not enforce this strictly, it will not allow a font to be mounted
2888 at a position whose number is much greater than that of any currently
2889 used position.
2892 Interpolating a string does not hide existing macro arguments.
2894 Thus in a macro, a more efficient way of doing
2897 .BI . xx\  \[rs]\[rs]$@
2902 .BI \[rs]\[rs]*[ xx ]\[rs]\[rs]  
2905 If the font description file contains pairwise kerning information,
2906 glyphs from that font will be kerned.
2908 Kerning between two glyphs can be inhibited by placing a
2909 .B \[rs]&
2910 between them.
2913 In a string comparison in a condition, characters that appear at
2914 different input levels to the first delimiter character will not be
2915 recognised as the second or third delimiters.
2917 This applies also to the
2918 .B tl
2919 request.
2921 In a
2922 .B \[rs]w
2923 escape sequence, a character that appears at a different input level
2924 to the starting delimiter character will not be recognised as the
2925 closing delimiter character.
2927 The same is true for
2928 .BR \[rs]A ,
2929 .BR \[rs]b ,
2930 .BR \[rs]B ,
2931 .BR \[rs]C ,
2932 .BR \[rs]l ,
2933 .BR \[rs]L ,
2934 .BR \[rs]o ,
2935 .BR \[rs]X ,
2937 .BR \[rs]Z .
2939 When decoding a macro or string argument that is delimited by double
2940 quotes, a character that appears at a different input level to the starting
2941 delimiter character will not be recognised as the closing delimiter
2942 character.
2944 The implementation of
2945 .B \[rs]$@
2946 ensures that the double quotes surrounding an argument will appear the
2947 same input level, which will be different to the input level of the
2948 argument itself.
2950 In a long escape name
2951 .B ]
2952 will not be recognized as a closing delimiter except when it occurs at
2953 the same input level as the opening
2954 .BR ] .
2956 In compatibility mode, no attention is paid to the input-level.
2959 There are some new types of condition:
2962 .BI .if\ r xxx
2963 True if there is a number register named
2964 .IR xxx .
2967 .BI .if\ d xxx
2968 True if there is a string, macro, diversion, or request named
2969 .IR xxx .
2972 .BI .if\ m xxx
2973 True if there is a color named
2974 .IR xxx .
2977 .BI .if\ c ch
2978 True if there is a glyph
2979 .IR ch
2980 available;
2981 .I ch
2982 is either an
2983 .SM ASCII
2984 character or a glyph (special character)
2985 .BI \[rs]( xx
2987 .BI \[rs][ xxx ]\f[R];
2988 the condition will also be true if
2989 .I ch
2990 has been defined by the
2991 .B char
2992 request.
2996 .B tr
2997 request can now map characters onto
2998 .BR \[rs]~ .
3001 It is now possible to have whitespace between the first and second dot
3002 (or the name of the ending macro) to end a macro definition.
3004 Example:
3007 .ne 6v+\n(.Vu
3008 .ft CB
3010 .Text .de foo
3011 .Text .  nop Hello, I'm `foo'.
3012 .Text .  nop I will now define `bar'.
3013 .Text .  de bar
3014 .Text .    nop Hello, I'm `bar'.
3015 .Text .  .
3016 .Text .  nop Done.
3017 .Text ..
3018 .Text .foo
3019 .Text .bar
3023 .\" --------------------------------------------------------------------
3024 .SH "INTERMEDIATE OUTPUT FORMAT"
3025 .\" --------------------------------------------------------------------
3027 This section describes the format output by GNU troff.
3029 The output format used by GNU troff is very similar to that used
3030 by Unix device-independent troff.
3032 Only the differences are documented here.
3035 .\" --------------------------------------------------------------------
3036 .SS "Units"
3037 .\" --------------------------------------------------------------------
3039 The argument to the
3040 .B s
3041 command is in scaled points (units of
3042 .RI points/ n ,
3043 where
3044 .I n
3045 is the argument to the
3046 .B sizescale
3047 command  in the DESC file).
3049 The argument to the
3050 .B x\ Height
3051 command is also in scaled points.
3054 .\" --------------------------------------------------------------------
3055 .SS "Text Commands"
3056 .\" --------------------------------------------------------------------
3059 .BI N n
3060 Print glyph with index\~\c
3061 .I n
3062 (a non-negative integer) of the current font.
3065 If the
3066 .B tcommand
3067 line is present in the DESC file, troff will use the following two
3068 commands.
3071 .BI t xxx
3072 .I xxx
3073 is any sequence of characters terminated by a space or a newline (to
3074 be more precise, it is a sequence of glyphs which are accessed with
3075 the corresponding characters); the first character should be printed at
3076 the current position, the current horizontal position should be increased
3077 by the width of the first character, and so on for each character.
3079 The width of the glyph is that given in the font file,
3080 appropriately scaled for the current point size, and rounded so that
3081 it is a multiple of the horizontal resolution.
3083 Special characters cannot be printed using this command.
3086 .BI u n\ xxx
3087 This is same as the
3088 .B t
3089 command except that after printing each character, the current
3090 horizontal position is increased by the sum of the width of that
3091 character and
3092 .IR n .
3095 Note that single characters can have the eighth bit set, as can the
3096 names of fonts and special characters.
3099 The names of glyphs and fonts can be of arbitrary length; drivers
3100 should not assume that they will be only two characters long.
3103 When a glyph is to be printed, that glyph will always be
3104 in the current font.
3106 Unlike device-independent troff, it is not necessary for drivers to
3107 search special fonts to find a glyph.
3110 For color support, some new commands have been added:
3113 .Text \f[B]mc \f[I]cyan magenta yellow\f[R]
3115 .Text \f[B]md\f[R]
3117 .Text \f[B]mg \f[I]gray\f[R]
3119 .Text \f[B]mk \f[I]cyan magenta yellow black\f[R]
3121 .Text \f[B]mr \f[I]red green blue\f[R]
3122 Set the color components of the current drawing color, using various
3123 color schemes.
3125 .B md
3126 resets the drawing color to the default value.
3128 The arguments are integers in the range 0 to 65536.
3132 .B x
3133 device control command has been extended.
3136 .Text \f[B]x u \f[I]n\f[R]
3138 .I n
3139 is\~1, start underlining of spaces.
3142 .I n
3143 is\~0, stop underlining of spaces.
3145 This is needed for the
3146 .B cu
3147 request in nroff mode and is ignored otherwise.
3150 .\" --------------------------------------------------------------------
3151 .SS "Drawing Commands"
3152 .\" --------------------------------------------------------------------
3155 .B D
3156 drawing command has been extended.
3158 These extensions will not be used by GNU pic if the
3159 .B \-n
3160 option is given.
3163 .Text \f[B]Df \f[I]n\f[R]\*[ic]\[rs]n
3164 Set the shade of gray to be used for filling solid objects to
3165 .IR n ;
3166 .I n
3167 must be an integer between 0 and 1000, where 0 corresponds solid white
3168 and 1000 to solid black, and values in between correspond to
3169 intermediate shades of gray.
3171 This applies only to solid circles, solid ellipses and solid
3172 polygons.
3174 By default, a level of 1000 will be used.
3176 Whatever color a solid object has, it should completely obscure
3177 everything beneath it.
3179 A value greater than 1000 or less than 0 can also be used: this means
3180 fill with the shade of gray that is currently being used for lines and
3181 text.
3183 Normally this will be black, but some drivers may provide a way of
3184 changing this.
3187 The corresponding
3188 .BI \[rs]D'f .\|.\|. '
3189 command shouldn't be used since its argument is always rounded to an
3190 integer multiple of the horizontal resolution which can lead to
3191 surprising results.
3194 .Text \f[B]DC \f[I]d\f[R]\*[ic]\[rs]n
3195 Draw a solid circle with a diameter of
3196 .I d
3197 with the leftmost point at the current position.
3200 .Text \f[B]DE \f[I]dx dy\f[R]\*[ic]\[rs]n
3201 Draw a solid ellipse with a horizontal diameter of
3202 .I dx
3203 and a vertical diameter of
3204 .I dy
3205 with the leftmost point at the current position.
3207 delim $$
3211 .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
3212 Draw a polygon with, for $i = 1 ,..., n+1$, the
3213 .IR i -th
3214 vertex at the current position 
3216 $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$.
3218 At the moment, GNU pic only uses this command to generate triangles
3219 and rectangles.
3222 .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
3224 Like
3225 .B Dp
3226 but draw a solid rather than outlined polygon.
3229 .Text \f[B]Dt \f[I]n\f[R]\*[ic]\[rs]n
3230 Set the current line thickness to
3231 .I n
3232 machine units.
3234 Traditionally Unix troff drivers use a line thickness proportional to
3235 the current point size; drivers should continue to do this if no
3236 .B Dt
3237 command has been given, or if a
3238 .B Dt
3239 command has been given with a negative value of
3240 .IR n .
3241 A zero value of
3242 .I n
3243 selects the smallest available line thickness.
3246 A difficulty arises in how the current position should be changed after
3247 the execution of these commands.
3249 This is not of great importance since the code generated by GNU pic
3250 does not depend on this.
3252 Given a drawing command of the form
3254 \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]
3257 where
3258 .I c
3259 is not one of
3260 .BR c ,
3261 .BR e ,
3262 .BR l ,
3263 .BR a ,
3265 .BR ~ ,
3266 Unix troff will treat each of the $x sub i$ as a horizontal quantity,
3267 and each of the $y sub i$ as a vertical quantity and will assume that
3268 the width of the drawn object is $sum from i=1 to n x sub i$,
3269 and that the height is $sum from i=1 to n y sub i$.
3271 (The assumption about the height can be seen by examining the
3272 .B st
3274 .B sb
3275 registers after using such a
3276 .B D
3277 command in a \[rs]w escape sequence).
3279 This rule also holds for all the original drawing commands with the
3280 exception of
3281 .BR De .
3282 For the sake of compatibility GNU troff also follows this rule, even
3283 though it produces an ugly result in the case of the
3284 .BR Dt ,
3285 and, to a lesser extent,
3286 .B DE
3287 commands.
3289 Thus after executing a
3290 .B D
3291 command of the form
3293 \f[B]D\f[I]c\f[R] $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ \c
3294 $x sub n$ $y sub n$\[rs]n
3297 the current position should be increased by
3299 $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
3302 Another set of extensions is
3305 .Text \f[B]DFc \f[I]cyan magenta yellow\f[R]\*[ic]\[rs]n
3307 .Text \f[B]DFd\f[R]\*[ic]\[rs]n
3309 .Text \f[B]DFg \f[I]gray\f[R]\*[ic]\[rs]n
3311 .Text \f[B]DFk \f[I]cyan magenta yellow black\f[R]\*[ic]\[rs]n
3313 .Text \f[B]DFr \f[I]red green blue\f[R]\*[ic]\[rs]n
3314 Set the color components of the filling color similar to the
3315 .B m
3316 commands above.
3319 Note that
3320 .B Df
3321 is now mapped onto
3322 .BR DFg .
3323 The current position isn't changed by those colour commands (including
3324 .BR Df ).
3327 .\" --------------------------------------------------------------------
3328 .SS "Device Control Commands"
3329 .\" --------------------------------------------------------------------
3331 There is a continuation convention which permits the argument to the
3332 .B x\ X
3333 command to contain newlines: when outputting the argument to the
3334 .B x\ X
3335 command, GNU troff will follow each newline in the argument with a
3336 .B +
3337 character (as usual, it will terminate the entire argument with a
3338 newline); thus if the line after the line containing the
3339 .B x\ X
3340 command starts with
3341 .BR + ,
3342 then the newline ending the line containing the
3343 .B x\ X
3344 command should be treated as part of the argument to the
3345 .B x\ X
3346 command, the
3347 .B +
3348 should be ignored, and the part of the line following the
3349 .B +
3350 should be treated like the part of the line following the
3351 .B x\ X
3352 command.
3355 The first three output commands are guaranteed to be:
3357 .BI x\ T\  device
3359 .BI x\ res\  n\ h\ v
3361 .B x init
3364 .\" --------------------------------------------------------------------
3365 .SH INCOMPATIBILITIES
3366 .\" --------------------------------------------------------------------
3368 In spite of the many extensions, groff has retained compatibility to
3369 classical troff to a large degree.
3371 For the cases where the extensions lead to collisions, a special
3372 compatibility mode with the restricted, old functionality was created
3373 for groff.
3376 .\" --------------------------------------------------------------------
3377 .SS "Groff Language"
3378 .\" --------------------------------------------------------------------
3380 .I groff
3381 provides a
3382 .B compatibility mode
3383 that allows to process roff code written for classical
3384 .troff
3385 or for other implementations of roff in a consistent way.
3388 Compatibility mode can be turned on with the
3389 .option \-C
3390 command line option, and turned on or off with the
3391 .request .cp
3392 request.
3394 The number register
3395 .esc n(.C
3396 is\~1 if compatibility mode is on, 0\~otherwise.
3399 This became necessary because the GNU concept for long names causes
3400 some incompatibilities.
3401 .I Classical troff
3402 interprets
3404 .request .dsabcd
3407 as defining a string
3408 .B ab
3409 with contents
3410 .BR cd .
3412 .IR groff
3413 mode, this will be considered as a call of a macro named
3414 .request dsabcd .
3417 Also
3418 .I classical troff
3419 interprets
3420 .esc *[
3422 .esc n[
3423 as references to a string or number register called
3424 .request [
3425 while
3426 .I groff
3427 takes this as the start of a long name.
3431 .IR "compatibility mode" ,
3432 groff interprets these things in the traditional way; so long
3433 names are not recognized.
3436 On the other hand, groff in
3437 .I GNU native mode
3438 does not allow to use the single-character escapes
3439 .esc \[rs]
3440 (backslash),
3441 .esc |
3442 (vertical bar),
3443 .esc ^
3444 (caret),
3445 .esc &
3446 (ampersand),
3447 .esc {
3448 (opening brace),
3449 .esc }
3450 (closing brace),
3451 .squoted "\[rs]\ "
3452 (space),
3453 .esc '
3454 (single quote),
3455 .esc `
3456 (backquote),
3457 .esc \-
3458 (minus),
3459 .esc _
3460 (underline),
3461 .esc !
3462 (bang),
3463 .esc %
3464 (percent),
3466 .esc c
3467 (character c) in names of strings, macros, diversions, number
3468 registers, fonts or environments, whereas
3469 .I classical troff
3470 does.
3474 .esc A
3475 escape sequence can be helpful in avoiding these escape sequences in
3476 names.
3479 Fractional pointsizes cause one noteworthy incompatibility.
3482 .I classical
3483 .IR troff ,
3485 .request ps
3486 request ignores scale indicators and so
3489 .B .ps\~10u
3493 will set the pointsize to 10\~points, whereas in groff native mode the
3494 pointsize will be set to 10\~scaled points.
3498 .I groff
3499 mode, there is a fundamental difference between unformatted input
3500 characters, and formatted output characters (glyphs).
3502 Everything that affects how a glyph will be output is
3503 stored with the glyph; once a glyph has been
3504 constructed it is unaffected by any subsequent requests that are
3505 executed, including the
3506 .request bd ,
3507 .request cs ,
3508 .request tkf ,
3509 .request tr ,
3511 .request fp
3512 requests.
3515 Normally glyphs are constructed from input characters at
3516 the moment immediately before the glyph is added to the current
3517 output line.
3519 Macros, diversions and strings are all, in fact, the same type of
3520 object; they contain lists of input characters and glyphs
3521 in any combination.
3524 Special characters can be both; before being added to the output, they
3525 act as input entities, afterwards they denote glyphs.
3528 A glyph does not behave like an input character for the
3529 purposes of macro processing; it does not inherit any of the special
3530 properties that the input character from which it was constructed
3531 might have had.
3533 The following example will make things clearer.
3538 .ft CB
3539 .Text .di x
3540 .Text \[rs]\[rs]\[rs]\[rs]
3541 .Text .br
3542 .Text .di
3543 .Text .x
3550 .I GNU mode
3551 this will be printed as
3552 .esc \[rs] .
3553 So each pair of input backslashes
3554 .squoted \[rs]\[rs]
3555 is turned into a single output backslash glyph
3556 .squoted \[rs]
3557 and the resulting output backslashes are not interpreted as escape
3558 characters when they are reread.
3561 .I Classical troff
3562 would interpret them as escape characters when they were reread and
3563 would end up printing a single backslash
3564 .squoted \[rs] .
3567 In GNU, the correct way to get a printable version of the backslash
3568 character
3569 .squoted \[rs]
3570 is the
3571 .esc (rs
3572 escape sequence, but classical troff does not provide a clean feature
3573 for getting a non-syntactical backslash.
3575 A close method is the printable version of the current escape
3576 character using the
3577 .esc e
3578 escape sequence; this works if the current escape character is not
3579 redefined.
3581 It works in both GNU mode and compatibility mode, while dirty tricks
3582 like specifying a sequence of multiple backslashes do not work
3583 reliably; for the different handling in diversions, macro definitions,
3584 or text mode quickly leads to a confusion about the necessary number of
3585 backslashes.
3588 To store an escape sequence in a diversion that will be interpreted
3589 when the diversion is reread, either the traditional
3590 .esc !
3591 transparent output facility or the
3593 .esc ?
3594 escape sequence can be used.
3597 .\" --------------------------------------------------------------------
3598 .SS "Intermediate Output"
3599 .\" --------------------------------------------------------------------
3601 The groff intermediate output format is in a state of evolution.
3603 So far it has some incompatibilities, but it is intended to establish
3604 a full compatibility to the classical troff output format.
3606 Actually the following incompatibilities exist:
3608 .Topic
3609 The positioning after the drawing of the polygons conflicts with the
3610 classical definition.
3612 .Topic
3613 The intermediate output cannot be rescaled to other devices as
3614 classical "device-independent" troff did.
3617 .\" --------------------------------------------------------------------
3618 .SH AUTHORS
3619 .\" --------------------------------------------------------------------
3621 Copyright (C) 1989, 2001, 2002, 2003 Free Software Foundation, Inc.
3624 This document is distributed under the terms of the FDL (GNU Free
3625 Documentation License) version 1.1 or later.
3627 You should have received a copy of the FDL on your system, it is also
3628 available on-line at the
3629 .URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
3631 This document was written by James Clark, with modifications by
3632 .MTO wl@gnu.org "Werner Lemberg"
3634 .MTO bwarken@mayn.de "Bernd Warken" .
3637 This document is part of
3638 .IR groff ,
3639 the GNU roff distribution.
3641 Formerly, the contents of this document was kept in the manual
3642 page
3643 .BR @g@troff (@MAN1EXT@).
3644 Only the parts dealing with the language aspects of the different
3645 .I roff
3646 systems were carried over into this document.
3649 .I troff
3650 command line options and warnings are still documented in
3651 .BR @g@troff (@MAN1EXT@).
3653 .\" --------------------------------------------------------------------
3654 .SH "SEE ALSO"
3655 .\" --------------------------------------------------------------------
3658 .I groff info
3659 .IR file ,
3660 cf.\&
3661 .BR info (1)
3662 presents all groff documentation within a single document.
3665 .BR groff (@MAN1EXT@)
3666 A list of all documentation around
3667 .IR groff .
3670 .BR groff (@MAN7EXT@)
3671 A description of the
3672 .I groff
3673 language, including a short, but complete reference of all predefined
3674 requests, registers, and escapes of plain
3675 .IR groff .
3676 From the command line, this is called using
3679 .ShellCommand man\~7\~groff
3682 .BR roff (@MAN7EXT@)
3683 A survey of
3684 .I roff
3685 systems, including pointers to further historical documentation.
3688 .RI [ CSTR\~#54\/ ]
3690 .I Nroff/\:Troff User's Manual
3692 .I J.\& F.\& Osanna
3693 of 1976 in the revision of
3694 .I Brian Kernighan
3695 of 1992, being the
3696 .URL http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz \
3697      "classical troff documentation" .
3700 .\" --------------------------------------------------------------------
3701 .\" Emacs variables
3702 .\" --------------------------------------------------------------------
3704 .\" Local Variables:
3705 .\" mode: nroff
3706 .\" End: