Implement string-valued registers \n[.m] and \n[.M] to return the
[s-roff.git] / man / groff_diff.man
bloba9a176a21bdf8a5c86d1cd532f6fffabb167335a
1 '\" e
2 .\" The above line should force the use of eqn as a preprocessor
3 .ig
4 groff_diff.man
6 Last update : 07 Jan 2004
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, 2004 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 .do nr groff_diff_C \n[.C]
32 .cp 0
34 .mso www.tmac
36 .if n \{\
37 .  mso tty-char.tmac
38 .  ftr CR R
39 .  ftr CI I
40 .  ftr CB B
41 .\}
43 .if '\*[.T]'dvi' \
44 .  ftr CB CW
46 .\" define a string tx for the TeX logo
47 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
48 .el   .ds tx TeX
51 .\" --------------------------------------------------------------------
52 .\" start of macro definitions
54 .eo
56 .de c
59 .de TQ
60 .  br
61 .  ns
62 .  TP \$1
64 .de Text
65 .  RI "\$*"
67 .de Topic
68 .  TP 2m
69 .  Text \[bu]
71 .de squoted
72 .  ds @arg1 \$1
73 .  shift
74 .\"  Text \[oq]\f[CB]\*[@arg1]\f[]\[cq]\$*
75 .  Text \[oq]\f[B]\*[@arg1]\f[]\[cq]\$*
76 .  rm @arg1
78 .c A shell command line
79 .de ShellCommand
80 .  br
81 .  IR "shell#" "\h'1m'\f[CB]\$*\f[]\/"
83 .c reference of a request or macro
84 .de request
85 .  ds @arg1 \$1
86 .  shift 1
87 .\"  Text \f[CB]\*[@arg1]\f[]\$*
88 .  Text \f[B]\*[@arg1]\f[]\$*
89 .  rm @arg1
91 .als option request
93 .c representation of an escape sequence
94 .de esc
95 .  ds @arg1 \$1
96 .  shift
97 .\"  Text \f[CB]\[rs]\*[@arg1]\f[]\$*
98 .  Text \f[B]\[rs]\*[@arg1]\&\f[]\$*
99 .  rm @arg1
102 .\" end of macro definitions
104 .\" from old groff_out.man
105 .ie \n(.g \
106 .  ds ic \/
107 .el \
108 .  ds ic \^
111 .\" --------------------------------------------------------------------
112 .\" Title
113 .\" --------------------------------------------------------------------
115 .TH GROFF_DIFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
116 .SH NAME
117 groff_diff \- differences between GNU troff and classical troff
120 .\" --------------------------------------------------------------------
121 .SH DESCRIPTION
122 .\" --------------------------------------------------------------------
124 This manual page describes the language differences between
125 .IR groff ,
126 the GNU
127 .I roff
128 text processing system and the classical
129 .I roff
130 formatter of the freely available Unix\~7 of the 1970s, documented in
132 .I Troff User's Manual
134 .I Osanna
136 .IR Kernighan .
137 This inludes the roff language as well as the intermediate output
138 format (troff output).
141 The section
142 .I SEE ALSO
143 gives pointers to both the classical
144 .I roff
145 and the modern
146 .I groff
147 documentation.
150 .\" --------------------------------------------------------------------
151 .SH "GROFF LANGUAGE"
152 .\" --------------------------------------------------------------------
154 In this section, all additional features of
155 .I groff
156 compared to the classical Unix\~7
157 .I troff
158 are described in detail.
161 .\" --------------------------------------------------------------------
162 .SS "Long names"
163 .\" --------------------------------------------------------------------
165 The names of number registers, fonts, strings/\:macros/\:diversions,
166 special characters (glyphs), and colors can be of any length.
168 In escape sequences, additionally to the classical
169 .BI ( xx
170 construction for a two-character name, you can use
171 .BI [ xxx ]
172 for a name of arbitrary length.
175 .BI \[rs][ xxx ]
176 Print the special character (glyph) called
177 .IR xxx .
180 .BI \[rs][ "comp1 comp2 .\|.\|." ]
181 Print composite glyph consisting of multiple components.
183 Example: `\[rs][A\~ho]' is capital letter A with ogonek which finally maps
184 to glyph name `u0041_0328'.
186 See the
187 .I groff info file
188 for details how a glyph name for a composite glyph is constructed, and
189 .BR groff_char (@MAN7EXT@)
190 for list of glyph name components used composite glyph names.
193 .BI \[rs]f[ xxx ]
194 Set font
195 .IR xxx .
197 Additionally,
198 .B \[rs]f[]
199 is a new syntax equal to
200 .BR \[rs]fP ,
201 i.e., to return to the previous font.
204 .BI \[rs]*[ "xxx arg1 arg2 .\|.\|." ]
205 Interpolate string
206 .IR xxx ,
207 taking
208 .IR arg1 ,
209 .IR arg2 ,
210 .I .\|.\|.\&
211 as arguments.
214 .BI \[rs]n[ xxx ]
215 Interpolate number register
216 .IR xxx .
219 .\" --------------------------------------------------------------------
220 .SS "Fractional pointsizes"
221 .\" --------------------------------------------------------------------
224 .I scaled point
225 is equal to
226 .B 1/sizescale
227 points, where
228 .B sizescale
229 is specified in the
230 .B DESC
231 file (1 by default).
233 There is a new scale indicator
234 .B z
235 that has the effect of multiplying by sizescale.
237 Requests and escape sequences in troff interpret arguments that
238 represent a pointsize as being in units of scaled points, but they
239 evaluate each such argument using a default scale indicator of
240 .BR z .
241 Arguments treated in this way are the argument to the
242 .B ps
243 request, the third argument to the
244 .B cs
245 request, the second and fourth arguments to the
246 .B tkf
247 request, the argument to the
248 .B \[rs]H
249 escape sequence, and those variants of the
250 .B \[rs]s
251 escape sequence that take a numeric expression as their argument.
254 For example, suppose sizescale is 1000; then a scaled point will be
255 equivalent to a millipoint; the call
256 .B .ps\ 10.25
257 is equivalent to
258 .B .ps\ 10.25z
259 and so sets the pointsize to 10250 scaled points, which is equal to
260 10.25 points.
263 The number register
264 .B \[rs]n[.s]
265 returns the pointsize in points as decimal fraction.
267 There is also a new number register
268 .B \[rs]n[.ps]
269 that returns the pointsize in scaled points.
272 It would make no sense to use the
273 .B z
274 scale indicator in a numeric expression whose default scale indicator
275 was neither
276 .B u
278 .BR z ,
279 and so
280 .B troff
281 disallows this.
283 Similarly it would make no sense to use a scaling indicator other than
284 .B z
286 .B u
287 in a numeric expression whose default scale indicator was
288 .BR z ,
289 and so
290 .B troff
291 disallows this as well.
294 There is also new scale indicator\~\c
295 .B s
296 which multiplies by the number of units in a scaled point.
298 So, for example,
299 .B \[rs]n[.ps]s
300 is equal to
301 .BR 1m .
302 Be sure not to confuse the
303 .B s
305 .B z
306 scale indicators.
309 .\" --------------------------------------------------------------------
310 .SS "Numeric expressions"
311 .\" --------------------------------------------------------------------
313 Spaces are permitted in a number expression within parentheses.
316 .B M
317 indicates a scale of 100ths of an em.
318 .B f
319 indicates a scale of 65536 units, providing fractions for color
320 definitions with the
321 .B defcolor
322 request.
324 For example, 0.5f = 32768u.
327 .IB e1 >? e2
328 The maximum of
329 .I e1
331 .IR e2 .
334 .IB e1 <? e2
335 The minimum of
336 .I e1
338 .IR e2 .
341 .BI ( c ; e )
342 Evaluate
343 .I e
344 using
345 .I c
346 as the default scaling indicator.
349 .I c
350 is missing, ignore scaling indicators in the evaluation of
351 .IR e .
354 .\" --------------------------------------------------------------------
355 .SS "New escape sequences"
356 .\" --------------------------------------------------------------------
359 .BI \[rs]A' anything '
360 This expands to
361 .B 1
363 .B 0
364 resp., depending on whether
365 .I anything
366 is or is not acceptable as the name of a string, macro, diversion, number
367 register, environment, font, or color.
368 It will return\~\c
369 .B 0
371 .I anything
372 is empty.
374 This is useful if you want to lookup user input in some sort of
375 associative table.
378 .BI \[rs]B' anything '
379 This expands to
380 .B 1
382 .B 0
383 resp., depending on whether
384 .I anything
385 is or is not a valid numeric expression.
387 It will return\~\c
388 .B 0
390 .I anything
391 is empty.
394 .BI \[rs]C' xxx '
395 Typeset glyph named
396 .IR xxx .
397 Normally it is more convenient to use
398 .BI \[rs][ xxx ]\f[R].
400 .B \[rs]C
401 has the advantage that it is compatible with recent versions of
402 .SM UNIX
403 and is available in compatibility mode.
406 .B \[rs]E
407 This is equivalent to an escape character, but it is not interpreted in
408 copy-mode.
410 For example, strings to start and end superscripting could be defined
411 like this
415 .ft CB
416 .Text .ds { \[rs]v'\-.3m'\[rs]s'\[rs]En[.s]*6u/10u'
418 .Text .ds } \[rs]s0\[rs]v'.3m'
422 The use of
423 .B \[rs]E
424 ensures that these definitions will work even if
425 .B \[rs]*{
426 gets interpreted in copy-mode (for example, by being used in a macro
427 argument).
431 .BI \[rs]F f
433 .BI \[rs]F( fm
435 .BI \[rs]F[ fam ]
436 Change font family.
438 This is the same as the
439 .B fam
440 request.
442 .B \[rs]F[]
443 switches back to the previous color (note that
444 .B \[rs]FP
445 won't work; it selects font family `P' instead).
448 .BI \[rs]m x
450 .BI \[rs]m( xx
452 .BI \[rs]m[ xxx ]
453 Set drawing color.
454 .B \[rs]m[]
455 switches back to the previous color.
458 .BI \[rs]M x
460 .BI \[rs]M( xx
462 .BI \[rs]M[ xxx ]
463 Set background color for filled objects drawn with the
464 .BI \[rs]D' .\|.\|. '
465 commands.
466 .B \[rs]M[]
467 switches back to the previous color.
470 .BI \[rs]N' n '
471 Typeset the glyph with index
472 .I n
473 in the current font.
474 .I n
475 can be any integer.
477 Most devices only have glyphs with indices between 0 and 255.
479 If the current font does not contain a glyph with that code,
480 special fonts will
481 .I not
482 be searched.
485 .B \[rs]N
486 escape sequence can be conveniently used in conjunction with the
487 .B char
488 request, for example
491 .ft CB
493 .Text .char \[rs][phone] \[rs]f(ZD\[rs]N'37'
498 The index of each glyph is given in the fourth column in the font
499 description file after the
500 .B charset
501 command.
503 It is possible to include unnamed glyphs in the font description
504 file by using a name of
505 .BR \-\-\- ;
507 .B \[rs]N
508 escape sequence is the only way to use these.
511 .BI \[rs]O n
513 .BI \[rs]O[ n ]
514 Suppressing troff output.
516 The escapes
517 .BR \[rs]02 ,
518 .BR \[rs]O3 ,
519 .BR \[rs]O4 ,
521 .B \[rs]O5
522 are intended for internal use by
523 .BR \%grohtml .
527 .B \[rs]O0
528 Disable any ditroff glyphs from being emitted to the device driver,
529 provided that the escape occurs at the outer level (see
530 .B \[rs]O3
532 .BR \[rs]O4 ).
535 .B \[rs]O1
536 Enable output of glyphs, provided that the escape occurs at the outer
537 level.
539 .B \[rs]O0
541 .B \[rs]O1
542 also reset the registers
543 .BR \[rs]n[opminx] ,
544 .BR \[rs]n[opminy] ,
545 .BR \[rs]n[opmaxx] ,
547 .B \[rs]n[opmaxy]
548 to\~-1.
550 These four registers mark the top left and bottom right hand corners
551 of a box which encompasses all written glyphs.
554 .B \[rs]O2
555 Provided that the escape occurs at the outer level, enable output of
556 glyphs and also write out to stderr the page number and four registers
557 encompassing the glyphs previously written since the last call to
558 .BR \[rs]O .
561 .B \[rs]O3
562 Begin a nesting level.
564 At start-up,
565 .B troff
566 is at outer level.
568 This is really an internal mechanism for
569 .B \%grohtml
570 while producing images.
572 They are generated by running the troff source through
573 .B troff
574 to the postscript device and
575 .B ghostscript
576 to produce images in PNG format.
579 .B \[rs]O3
580 escape will start a new page if the device is not html (to reduce the
581 possibility of images crossing a page boundary).
584 .B \[rs]O4
585 End a nesting level.
588 .BI \[rs]O5[ Pfilename ]
589 This escape is
590 .B \%grohtml
591 specific.
593 Provided that this escape occurs at the outer nesting level, write
594 .I filename
595 to stderr.
597 The position of the image,
598 .IR P ,
599 must be specified and must be one of l, r, c, or i (left, right,
600 centered, inline).
602 .I filename
603 will be associated with the production of the next inline image.
607 .BI \[rs]R' name\ \[+-]n '
608 This has the same effect as
612 .BI .nr\  name\ \[+-]n
616 .BI \[rs]s( nn
618 .BI \[rs]s\[+-]( nn
619 Set the point size to
620 .I nn
621 points;
622 .I nn
623 must be exactly two digits.
626 .BI \[rs]s[\[+-] n ]
628 .BI \[rs]s\[+-][ n ]
630 .BI \[rs]s'\[+-] n '
632 .BI \[rs]s\[+-]' n '
633 Set the point size to
634 .I n
635 scaled points;
636 .I n
637 is a numeric expression with a default scale indicator of\~\c
638 .BR z .
641 .BI \[rs]V x
643 .BI \[rs]V( xx
645 .BI \[rs]V[ xxx ]
646 Interpolate the contents of the environment variable
647 .IR xxx ,
648 as returned by
649 .BR getenv (3).
650 .B \[rs]V
651 is interpreted in copy-mode.
654 .BI \[rs]Y x
656 .BI \[rs]Y( xx
658 .BI \[rs]Y[ xxx ]
659 This is approximately equivalent to
660 .BI \[rs]X'\[rs]*[ xxx ]'\f[R].
661 However the contents of the string or macro
662 .I xxx
663 are not interpreted; also it is permitted for
664 .I xxx
665 to have been defined as a macro and thus contain newlines (it is not
666 permitted for the argument to
667 .B \[rs]X
668 to contain newlines).
670 The inclusion of newlines requires an extension to the UNIX troff
671 output format, and will confuse drivers that do not know about this
672 extension.
675 .BI \[rs]Z' anything '
676 Print anything and then restore the horizontal and vertical position;
677 .I anything
678 may not contain tabs or leaders.
681 .B \[rs]$0
682 The name by which the current macro was invoked.
685 .B als
686 request can make a macro have more than one name.
689 .B \[rs]$*
690 In a macro or string, the concatenation of all the arguments separated
691 by spaces.
694 .B \[rs]$@
695 In a macro or string, the concatenation of all the arguments with each
696 surrounded by double quotes, and separated by spaces.
699 .BI \[rs]$( nn
701 .BI \[rs]$[ nnn ]
702 In a macro or string, this gives the
703 .IR nn -th
705 .IR nnn -th
706 argument.
708 Macros and strings can have an unlimited number of arguments.
711 .BI \[rs]? anything \[rs]?
712 When used in a diversion, this will transparently embed
713 .I anything
714 in the diversion.
715 .I anything
716 is read in copy mode.
718 When the diversion is reread,
719 .I anything
720 will be interpreted.
721 .I anything
722 may not contain newlines; use
723 .B \[rs]!\&
724 if you want to embed newlines in a diversion.
726 The escape sequence
727 .B \[rs]?\&
728 is also recognised in copy mode and turned into a single internal
729 code; it is this code that terminates
730 .IR anything .
731 Thus
735 .ne 14v+\n(.Vu
736 .ft CB
738 .Text .nr x 1
739 .Text .nf
740 .Text .di d
741 .Text \[rs]?\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\c
742 .Text \[rs]nx\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]?\[rs]?
743 .Text .di
744 .Text .nr x 2
745 .Text .di e
746 .Text .d
747 .Text .di
748 .Text .nr x 3
749 .Text .di f
750 .Text .e
751 .Text .di
752 .Text .nr x 4
753 .Text .f
759 will print\~\c
760 .BR 4 .
763 .B \[rs]/
764 This increases the width of the preceding glyph so that the
765 spacing between that glyph and the following glyph will be
766 correct if the following glyph is a roman glyph.
768 .if t \{\
769 .  nop For example, if an italic f is immediately followed by a roman
770 .  nop right parenthesis, then in many fonts the top right portion of
771 .  nop the f will overlap the top left of the right parenthesis
772 .  nop producing \f[I]f\f[R])\f[R], which is ugly.
773 .  nop Inserting
774 .  B \[rs]/
775 .  nop produces
776 .  ie \n(.g \f[I]f\/\f[R])\f[R]
777 .  el       \f[I]f\|\f[R])\f[R]
778 .  nop and avoids this problem.
780 It is a good idea to use this escape sequence whenever an italic
781 glyph is immediately followed by a roman glyph without any
782 intervening space.
785 .B \[rs],
786 This modifies the spacing of the following glyph so that the
787 spacing between that glyph and the preceding glyph will
788 correct if the preceding glyph is a roman glyph.
790 .if t \{\
791 .  nop For example, inserting
792 .  B \[rs],
793 .  nop between the parenthesis and the f changes
794 .  nop \f[R](\f[I]f\f[R] to
795 .  ie \n(.g \f[R](\,\f[I]f\f[R].
796 .  el       \f[R](\^\f[I]f\f[R].
798 It is a good idea to use this escape sequence whenever a roman
799 glyph is immediately followed by an italic glyph without any
800 intervening space.
803 .B \[rs])
804 Like
805 .B \[rs]&
806 except that it behaves like a character declared with the
807 .B cflags
808 request to be transparent for the purposes of end-of-sentence
809 recognition.
812 .B \[rs]~
813 This produces an unbreakable space that stretches like a normal
814 inter-word space when a line is adjusted.
817 .B \[rs]:
818 This causes the insertion of a zero-width break point.
820 It is equal to
821 .B \[rs]%
822 within a word but without insertion of a soft hyphen character.
825 .B \[rs]#
826 Everything up to and including the next newline is ignored.
828 This is interpreted in copy mode.
830 It is like
831 .B \[rs]"
832 except that
833 .B \[rs]"
834 does not ignore the terminating newline.
837 .\" --------------------------------------------------------------------
838 .SS "New requests"
839 .\" --------------------------------------------------------------------
842 .BI .aln\  xx\ yy
843 Create an alias
844 .I xx
845 for number register object named
846 .IR yy .
847 The new name and the old name will be exactly equivalent.
850 .I yy
851 is undefined, a warning of type
852 .B reg
853 will be generated, and the request will be ignored.
856 .BI .als\  xx\ yy
857 Create an alias
858 .I xx
859 for request, string, macro, or diversion object named
860 .IR yy .
862 The new name and the old name will be exactly equivalent (it is
863 similar to a hard rather than a soft link).
866 .I yy
867 is undefined, a warning of type
868 .B mac
869 will be generated, and the request will be ignored.
872 .BR de ,
873 .BR am ,
874 .BR di ,
875 .BR da ,
876 .BR ds ,
878 .B as
879 requests only create a new object if the name of the macro, diversion
880 or string diversion is currently undefined or if it is defined to be a
881 request; normally they modify the value of an existing object.
884 .BI .am1\  xx\ yy
885 Similar to
886 .BR .am , 
887 but compatibility mode is switched off during execution.
889 To be more precise, a `compatibility save' token is inserted at the
890 beginning of the macro addition, and a `compatibility restore' token at
891 the end.
893 As a consequence, the requests
894 .BR am ,
895 .BR am1 ,
896 .BR de ,
898 .B de1
899 can be intermixed freely since the compatibility save/\:restore tokens
900 only affect the macro parts defined by
901 .B .am1
903 .BR .ds1 .
906 .BI .ami\  xx\ yy
907 Append to macro indirectly.
909 See the
910 .B dei
911 request below for more information.
914 .BI .ami1\  xx\ yy
915 Same as the
916 .B ami
917 request but compatibility mode is switched off during execution.
920 .BI .as1\  xx\ yy
921 Similar to
922 .BR .as , 
923 but compatibility mode is switched off during expansion.
925 To be more precise, a `compatibility save' token is inserted at the
926 beginning of the string, and a `compatibility restore' token at the end.
928 As a consequence, the requests
929 .BR as ,
930 .BR as1 ,
931 .BR ds ,
933 .B ds1
934 can be intermixed freely since the compatibility save/\:restore tokens
935 only affect the (sub)strings defined by
936 .B as1
938 .BR ds1 .
941 .BI .asciify\  xx
942 This request `unformats' the diversion
943 .I xx
944 in such a way that
945 .SM ASCII
946 and space characters (and some escape sequences) that were formatted
947 and diverted into
948 .I xx
949 will be treated like ordinary input characters when
950 .I xx
951 is reread.
952 Useful for diversions in conjunction with the
953 .B .writem
954 request.
956 It can be also used for gross hacks; for example, this
960 .ne 7v+\n(.Vu
961 .ft CB
963 .Text .tr @.
964 .Text .di x
965 .Text @nr n 1
966 .Text .br
967 .Text .di
968 .Text .tr @@
969 .Text .asciify x
970 .Text .x
976 will set register\~\c
977 .B n
978 to\~1.
980 Note that glyph information (font, font size, etc.) is not preserved;
982 .B .unformat
983 instead.
986 .B .backtrace
987 Print a backtrace of the input stack on stderr.
990 .BI .blm\  xx
991 Set the blank line macro to
992 .IR xx .
993 If there is a blank line macro, it will be invoked when a blank line
994 is encountered instead of the usual troff behaviour.
997 .BI .box\  xx
999 .BI .boxa\  xx
1000 These requests are similar to the
1001 .B di
1003 .B da
1004 requests with the exception that a partially filled line will not
1005 become part of the diversion (i.e., the diversion always starts with a
1006 new line) but restored after ending the diversion, discarding the
1007 partially filled line which possibly comes from the diversion.
1010 .B .break
1011 Break out of a while loop.
1013 See also the
1014 .B while
1016 .B continue
1017 requests.
1019 Be sure not to confuse this with the
1020 .B br
1021 request.
1024 .B .brp
1025 This is the same as
1026 .BR \[rs]p .
1029 .BI .cflags\  n\ c1\ c2\|.\|.\|.\&
1030 Characters
1031 .IR c1 ,
1032 .IR c2 ,\|.\|.\|.\&
1033 have properties determined by
1034 .IR n ,
1035 which is ORed from the following:
1038 .IP 1
1039 The character ends sentences (initially characters
1040 .B .?!\&
1041 have this property).
1043 .IP 2
1044 Lines can be broken before the character (initially no characters have
1045 this property); a line will not be broken at a character with this
1046 property unless the characters on each side both have non-zero
1047 hyphenation codes.
1049 .IP 4
1050 Lines can be broken after the character (initially characters
1051 .B \-\[rs][hy]\[rs][em]
1052 have this property); a line will not be broken at a character with
1053 this property unless the characters on each side both have non-zero
1054 hyphenation codes.
1056 .IP 8
1057 The character overlaps horizontally (initially characters
1058 .B \[rs][ul]\[rs][rn]\[rs][ru]\[rs][radicalex]\[rs][sqrtex]
1059 have this property).
1061 .IP 16
1062 The character overlaps vertically (initially character
1063 .B \[rs][br]
1064 has this property).
1066 .IP 32
1067 An end-of-sentence character followed by any number of characters with
1068 this property will be treated as the end of a sentence if followed by
1069 a newline or two spaces; in other words the character is transparent
1070 for the purposes of end-of-sentence recognition; this is the same as
1071 having a zero space factor in \*[tx] (initially characters
1072 .B \[dq]')]*\[rs](dg\[rs](rq
1073 have this property).
1077 .BI .char\  c\ string
1078 Define glyph
1079 .I c
1080 to be
1081 .IR string .
1082 Every time glyph
1083 .I c
1084 needs to be printed,
1085 .I string
1086 will be processed in a temporary environment and the result will be
1087 wrapped up into a single object.
1089 Compatibility mode will be turned off and the escape character will be
1090 set to
1091 .B \[rs]
1092 while
1093 .I string
1094 is being processed.
1096 Any emboldening, constant spacing or track kerning will be applied to
1097 this object rather than to individual glyphs in
1098 .IR string .
1101 A glyph defined by this request can be used just like a normal
1102 glyph provided by the output device.
1104 In particular other characters can be translated to it with the
1105 .B tr
1106 request; it can be made the leader character by the
1107 .B lc
1108 request; repeated patterns can be drawn with the character using the
1109 .B \[rs]l
1111 .B \[rs]L
1112 escape sequences; words containing the character can be hyphenated
1113 correctly, if the
1114 .B hcode
1115 request is used to give the character a hyphenation code.
1118 There is a special anti-recursion feature: Use of glyph within the
1119 glyph's definition will be handled like normal glyphs not
1120 defined with
1121 .BR char .
1123 A glyph definition can be removed with the
1124 .B rchar
1125 request.
1128 .BI .chop\  xx
1129 Chop the last element off macro, string, or diversion
1130 .IR xx .
1131 This is useful for removing the newline from the end of diversions
1132 that are to be interpolated as strings.
1135 .BI .close\  stream
1136 Close the stream named
1137 .IR stream ;
1138 .I stream
1139 will no longer be an acceptable argument to the
1140 .B write
1141 request.
1143 See the
1144 .B open
1145 request.
1148 .BI .composite\  glyph1\ glyph2
1149 Map glyph name
1150 .I glyph1
1151 to glyph name
1152 .I glyph2
1153 if it is used in
1154 .BI \[rs][ ... ]
1155 with more than one component.
1158 .B .continue
1159 Finish the current iteration of a while loop.
1161 See also the
1162 .B while
1164 .B break
1165 requests.
1168 .BI .color\  n
1170 .I n
1171 is non-zero or missing, enable colors (this is the default), otherwise
1172 disable them.
1175 .BI .cp\  n
1177 .I n
1178 is non-zero or missing, enable compatibility mode, otherwise disable
1181 In compatibility mode, long names are not recognised, and the
1182 incompatibilities caused by long names do not arise.
1185 .BI .defcolor\  xxx\ scheme\ color_components
1186 Define color.
1187 .I scheme
1188 can be one of the following values:
1189 .B rgb
1190 (three components),
1191 .B cym
1192 (three components),
1193 .B cmyk
1194 (four components), and
1195 .B gray
1197 .B grey
1198 (one component).
1200 Color components can be given either as a hexadecimal string or as
1201 positive decimal integers in the range 0-65535.
1203 A hexadecimal string contains all color components concatenated; it
1204 must start with either
1205 .B #
1207 .BR ## .
1208 The former specifies hex values in the range 0-255 (which are
1209 internally multiplied by\~257), the latter in the range 0-65535.
1211 Examples: #FFC0CB (pink), ##ffff0000ffff (magenta).
1213 A new scaling indicator\~\c
1214 .B f
1215 has been introduced which multiplies its value by\~65536; this makes
1216 it convenient to specify color components as fractions in the range 0
1217 to\~1.
1219 Example:
1223 .ft CB
1224 .Text .defcolor darkgreen rgb 0.1f 0.5f 0.2f
1230 Note that
1231 .B f
1232 is the default scaling indicator for the
1233 .B defcolor
1234 request, thus the above statement is equivalent to
1238 .ft CB
1239 .Text .defcolor darkgreen rgb 0.1 0.5 0.2
1245 The color named
1246 .B default
1247 (which is device-specific) can't be redefined.
1249 It is possible that the default color for
1250 .esc M
1252 .esc m
1253 is not the same.
1256 .BI .de1\  xx\ yy
1257 Similar to
1258 .BR .de , 
1259 but compatibility mode is switched off during execution.
1261 On entry, the current compatibility mode is saved and restored at exit.
1264 .BI .dei\  xx\ yy
1265 Define macro indirectly.
1267 The following example
1271 .ne 2v+\n(.Vu
1272 .ft CB
1274 .Text .ds xx aa
1275 .Text .ds yy bb
1276 .Text .dei xx yy
1282 is equivalent to
1286 .ft CB
1287 .Text .de aa bb
1293 .BI .dei1\  xx\ yy
1294 Similar to the
1295 .B dei
1296 request but compatibility mode is switched off during execution.
1299 .BI .do\  xxx
1300 Interpret
1301 .I .xxx
1302 with compatibility mode disabled.
1304 For example,
1309 .ft CB
1310 .Text .do fam T
1315 would have the same effect as
1318 .ft CB
1319 .Text .fam T
1324 except that it would work even if compatibility mode had been enabled.
1326 Note that the previous compatibility mode is restored before any files
1327 sourced by
1328 .I xxx
1329 are interpreted.
1334 .BI .ds1\  xx\ yy
1335 Similar to
1336 .BR .ds , 
1337 but compatibility mode is switched off during expansion.
1339 To be more precise, a `compatibility save' token is inserted at the
1340 beginning of the string, and a `compatibility restore' token at the end.
1343 .B .ecs
1344 Save current escape character.
1347 .B .ecr
1348 Restore escape character saved with
1349 .BR ecs .
1350 Without a previous call to
1351 .BR ecs ,
1352 .RB ` \[rs] '
1353 will be the new escape character.
1356 .BI .evc\  xx
1357 Copy the contents of environment
1358 .I xx
1359 to the current environment.
1361 No pushing or popping of environments will be done.
1364 .BI .fam\  xx
1365 Set the current font family to
1366 .IR xx .
1367 The current font family is part of the current environment.
1369 .I xx
1370 is missing, switch back to previous font family.
1372 The value at start-up is `T'.
1374 See the description of the
1375 .B sty
1376 request for more information on font families.
1379 .BI .fchar\  c\ string
1380 Define fallback glyph
1381 .I c
1382 to be
1383 .IR string .
1385 The syntax of this request is the same as the
1386 .B char
1387 request; the only difference is that a glyph defined with
1388 .B char
1389 hides the glyph with the same name in the current font, whereas a
1390 glyph defined with
1391 .B fchar
1392 is checked only if the particular glyph isn't found in the current font.
1394 This test happens before checking special fonts.
1397 .BI .fschar\  f\ c\ string
1398 Define fallback glyph
1399 .I c
1400 for font
1401 .I f
1402 to be
1403 .IR string .
1405 The syntax of this request is the same as the
1406 .B char
1407 request (with an additional argument to specify the font); a glyph
1408 defined with
1409 .B fschar
1410 is searched after the list of fonts declared with the
1411 .B fspecial
1412 request but before the list of fonts declared with
1413 .BR special .
1416 .BI .fspecial\  f\ s1\ s2\|.\|.\|.\&
1417 When the current font is
1418 .IR f ,
1419 fonts
1420 .IR s1 ,
1421 .IR s2 ,\|.\|.\|.\&
1422 will be special, that is, they will searched for glyphs not in
1423 the current font.
1425 Any fonts specified in the
1426 .B special
1427 request will be searched after fonts specified in the
1428 .B fspecial
1429 request.
1431 Without argument, reset the list of global special fonts to be empty.
1434 .BI .ftr\  f\ g
1435 Translate font
1436 .I f
1438 .IR g .
1439 Whenever a font named
1440 .I f
1441 is referred to in an
1442 .B \[rs]f
1443 escape sequence, or in the
1444 .BR ft ,
1445 .BR ul ,
1446 .BR bd ,
1447 .BR cs ,
1448 .BR tkf ,
1449 .BR special ,
1450 .BR fspecial ,
1451 .BR fp ,
1453 .BR sty
1454 requests, font
1455 .I g
1456 will be used.
1458 .I g
1459 is missing, or equal to
1460 .I f
1461 then font
1462 .I f
1463 will not be translated.
1466 .BI .hcode \ c1\ code1\ c2\ code2\|.\|.\|.\&
1467 Set the hyphenation code of character
1468 .I c1
1470 .I code1
1471 and that of
1472 .I c2
1474 .IR code2 .
1475 A hyphenation code must be a single input character (not a special
1476 character) other than a digit or a space.
1478 Initially each lower-case letter \%a-z has a hyphenation code, which is
1479 itself, and each upper-case letter \%A-Z has a hyphenation code which is
1480 the lower-case version of itself.
1482 See also the
1483 .B hpf
1484 request.
1487 .BI .hla\  lang
1488 Set the current hyphenation language to
1489 .IR lang .
1490 Hyphenation exceptions specified with the
1491 .B hw
1492 request and hyphenation patterns specified with the
1493 .B hpf
1494 request are both associated with the current hyphenation language.
1497 .B hla
1498 request is usually invoked by the
1499 .B troffrc
1500 file.
1503 .BI .hlm\  n
1504 Set the maximum number of consecutive hyphenated lines to\~\c
1505 .IR n .
1507 .I n
1508 is negative, there is no maximum.
1510 The default value is\~\-1.
1512 This value is associated with the current environment.
1514 Only lines output from an environment count towards the maximum
1515 associated with that environment.
1517 Hyphens resulting from
1518 .B \[rs]%
1519 are counted; explicit hyphens are not.
1522 .BI .hpf\  file
1523 Read hyphenation patterns from
1524 .IR file ;
1525 this will be searched for in the same way that
1526 .IB name .tmac
1527 is searched for when the
1528 .BI \-m name
1529 option is specified.
1531 It should have the same format as (simple) \*[tx] patterns files.
1533 More specifically, the following scanning rules are implemented.
1536 .IP \[bu]
1537 A percent sign starts a comment (up to the end of the line) even if
1538 preceded by a backslash.
1540 .IP \[bu]
1541 No support for `digraphs' like
1542 .BR \[rs]$ .
1544 .IP \[bu]
1545 .BI ^^ xx
1546 .RI ( x
1547 is 0-9 or a-f) and
1548 .BI ^^ x
1549 (character code of\~\c
1550 .I x
1551 in the range 0-127) are recognized; other use of
1552 .B ^
1553 causes an error.
1555 .IP \[bu]
1556 No macro expansion.
1558 .IP \[bu]
1559 .B hpf
1560 checks for the expression
1561 .B \[rs]patterns{.\|.\|.}
1562 (possibly with whitespace before and after the braces).
1564 Everything between the braces is taken as hyphenation patterns.
1566 Consequently,
1567 .B {
1569 .B }
1570 are not allowed in patterns.
1572 .IP \[bu]
1573 Similarly,
1574 .B \[rs]hyphenation{.\|.\|.}
1575 gives a list of hyphenation exceptions.
1577 .IP \[bu]
1578 .B \[rs]endinput
1579 is recognized also.
1581 .IP \[bu]
1582 For backwards compatibility, if
1583 .B \[rs]patterns
1584 is missing, the whole file is treated as a list of hyphenation patterns
1585 (only recognizing the
1586 .BR % \~\c
1587 character as the start of a comment).
1591 Use the
1592 .B hpfcode
1593 request to map the encoding used in hyphenation patterns files to
1594 .BR groff 's
1595 input encoding.
1597 The set of hyphenation patterns is associated with the current language
1598 set by the
1599 .B hla
1600 request.
1603 .B hpf
1604 request is usually invoked by the
1605 .B troffrc
1606 file; a second call replaces the old patterns with the new ones.
1609 .BI .hpfa\  file
1610 The same as
1611 .B hpf
1612 except that the hyphenation patterns from
1613 .I file
1614 are appended to the patterns already loaded in the current language.
1617 .BI .hpfcode\  a\ b\ c\ d\ .\|.\|.
1618 After reading a hyphenation patterns file with the
1619 .B hpf
1621 .B hpfa
1622 request, convert all characters with character code\~\c
1623 .I a
1624 in the recently read patterns to character code\~\c
1625 .IR b ,
1626 character code\~\c
1627 .I c
1628 to\~\c
1629 .IR d ,
1630 etc.
1632 Initially, all character codes map to themselves.
1634 The arguments of
1635 .B hpfcode
1636 must be integers in the range 0 to\~255.
1638 Note that it is even possible to use character codes which are invalid in
1639 .B groff
1640 otherwise.
1643 .BI .hym\  n
1644 Set the
1645 .I hyphenation margin
1646 to\~\c
1647 .IR n :
1648 when the current adjustment mode is not\~\c
1649 .BR b ,
1650 the line will not be hyphenated if the line is no more than
1651 .I n
1652 short.
1654 The default hyphenation margin is\~0.
1656 The default scaling indicator for this request is\~\c
1657 .IR m .
1658 The hyphenation margin is associated with the current environment.
1660 The current hyphenation margin is available in the
1661 .B \[rs]n[.hym]
1662 register.
1665 .BI .hys\  n
1666 Set the
1667 .I hyphenation space
1668 to\~\c
1669 .IR n :
1670 when the current adjustment mode is\~\c
1671 .B b
1672 don't hyphenate the line if the line can be justified by adding no
1673 more than
1674 .I n
1675 extra space to each word space.
1677 The default hyphenation space is\~0.
1679 The default scaling indicator for this request is\~\c
1680 .BR m .
1681 The hyphenation space is associated with the current environment.
1683 The current hyphenation space is available in the
1684 .B \[rs]n[.hys]
1685 register.
1688 .BI .itc\  n\ macro
1689 Variant of
1690 .B .it
1691 for which a line interrupted with
1692 .B \[rs]c
1693 counts as one input line.
1696 .BI .kern\  n
1698 .I n
1699 is non-zero or missing, enable pairwise kerning, otherwise disable it.
1702 .BI .length\  xx\ string
1703 Compute the length of
1704 .I string
1705 and return it in the number register
1706 .I xx
1707 (which is not necessarily defined before).
1710 .BI .linetabs\  n
1712 .I n
1713 is non-zero or missing, enable line-tabs mode, otherwise disable it
1714 (which is the default).
1716 In line-tabs mode, tab distances are computed relative to the
1717 (current) output line.
1719 Otherwise they are taken relative to the input line.
1721 For example, the following
1725 .ne 6v+\n(.Vu
1726 .ft CB
1728 .Text .ds x a\[rs]t\[rs]c
1729 .Text .ds y b\[rs]t\[rs]c
1730 .Text .ds z c
1731 .Text .ta 1i 3i
1732 .Text \[rs]*x
1733 .Text \[rs]*y
1734 .Text \[rs]*z
1740 yields
1744 a         b         c
1748 In line-tabs mode, the same code gives
1752 a         b                   c
1756 Line-tabs mode is associated with the current environment; the
1757 read-only number register
1758 .B \\[rs]n[.linetabs]
1759 is set to\~1 if in line-tabs mode, and 0 otherwise.
1762 .BI .mso\  file
1763 The same as the
1764 .B so
1765 request except that
1766 .I file
1767 is searched for in the same directories as macro files for the the
1768 .B \-m
1769 command line option.
1771 If the file name to be included has the form
1772 .IB name .tmac
1773 and it isn't found,
1774 .B mso
1775 tries to include
1776 .BI tmac. name
1777 instead and vice versa.
1780 .BI .nop \ anything
1781 Execute
1782 .IR anything .
1783 This is similar to `.if\ 1'.
1786 .B .nroff
1787 Make the
1788 .B n
1789 built-in condition true and the
1790 .B t
1791 built-in condition false.
1793 This can be reversed using the
1794 .B troff
1795 request.
1798 .BI .open\  stream\ filename
1799 Open
1800 .I filename
1801 for writing and associate the stream named
1802 .I stream
1803 with it.
1805 See also the
1806 .B close
1808 .B write
1809 requests.
1811 .TP 
1812 .BI .opena\  stream\ filename
1813 Like
1814 .BR open ,
1815 but if
1816 .I filename
1817 exists, append to it instead of truncating it.
1820 .BI .output\  string
1821 Emit
1822 .I string
1823 directly to the intermediate output (subject to copy-mode interpretation);
1824 this is similar to
1825 .B \[rs]!
1826 used at the top level.
1828 An initial double quote in
1829 .I string
1830 is stripped off to allow initial blanks.
1833 .B .pnr
1834 Print the names and contents of all currently defined number registers
1835 on stderr.
1838 .BI .psbb \ filename
1839 Get the bounding box of a PostScript image
1840 .IR filename .
1841 This file must conform to Adobe's Document Structuring Conventions;
1842 the command looks for a
1843 .B \%%%BoundingBox
1844 comment to extract the bounding box values.
1846 After a successful call, the coordinates (in PostScript units) of the
1847 lower left and upper right corner can be found in the registers
1848 .BR \[rs]n[llx] ,
1849 .BR \[rs]n[lly] ,
1850 .BR \[rs]n[urx] ,
1852 .BR \[rs]n[ury] ,
1853 respectively.
1855 If some error has occurred, the four registers are set to zero.
1858 .BI .pso \ command
1859 This behaves like the
1860 .B so
1861 request except that input comes from the standard output of
1862 .IR command .
1865 .B .ptr
1866 Print the names and positions of all traps (not including input line
1867 traps and diversion traps) on stderr.
1869 Empty slots in the page trap list are printed as well, because they
1870 can affect the priority of subsequently planted traps.
1873 .BI .pvs \ \[+-]n
1874 Set the post-vertical line space to
1875 .IR n ;
1876 default scale indicator is\~\c
1877 .BR p .
1879 This value will be added to each line after it has been output.
1881 With no argument, the post-vertical line space is set to its previous
1882 value.
1885 The total vertical line spacing consists of four components:
1886 .B .vs
1888 .B \[rs]x
1889 with a negative value which are applied before the line is output, and
1890 .B .pvs
1892 .B \[rs]x
1893 with a positive value which are applied after the line is output.
1896 .BI .rchar\  c1\ c2\|.\|.\|.\&
1897 Remove the definitions of glyphs
1898 .IR c1 ,
1899 .IR c2 ,\|.\|.\|.
1900 This undoes the effect of a
1901 .B char
1902 request.
1905 .B .return
1906 Within a macro, return immediately.
1908 If called with an argument, return twice, namely from the current macro and
1909 from the macro one level higher.
1911 No effect otherwise.
1914 .BI .rfschar\  c1\ c2\|.\|.\|.\&
1915 Remove the font-specific definitions of glyphs
1916 .IR c1 ,
1917 .IR c2 ,\|.\|.\|.
1918 This undoes the effect of a
1919 .B fschar
1920 request.
1923 .B .rj
1925 .BI .rj \~n
1926 Right justify the next
1927 .IR n \~\c
1928 input lines.
1930 Without an argument right justify the next input line.
1932 The number of lines to be right justified is available in the
1933 .B \[rs]n[.rj]
1934 register.
1936 This implicitly does
1937 .BR .ce \~0 .
1939 .B ce
1940 request implicitly does
1941 .BR .rj \~0 .
1944 .BI .rnn \ xx\ yy
1945 Rename number register
1946 .I xx
1948 .IR yy .
1951 .BI .schar\  c\ string
1952 Define global fallback glyph
1953 .I c
1954 to be
1955 .IR string .
1957 The syntax of this request is the same as the
1958 .B char
1959 request; a glyph defined with
1960 .B schar
1961 is searched after the list of fonts declared with the
1962 .B special
1963 request but before the mounted special fonts.
1966 .BI .shc\  c
1967 Set the soft hyphen character to
1968 .IR c .
1970 .I c
1971 is omitted, the soft hyphen character will be set to the default
1972 .BR \[rs](hy .
1973 The soft hyphen character is the glyph which will be inserted when
1974 a word is hyphenated at a line break.
1976 If the soft hyphen character does not exist in the font of the
1977 glyph immediately preceding a potential break point, then the line
1978 will not be broken at that point.
1980 Neither definitions (specified with the
1981 .B char
1982 request) nor translations (specified with the
1983 .B tr
1984 request) are considered when finding the soft hyphen character.
1987 .BI .shift\  n
1988 In a macro, shift the arguments by
1989 .I n
1990 positions: argument\~\c
1991 .I i
1992 becomes argument
1993 .IR i \- n ;
1994 arguments 1 to\~\c
1995 .I n
1996 will no longer be available.
1999 .I n
2000 is missing, arguments will be shifted by\~1.
2002 Shifting by negative amounts is currently undefined.
2005 .BI .sizes\  s1\ s2\|.\|.\|.\|sn\  [0]
2006 This command is similar to the
2007 .B sizes
2008 command of a
2009 .B DESC
2010 file.
2012 It sets the available font sizes for the current font to
2013 .IR s1 ,
2014 .IR s2 ,\|.\|.\|.\|,\~ sn
2015 scaled points.
2017 The list of sizes can be terminated by an optional\~\c
2018 .BR 0 .
2020 Each
2021 .I si
2022 can also be a range of sizes
2023 .IR m - n .
2025 Contrary to the font file command, the list can't extend over more
2026 than a single line.
2029 .BI .special\  s1\ s2\|.\|.\|.\&
2030 Fonts
2031 .IR s1 ,
2032 .IR s2 ,
2033 are special and will be searched for glyphs not in the current
2034 font.
2036 Without arguments, reset the list of special fonts to be empty.
2039 .BI .spreadwarn\  limit
2040 Make
2041 .B troff
2042 emit a warning if the additional space inserted for each space between
2043 words in an output line is larger or equal to
2044 .IR limit .
2046 A negative value is changed to zero; no argument toggles the warning on
2047 and off without changing
2048 .IR limit .
2050 The default scaling indicator is\~\c
2051 .BR m .
2053 At startup,
2054 .B spreadwarn
2055 is deactivated, and
2056 .I limit
2057 is set to 3m.
2059 For example,
2060 .B .spreadwarn\ 0.2m
2061 will cause a warning if
2062 .B troff
2063 must add 0.2m or more for each interword space in a line.
2065 This request is active only if text is justified to both margins (using
2066 .BR .ad\ b ).
2069 .BI .sty\  n\ f
2070 Associate style\~\c
2071 .I f
2072 with font position\~\c
2073 .IR n .
2074 A font position can be associated either with a font or with a style.
2076 The current font is the index of a font position and so is also either
2077 a font or a style.
2079 When it is a style, the font that is actually used is the font the
2080 name of which is the concatenation of the name of the current family
2081 and the name of the current style.
2083 For example, if the current font is\~1 and font position\~1 is
2084 associated with style\~\c
2085 .B R
2086 and the current font family is\~\c
2087 .BR T ,
2088 then font
2089 .BR TR
2090 will be used.
2092 If the current font is not a style, then the current family is ignored.
2094 When the requests
2095 .BR cs ,
2096 .BR bd ,
2097 .BR tkf ,
2098 .BR uf ,
2100 .B fspecial
2101 are applied to a style, then they will instead be applied to the
2102 member of the current family corresponding to that style.
2104 The default family can be set with the
2105 .B \-f
2106 option.
2109 .B styles
2110 command in the
2111 .SM DESC
2112 file controls which font positions (if any) are initially associated
2113 with styles rather than fonts.
2116 .BI .substring\  xx\ n1\  [ n2 ]
2117 Replace the string named
2118 .I xx
2119 with the substring defined by the indices
2120 .I n1
2122 .IR n2 .
2123 The first character in the string has index\~0.
2126 .I n2
2127 is omitted, it is taken to be equal to the string's length.
2129 If the index value
2130 .I n1
2132 .I n2
2133 is negative, it will be counted from the end of the string,
2134 going backwards:
2136 The last character has index\~-1, the character before the last
2137 character has index\~-2, etc.
2140 .BI .tkf\  f\ s1\ n1\ s2\ n2
2141 Enable track kerning for font
2142 .IR f .
2143 When the current font is
2144 .I f
2145 the width of every glyph will be increased by an amount between
2146 .I n1
2148 .IR n2 ;
2149 when the current point size is less than or equal to
2150 .I s1
2151 the width will be increased by
2152 .IR n1 ;
2153 when it is greater than or equal to
2154 .I s2
2155 the width will be increased by
2156 .IR n2 ;
2157 when the point size is greater than or equal to
2158 .I s1
2159 and less than or equal to
2160 .I s2
2161 the increase in width is a linear function of the point size.
2164 .BI .tm1\  string
2165 Similar to the
2166 .B tm
2167 request,
2168 .I string
2169 is read in copy mode and written on the standard error, but an initial
2170 double quote in
2171 .I string
2172 is stripped off to allow initial blanks.
2175 .BI .tmc\  string
2176 Similar to
2177 .B tm1
2178 but without writing a final newline.
2181 .BI .trf\  filename
2182 Transparently output the contents of file
2183 .IR filename .
2184 Each line is output as if preceded by
2185 .BR \[rs]! ;
2186 however, the lines are not subject to copy-mode interpretation.
2188 If the file does not end with a newline, then a newline will be added.
2190 For example, you can define a macro\~\c
2191 .I x
2192 containing the contents of file\~\c
2193 .IR f ,
2194 using
2198 .ne 2v+\n(.Vu
2199 .ft CB
2201 .Text .di x
2202 .Text .trf f
2203 .Text .di
2209 Unlike with the
2210 .B cf
2211 request, the file cannot contain characters such as
2212 .SM NUL
2213 that are not legal troff input characters.
2216 .BI .trin\  abcd
2217 This is the same as the
2218 .B tr
2219 request except that the
2220 .B asciify
2221 request will use the character code (if any) before the character
2222 translation.
2224 Example:
2229 .ft CB
2230 .Text .trin ax
2231 .Text .di xxx
2232 .Text a
2233 .Text .br
2234 .Text .di
2235 .Text .xxx
2236 .Text .trin aa
2237 .Text .asciify xxx
2238 .Text .xxx
2244 The result is
2245 .BR x\ a .
2247 Using
2248 .BR tr ,
2249 the result would be
2250 .BR x\ x .
2253 .BI .trnt\  abcd
2254 This is the same as the
2255 .B tr
2256 request except that the translations do not apply to text that is
2257 transparently throughput into a diversion with
2258 .BR \[rs]! .
2259 For example,
2264 .ft CB
2265 .Text .tr ab
2266 .Text .di x
2267 .Text \[rs]!.tm a
2268 .Text .di
2269 .Text .x
2275 will print\~\c
2276 .BR b ;
2278 .B trnt
2279 is used instead of
2280 .B tr
2281 it will print\~\c
2282 .BR a .
2286 .B .troff
2287 Make the
2288 .B n
2289 built-in condition false, and the
2290 .B t
2291 built-in condition true.
2293 This undoes the effect of the
2294 .B nroff
2295 request.
2298 .BI .unformat\  xx
2299 This request `unformats' the diversion
2300 .IR xx .
2301 Contrary to the
2302 .B .asciify
2303 request, which tries to convert formatted elements of the diversion
2304 back to input tokens as much as possible,
2305 .B .unformat
2306 will only handle tabs and spaces between words (usually caused by
2307 spaces or newlines in the input) specially.
2309 The former are treated as if they were input tokens, and the latter
2310 are stretchable again.
2312 Note that the vertical size of lines is not preserved.
2314 Glyph information (font, font size, space width, etc.) is retained.
2316 Useful in conjunction with the
2317 .B .box
2319 .B .boxa
2320 requests.
2323 .BI .vpt\  n
2324 Enable vertical position traps if
2325 .I n
2326 is non-zero, disable them otherwise.
2328 Vertical position traps are traps set by the
2329 .B wh
2331 .B dt
2332 requests.
2334 Traps set by the
2335 .B it
2336 request are not vertical position traps.
2338 The parameter that controls whether vertical position traps are
2339 enabled is global.
2341 Initially vertical position traps are enabled.
2344 .BI .warn\  n
2345 Control warnings.
2346 .I n
2347 is the sum of the numbers associated with each warning that is to be
2348 enabled; all other warnings will be disabled.
2350 The number associated with each warning is listed in
2351 .BR @g@troff (@MAN1EXT@).
2353 For example,
2354 .B .warn\~0
2355 will disable all warnings, and
2356 .B .warn\~1
2357 will disable all warnings except that about missing glyphs.
2360 .I n
2361 is not given, all warnings will be enabled.
2364 .BI .warnscale\  si
2365 Set the scaling indicator used in warnings to
2366 .IR si .
2368 Valid values for
2369 .I si
2371 .BR u ,
2372 .BR i ,
2373 .BR c ,
2374 .BR p ,
2376 .BR P .
2378 At startup, it is set to\~\c
2379 .BR i .
2382 .BI .while \ c\ anything
2383 While condition\~\c
2384 .I c
2385 is true, accept
2386 .I anything
2387 as input;
2388 .IR c \~\c
2389 can be any condition acceptable to an
2390 .B if
2391 request;
2392 .I anything
2393 can comprise multiple lines if the first line starts with
2394 .B \[rs]{
2395 and the last line ends with
2396 .BR \[rs]} .
2397 See also the
2398 .B break
2400 .B continue
2401 requests.
2404 .BI .write\  stream\ anything
2405 Write
2406 .I anything
2407 to the stream named
2408 .IR stream .
2409 .I stream
2410 must previously have been the subject of an
2411 .B open
2412 request.
2413 .I anything
2414 is read in copy mode;
2415 a leading\~\c
2416 .B \[dq]
2417 will be stripped.
2420 .BI .writec\  stream\ anything
2421 Similar to
2422 .B write
2423 but without writing a final newline.
2426 .BI .writem\  stream\ xx
2427 Write the contents of the macro or string
2428 .I xx
2429 to the stream named
2430 .IR stream .
2431 .I stream
2432 must previously have been the subject of an
2433 .B open
2434 request.
2435 .I xx
2436 is read in copy mode.
2439 .\" --------------------------------------------------------------------
2440 .SS "Extended escape sequences"
2441 .\" --------------------------------------------------------------------
2444 .BI \[rs]D' .\|.\|. '
2445 All drawing commands of groff's intermediate output are accepted.
2447 See subsection
2448 .B "Drawing Commands"
2449 below for more information.
2452 .\" --------------------------------------------------------------------
2453 .SS "Extended requests"
2454 .\" --------------------------------------------------------------------
2457 .BI .cf\  filename
2458 When used in a diversion, this will embed in the diversion an object
2459 which, when reread, will cause the contents of
2460 .I filename
2461 to be transparently copied through to the output.
2463 In UNIX troff, the contents of
2464 .I filename
2465 is immediately copied through to the output regardless of whether
2466 there is a current diversion; this behaviour is so anomalous that it
2467 must be considered a bug.
2470 .BI .ev\  xx
2472 .I xx
2473 is not a number, this will switch to a named environment called
2474 .IR xx .
2475 The environment should be popped with a matching
2476 .B ev
2477 request without any arguments, just as for numbered environments.
2479 There is no limit on the number of named environments; they will be
2480 created the first time that they are referenced.
2483 .BI .ss\  m\ n
2484 When two arguments are given to the
2485 .B ss
2486 request, the second argument gives the
2487 .IR "sentence space size" .
2488 If the second argument is not given, the sentence space size
2489 will be the same as the word space size.
2491 Like the word space size, the sentence space is in units of
2492 one twelfth of the spacewidth parameter for the current font.
2494 Initially both the word space size and the sentence
2495 space size are\~12.
2497 Contrary to UNIX troff, GNU troff handles this request in nroff mode
2498 also; a given value is then rounded down to the nearest multiple
2499 of\~12.
2501 The sentence space size is used in two circumstances.
2503 If the end of a sentence occurs at the end of a line in fill mode,
2504 then both an inter-word space and a sentence space will be added; if
2505 two spaces follow the end of a sentence in the middle of a line, then
2506 the second space will be a sentence space.
2508 Note that the behaviour of UNIX troff will be exactly that exhibited
2509 by GNU troff if a second argument is never given to the
2510 .B ss
2511 request.
2513 In GNU troff, as in UNIX troff, you should always follow a sentence
2514 with either a newline or two spaces.
2517 .BI .ta\  n1\ n2\|.\|.\|.nn \ T\  r1\ r2\|.\|.\|.\|rn
2518 Set tabs at positions
2519 .IR n1 ,
2520 .IR n2 ,\|.\|.\|.\|,
2521 .I nn
2522 and then set tabs at
2523 .IR nn + r1 ,
2524 .IR nn + r2 ,\|.\|.\|.\|,
2525 .IR nn + rn
2526 and then at
2527 .IR nn + rn + r1 ,
2528 .IR nn + rn + r2 ,\|.\|.\|.\|,
2529 .IR nn + rn + rn ,
2530 and so on.
2531 For example,
2535 .ft CB
2536 .Text .ta T .5i
2541 will set tabs every half an inch.
2545 .\" --------------------------------------------------------------------
2546 .SS "New number registers"
2547 .\" --------------------------------------------------------------------
2549 The following read-only registers are available:
2552 .B \[rs]n[.C]
2553 1\~if compatibility mode is in effect, 0\~otherwise.
2556 .B \[rs]n[.cdp]
2557 The depth of the last glyph added to the current environment.
2559 It is positive if the glyph extends below the baseline.
2562 .B \[rs]n[.ce]
2563 The number of lines remaining to be centered, as set by the
2564 .B ce
2565 request.
2568 .B \[rs]n[.cht]
2569 The height of the last glyph added to the current environment.
2571 It is positive if the glyph extends above the baseline.
2574 .B \[rs]n[.color]
2575 1\~if colors are enabled, 0\~otherwise.
2578 .B \[rs]n[.csk]
2579 The skew of the last glyph added to the current environment.
2582 .I skew
2583 of a glyph is how far to the right of the center of a glyph
2584 the center of an accent over that glyph should be placed.
2587 .B \[rs]n[.ev]
2588 The name or number of the current environment.
2590 This is a string-valued register.
2593 .B \[rs]n[.fam]
2594 The current font family.
2596 This is a string-valued register.
2599 .B \[rs]n[.fn]
2600 The current (internal) real font name.
2602 This is a string-valued register.
2604 If the current font is a style, the value of
2605 .B \[rs]n[.fn]
2606 is the proper concatenation of family and style name.
2609 .B \[rs]n[.fp]
2610 The number of the next free font position.
2613 .B \[rs]n[.g]
2614 Always\~1.
2616 Macros should use this to determine whether they are running under GNU
2617 troff.
2620 .B \[rs]n[.height]
2621 The current height of the font as set with
2622 .BR \[rs]H .
2625 .B \[rs]n[.hla]
2626 The current hyphenation language as set by the
2627 .B hla
2628 request.
2631 .B \[rs]n[.hlc]
2632 The number of immediately preceding consecutive hyphenated lines.
2635 .B \[rs]n[.hlm]
2636 The maximum allowed number of consecutive hyphenated lines, as set by
2638 .B hlm
2639 request.
2642 .B \[rs]n[.hy]
2643 The current hyphenation flags (as set by the
2644 .B hy
2645 request).
2648 .B \[rs]n[.hym]
2649 The current hyphenation margin (as set by the
2650 .B hym
2651 request).
2654 .B \[rs]n[.hys]
2655 The current hyphenation space (as set by the
2656 .B hys
2657 request).
2660 .B \[rs]n[.in]
2661 The indent that applies to the current output line.
2664 .B \[rs]n[.int]
2665 Set to a positive value if last output line is interrupted (i.e., if
2666 it contains
2667 .IR \[rs]c ).
2670 .B \[rs]n[.kern]
2671 1\~if pairwise kerning is enabled, 0\~otherwise.
2674 .B \[rs]n[.lg]
2675 The current ligature mode (as set by the
2676 .B lg
2677 request).
2680 .B \[rs]n[.linetabs]
2681 The current line-tabs mode (as set by the
2682 .B linetabs
2683 request).
2686 .B \[rs]n[.ll]
2687 The line length that applies to the current output line.
2690 .B \[rs]n[.lt]
2691 The title length as set by the
2692 .B lt
2693 request.
2696 .B \[rs]n[.m]
2697 The name of the current drawing color.
2699 This is a string-valued register.
2702 .B \[rs]n[.M]
2703 The name of the current background color.
2705 This is a string-valued register.
2708 .B \[rs]n[.ne]
2709 The amount of space that was needed in the last
2710 .B ne
2711 request that caused a trap to be sprung.
2713 Useful in conjunction with the
2714 .B \[rs]n[.trunc]
2715 register.
2718 .B \[rs]n[.ns]
2719 1\~if no-space mode is active, 0\~otherwise.
2722 .B \[rs]n[.pe]
2723 1\~during a page ejection caused by the
2724 .B bp
2725 request, 0\~otherwise.
2728 .B \[rs]n[.pn]
2729 The number of the next page, either the value set by a
2730 .B pn
2731 request, or the number of the current page plus\~1.
2734 .B \[rs]n[.ps]
2735 The current pointsize in scaled points.
2738 .B \[rs]n[.psr]
2739 The last-requested pointsize in scaled points.
2742 .B \[rs]n[.pvs]
2743 The current post-vertical line space as set with the
2744 .B pvs
2745 request.
2748 .B \[rs]n[.rj]
2749 The number of lines to be right-justified as set by the
2750 .B rj
2751 request.
2754 .B \[rs]n[.slant]
2755 The slant of the current font as set with
2756 .BR \[rs]S .
2759 .B \[rs]n[.sr]
2760 The last requested pointsize in points as a decimal fraction.
2762 This is a string-valued register.
2765 .B \[rs]n[.ss]
2767 .B \[rs]n[.sss]
2768 These give the values of the parameters set by the first and second
2769 arguments of the
2770 .B ss
2771 request.
2774 .B \[rs]n[.tabs]
2775 A string representation of the current tab settings suitable for use
2776 as an argument to the
2777 .B ta
2778 request.
2781 .B \[rs]n[.trunc]
2782 The amount of vertical space truncated by the most recently sprung
2783 vertical position trap, or, if the trap was sprung by a
2784 .B ne
2785 request, minus the amount of vertical motion produced by the
2786 .B ne
2787 request.
2789 In  other  words, at the point  a  trap is  sprung,  it represents the
2790 difference of  what the vertical position  would have been but for the
2791 trap, and what the vertical position actually is.
2793 Useful in conjunction with the
2794 .B \[rs]n[.ne]
2795 register.
2798 .B \[rs]n[.vpt]
2799 1\~if vertical position traps are enabled, 0\~otherwise.
2802 .B \[rs]n[.warn]
2803 The sum of the numbers associated with each of the currently enabled
2804 warnings.
2806 The number associated with each warning is listed in
2807 .BR @g@troff (@MAN1EXT@).
2810 .B \[rs]n[.x]
2811 The major version number.
2813 For example, if the version number is 1.03, then
2814 .B \[rs]n[.x]
2815 will contain\~1.
2818 .B \[rs]n[.y]
2819 The minor version number.
2821 For example, if the version number is 1.03, then
2822 .B \[rs]n[.y]
2823 will contain\~03.
2826 .B \[rs]n[.Y]
2827 The revision number of groff.
2830 .B \[rs]n[llx]
2832 .B \[rs]n[lly]
2834 .B \[rs]n[urx]
2836 .B \[rs]n[ury]
2837 These four registers are set by the
2838 .B .psbb
2839 request and contain the bounding box values (in PostScript units) of a
2840 given PostScript image.
2843 The following read/write registers are set by the
2844 .B \[rs]w
2845 escape sequence:
2848 .B \[rs]n[rst]
2850 .B \[rs]n[rsb]
2851 Like the
2852 .B st
2854 .B sb
2855 registers, but take account of the heights and depths of glyphs.
2858 .B \[rs]n[ssc]
2859 The amount of horizontal space (possibly negative) that should be
2860 added to the last glyph before a subscript.
2863 .B \[rs]n[skw]
2864 How far to right of the center of the last glyph in the
2865 .B \[rs]w
2866 argument, the center of an accent from a roman font should be placed
2867 over that glyph.
2870 Other available read/write number registers are:
2873 .B \[rs]n[c.]
2874 The current input line number.
2875 .B \[rs]n[.c]
2876 is a read-only alias to this register.
2879 .B \[rs]n[hours]
2880 The number of hours past midnight.
2882 Initialized at start-up.
2885 .B \[rs]n[hp]
2886 The current horizontal position at input line.
2889 .B \[rs]n[minutes]
2890 The number of minutes after the hour.
2892 Initialized at start-up.
2895 .B \[rs]n[seconds]
2896 The number of seconds after the minute.
2898 Initialized at start-up.
2901 .B \[rs]n[systat]
2902 The return value of the system() function executed by the last
2903 .B sy
2904 request.
2907 .B \[rs]n[slimit]
2908 If greater than\~0, the maximum number of objects on the input stack.
2910 If less than or equal to\~0, there is no limit on the number of
2911 objects on the input stack.
2913 With no limit, recursion can continue until virtual memory is
2914 exhausted.
2917 .B \[rs]n[year]
2918 The current year.
2920 Note that the traditional
2921 .B troff
2922 number register
2923 .B \[rs]n[yr]
2924 is the current year minus 1900.
2927 .\" --------------------------------------------------------------------
2928 .SS Miscellaneous
2929 .\" --------------------------------------------------------------------
2931 .B @g@troff
2932 predefines a single (read/write) string-based register,
2933 .BR \[rs]*(.T ,
2934 which contains the argument given to the
2935 .B -T
2936 command line option, namely the current output device (for example,
2937 .I latin1
2939 .IR ascii ).
2940 Note that this is not the same as the (read-only) number register
2941 .B \[rs]n[.T]
2942 which is defined to be\~1 if
2943 .B troff
2944 is called with the
2945 .B -T
2946 command line option, and zero otherwise.
2948 This behaviour is different to UNIX troff.
2951 Fonts not listed in the
2952 .SM DESC
2953 file are automatically mounted on the next available font position
2954 when they are referenced.
2956 If a font is to be mounted explicitly with the
2957 .B fp
2958 request on an unused font position, it should be mounted on the first
2959 unused font position, which can be found in the
2960 .B \[rs]n[.fp]
2961 register; although
2962 .B troff
2963 does not enforce this strictly, it will not allow a font to be mounted
2964 at a position whose number is much greater than that of any currently
2965 used position.
2968 Interpolating a string does not hide existing macro arguments.
2970 Thus in a macro, a more efficient way of doing
2973 .BI . xx\  \[rs]\[rs]$@
2978 .BI \[rs]\[rs]*[ xx ]\[rs]\[rs]  
2981 If the font description file contains pairwise kerning information,
2982 glyphs from that font will be kerned.
2984 Kerning between two glyphs can be inhibited by placing a
2985 .B \[rs]&
2986 between them.
2989 In a string comparison in a condition, characters that appear at
2990 different input levels to the first delimiter character will not be
2991 recognised as the second or third delimiters.
2993 This applies also to the
2994 .B tl
2995 request.
2997 In a
2998 .B \[rs]w
2999 escape sequence, a character that appears at a different input level
3000 to the starting delimiter character will not be recognised as the
3001 closing delimiter character.
3003 The same is true for
3004 .BR \[rs]A ,
3005 .BR \[rs]b ,
3006 .BR \[rs]B ,
3007 .BR \[rs]C ,
3008 .BR \[rs]l ,
3009 .BR \[rs]L ,
3010 .BR \[rs]o ,
3011 .BR \[rs]X ,
3013 .BR \[rs]Z .
3015 When decoding a macro or string argument that is delimited by double
3016 quotes, a character that appears at a different input level to the starting
3017 delimiter character will not be recognised as the closing delimiter
3018 character.
3020 The implementation of
3021 .B \[rs]$@
3022 ensures that the double quotes surrounding an argument will appear the
3023 same input level, which will be different to the input level of the
3024 argument itself.
3026 In a long escape name
3027 .B ]
3028 will not be recognized as a closing delimiter except when it occurs at
3029 the same input level as the opening
3030 .BR ] .
3032 In compatibility mode, no attention is paid to the input-level.
3035 There are some new types of condition:
3038 .BI .if\ r xxx
3039 True if there is a number register named
3040 .IR xxx .
3043 .BI .if\ d xxx
3044 True if there is a string, macro, diversion, or request named
3045 .IR xxx .
3048 .BI .if\ m xxx
3049 True if there is a color named
3050 .IR xxx .
3053 .BI .if\ c ch
3054 True if there is a glyph
3055 .IR ch
3056 available;
3057 .I ch
3058 is either an
3059 .SM ASCII
3060 character or a glyph (special character)
3061 .BI \[rs]( xx
3063 .BI \[rs][ xxx ]\f[R];
3064 the condition will also be true if
3065 .I ch
3066 has been defined by the
3067 .B char
3068 request.
3072 .B tr
3073 request can now map characters onto
3074 .BR \[rs]~ .
3077 It is now possible to have whitespace between the first and second dot
3078 (or the name of the ending macro) to end a macro definition.
3080 Example:
3083 .ne 6v+\n(.Vu
3084 .ft CB
3086 .Text .de foo
3087 .Text .  nop Hello, I'm `foo'.
3088 .Text .  nop I will now define `bar'.
3089 .Text .  de bar
3090 .Text .    nop Hello, I'm `bar'.
3091 .Text .  .
3092 .Text .  nop Done.
3093 .Text ..
3094 .Text .foo
3095 .Text .bar
3099 .\" --------------------------------------------------------------------
3100 .SH "INTERMEDIATE OUTPUT FORMAT"
3101 .\" --------------------------------------------------------------------
3103 This section describes the format output by GNU troff.
3105 The output format used by GNU troff is very similar to that used
3106 by Unix device-independent troff.
3108 Only the differences are documented here.
3111 .\" --------------------------------------------------------------------
3112 .SS "Units"
3113 .\" --------------------------------------------------------------------
3115 The argument to the
3116 .B s
3117 command is in scaled points (units of
3118 .RI points/ n ,
3119 where
3120 .I n
3121 is the argument to the
3122 .B sizescale
3123 command  in the DESC file).
3125 The argument to the
3126 .B x\ Height
3127 command is also in scaled points.
3130 .\" --------------------------------------------------------------------
3131 .SS "Text Commands"
3132 .\" --------------------------------------------------------------------
3135 .BI N n
3136 Print glyph with index\~\c
3137 .I n
3138 (a non-negative integer) of the current font.
3141 If the
3142 .B tcommand
3143 line is present in the DESC file, troff will use the following two
3144 commands.
3147 .BI t xxx
3148 .I xxx
3149 is any sequence of characters terminated by a space or a newline (to
3150 be more precise, it is a sequence of glyphs which are accessed with
3151 the corresponding characters); the first character should be printed at
3152 the current position, the current horizontal position should be increased
3153 by the width of the first character, and so on for each character.
3155 The width of the glyph is that given in the font file,
3156 appropriately scaled for the current point size, and rounded so that
3157 it is a multiple of the horizontal resolution.
3159 Special characters cannot be printed using this command.
3162 .BI u n\ xxx
3163 This is same as the
3164 .B t
3165 command except that after printing each character, the current
3166 horizontal position is increased by the sum of the width of that
3167 character and
3168 .IR n .
3171 Note that single characters can have the eighth bit set, as can the
3172 names of fonts and special characters.
3175 The names of glyphs and fonts can be of arbitrary length; drivers
3176 should not assume that they will be only two characters long.
3179 When a glyph is to be printed, that glyph will always be
3180 in the current font.
3182 Unlike device-independent troff, it is not necessary for drivers to
3183 search special fonts to find a glyph.
3186 For color support, some new commands have been added:
3189 .Text \f[B]mc \f[I]cyan magenta yellow\f[R]
3191 .Text \f[B]md\f[R]
3193 .Text \f[B]mg \f[I]gray\f[R]
3195 .Text \f[B]mk \f[I]cyan magenta yellow black\f[R]
3197 .Text \f[B]mr \f[I]red green blue\f[R]
3198 Set the color components of the current drawing color, using various
3199 color schemes.
3201 .B md
3202 resets the drawing color to the default value.
3204 The arguments are integers in the range 0 to 65536.
3208 .B x
3209 device control command has been extended.
3212 .Text \f[B]x u \f[I]n\f[R]
3214 .I n
3215 is\~1, start underlining of spaces.
3218 .I n
3219 is\~0, stop underlining of spaces.
3221 This is needed for the
3222 .B cu
3223 request in nroff mode and is ignored otherwise.
3226 .\" --------------------------------------------------------------------
3227 .SS "Drawing Commands"
3228 .\" --------------------------------------------------------------------
3231 .B D
3232 drawing command has been extended.
3234 These extensions will not be used by GNU pic if the
3235 .B \-n
3236 option is given.
3239 .Text \f[B]Df \f[I]n\f[R]\*[ic]\[rs]n
3240 Set the shade of gray to be used for filling solid objects to
3241 .IR n ;
3242 .I n
3243 must be an integer between 0 and 1000, where 0 corresponds solid white
3244 and 1000 to solid black, and values in between correspond to
3245 intermediate shades of gray.
3247 This applies only to solid circles, solid ellipses and solid
3248 polygons.
3250 By default, a level of 1000 will be used.
3252 Whatever color a solid object has, it should completely obscure
3253 everything beneath it.
3255 A value greater than 1000 or less than 0 can also be used: this means
3256 fill with the shade of gray that is currently being used for lines and
3257 text.
3259 Normally this will be black, but some drivers may provide a way of
3260 changing this.
3263 The corresponding
3264 .BI \[rs]D'f .\|.\|. '
3265 command shouldn't be used since its argument is always rounded to an
3266 integer multiple of the horizontal resolution which can lead to
3267 surprising results.
3270 .Text \f[B]DC \f[I]d\f[R]\*[ic]\[rs]n
3271 Draw a solid circle with a diameter of
3272 .I d
3273 with the leftmost point at the current position.
3276 .Text \f[B]DE \f[I]dx dy\f[R]\*[ic]\[rs]n
3277 Draw a solid ellipse with a horizontal diameter of
3278 .I dx
3279 and a vertical diameter of
3280 .I dy
3281 with the leftmost point at the current position.
3283 delim $$
3287 .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
3288 Draw a polygon with, for $i = 1 ,..., n+1$, the
3289 .IR i -th
3290 vertex at the current position 
3292 $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$.
3294 At the moment, GNU pic only uses this command to generate triangles
3295 and rectangles.
3298 .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
3300 Like
3301 .B Dp
3302 but draw a solid rather than outlined polygon.
3305 .Text \f[B]Dt \f[I]n\f[R]\*[ic]\[rs]n
3306 Set the current line thickness to
3307 .I n
3308 machine units.
3310 Traditionally Unix troff drivers use a line thickness proportional to
3311 the current point size; drivers should continue to do this if no
3312 .B Dt
3313 command has been given, or if a
3314 .B Dt
3315 command has been given with a negative value of
3316 .IR n .
3317 A zero value of
3318 .I n
3319 selects the smallest available line thickness.
3322 A difficulty arises in how the current position should be changed after
3323 the execution of these commands.
3325 This is not of great importance since the code generated by GNU pic
3326 does not depend on this.
3328 Given a drawing command of the form
3330 \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]
3333 where
3334 .I c
3335 is not one of
3336 .BR c ,
3337 .BR e ,
3338 .BR l ,
3339 .BR a ,
3341 .BR ~ ,
3342 Unix troff will treat each of the $x sub i$ as a horizontal quantity,
3343 and each of the $y sub i$ as a vertical quantity and will assume that
3344 the width of the drawn object is $sum from i=1 to n x sub i$,
3345 and that the height is $sum from i=1 to n y sub i$.
3347 (The assumption about the height can be seen by examining the
3348 .B st
3350 .B sb
3351 registers after using such a
3352 .B D
3353 command in a \[rs]w escape sequence).
3355 This rule also holds for all the original drawing commands with the
3356 exception of
3357 .BR De .
3358 For the sake of compatibility GNU troff also follows this rule, even
3359 though it produces an ugly result in the case of the
3360 .B Dt
3362 .BR Df ,
3363 and, to a lesser extent,
3364 .B DE
3365 commands.
3367 Thus after executing a
3368 .B D
3369 command of the form
3371 \f[B]D\f[I]c\f[R] $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ \c
3372 $x sub n$ $y sub n$\[rs]n
3375 the current position should be increased by
3377 $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
3380 Another set of extensions is
3383 .Text \f[B]DFc \f[I]cyan magenta yellow\f[R]\*[ic]\[rs]n
3385 .Text \f[B]DFd\f[R]\*[ic]\[rs]n
3387 .Text \f[B]DFg \f[I]gray\f[R]\*[ic]\[rs]n
3389 .Text \f[B]DFk \f[I]cyan magenta yellow black\f[R]\*[ic]\[rs]n
3391 .Text \f[B]DFr \f[I]red green blue\f[R]\*[ic]\[rs]n
3392 Set the color components of the filling color similar to the
3393 .B m
3394 commands above.
3397 The current position isn't changed by those colour commands (contrary to
3398 .BR Df ).
3401 .\" --------------------------------------------------------------------
3402 .SS "Device Control Commands"
3403 .\" --------------------------------------------------------------------
3405 There is a continuation convention which permits the argument to the
3406 .B x\ X
3407 command to contain newlines: when outputting the argument to the
3408 .B x\ X
3409 command, GNU troff will follow each newline in the argument with a
3410 .B +
3411 character (as usual, it will terminate the entire argument with a
3412 newline); thus if the line after the line containing the
3413 .B x\ X
3414 command starts with
3415 .BR + ,
3416 then the newline ending the line containing the
3417 .B x\ X
3418 command should be treated as part of the argument to the
3419 .B x\ X
3420 command, the
3421 .B +
3422 should be ignored, and the part of the line following the
3423 .B +
3424 should be treated like the part of the line following the
3425 .B x\ X
3426 command.
3429 The first three output commands are guaranteed to be:
3431 .BI x\ T\  device
3433 .BI x\ res\  n\ h\ v
3435 .B x init
3438 .\" --------------------------------------------------------------------
3439 .SH INCOMPATIBILITIES
3440 .\" --------------------------------------------------------------------
3442 In spite of the many extensions, groff has retained compatibility to
3443 classical troff to a large degree.
3445 For the cases where the extensions lead to collisions, a special
3446 compatibility mode with the restricted, old functionality was created
3447 for groff.
3450 .\" --------------------------------------------------------------------
3451 .SS "Groff Language"
3452 .\" --------------------------------------------------------------------
3454 .I groff
3455 provides a
3456 .B compatibility mode
3457 that allows to process roff code written for classical
3458 .troff
3459 or for other implementations of roff in a consistent way.
3462 Compatibility mode can be turned on with the
3463 .option \-C
3464 command line option, and turned on or off with the
3465 .request .cp
3466 request.
3468 The number register
3469 .esc n(.C
3470 is\~1 if compatibility mode is on, 0\~otherwise.
3473 This became necessary because the GNU concept for long names causes
3474 some incompatibilities.
3475 .I Classical troff
3476 interprets
3478 .request .dsabcd
3481 as defining a string
3482 .B ab
3483 with contents
3484 .BR cd .
3486 .IR groff
3487 mode, this will be considered as a call of a macro named
3488 .request dsabcd .
3491 Also
3492 .I classical troff
3493 interprets
3494 .esc *[
3496 .esc n[
3497 as references to a string or number register called
3498 .request [
3499 while
3500 .I groff
3501 takes this as the start of a long name.
3505 .IR "compatibility mode" ,
3506 groff interprets these things in the traditional way; so long
3507 names are not recognized.
3510 On the other hand, groff in
3511 .I GNU native mode
3512 does not allow to use the single-character escapes
3513 .esc \[rs]
3514 (backslash),
3515 .esc |
3516 (vertical bar),
3517 .esc ^
3518 (caret),
3519 .esc &
3520 (ampersand),
3521 .esc {
3522 (opening brace),
3523 .esc }
3524 (closing brace),
3525 .squoted "\[rs]\ "
3526 (space),
3527 .esc '
3528 (single quote),
3529 .esc `
3530 (backquote),
3531 .esc \-
3532 (minus),
3533 .esc _
3534 (underline),
3535 .esc !
3536 (bang),
3537 .esc %
3538 (percent),
3540 .esc c
3541 (character c) in names of strings, macros, diversions, number
3542 registers, fonts or environments, whereas
3543 .I classical troff
3544 does.
3548 .esc A
3549 escape sequence can be helpful in avoiding these escape sequences in
3550 names.
3553 Fractional pointsizes cause one noteworthy incompatibility.
3556 .I classical
3557 .IR troff ,
3559 .request ps
3560 request ignores scale indicators and so
3563 .B .ps\~10u
3567 will set the pointsize to 10\~points, whereas in groff native mode the
3568 pointsize will be set to 10\~scaled points.
3572 .IR groff ,
3573 there is a fundamental difference between unformatted input
3574 characters, and formatted output characters (glyphs).
3576 Everything that affects how a glyph will be output is
3577 stored with the glyph; once a glyph has been
3578 constructed it is unaffected by any subsequent requests that are
3579 executed, including the
3580 .request bd ,
3581 .request cs ,
3582 .request tkf ,
3583 .request tr ,
3585 .request fp
3586 requests.
3589 Normally glyphs are constructed from input characters at
3590 the moment immediately before the glyph is added to the current
3591 output line.
3593 Macros, diversions and strings are all, in fact, the same type of
3594 object; they contain lists of input characters and glyphs
3595 in any combination.
3598 Special characters can be both; before being added to the output, they
3599 act as input entities, afterwards they denote glyphs.
3602 A glyph does not behave like an input character for the
3603 purposes of macro processing; it does not inherit any of the special
3604 properties that the input character from which it was constructed
3605 might have had.
3607 The following example will make things clearer.
3612 .ft CB
3613 .Text .di x
3614 .Text \[rs]\[rs]\[rs]\[rs]
3615 .Text .br
3616 .Text .di
3617 .Text .x
3623 With
3624 .I GNU troff
3625 this will be printed as
3626 .esc \[rs] .
3627 So each pair of input backslashes
3628 .squoted \[rs]\[rs]
3629 is turned into a single output backslash glyph
3630 .squoted \[rs]
3631 and the resulting output backslashes are not interpreted as escape
3632 characters when they are reread.
3635 .I Classical troff
3636 would interpret them as escape characters when they were reread and
3637 would end up printing a single backslash
3638 .squoted \[rs] .
3641 In GNU, the correct way to get a printable version of the backslash
3642 character
3643 .squoted \[rs]
3644 is the
3645 .esc (rs
3646 escape sequence, but classical troff does not provide a clean feature
3647 for getting a non-syntactical backslash.
3649 A close method is the printable version of the current escape
3650 character using the
3651 .esc e
3652 escape sequence; this works if the current escape character is not
3653 redefined.
3655 It works in both GNU mode and compatibility mode, while dirty tricks
3656 like specifying a sequence of multiple backslashes do not work
3657 reliably; for the different handling in diversions, macro definitions,
3658 or text mode quickly leads to a confusion about the necessary number of
3659 backslashes.
3662 To store an escape sequence in a diversion that will be interpreted
3663 when the diversion is reread, either the traditional
3664 .esc !
3665 transparent output facility or the
3667 .esc ?
3668 escape sequence can be used.
3671 .\" --------------------------------------------------------------------
3672 .SS "Intermediate Output"
3673 .\" --------------------------------------------------------------------
3675 The groff intermediate output format is in a state of evolution.
3677 So far it has some incompatibilities, but it is intended to establish
3678 a full compatibility to the classical troff output format.
3680 Actually the following incompatibilities exist:
3682 .Topic
3683 The positioning after the drawing of the polygons conflicts with the
3684 classical definition.
3686 .Topic
3687 The intermediate output cannot be rescaled to other devices as
3688 classical "device-independent" troff did.
3691 .\" --------------------------------------------------------------------
3692 .SH AUTHORS
3693 .\" --------------------------------------------------------------------
3695 Copyright (C) 1989, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
3698 This document is distributed under the terms of the FDL (GNU Free
3699 Documentation License) version 1.1 or later.
3701 You should have received a copy of the FDL on your system, it is also
3702 available on-line at the
3703 .URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
3705 This document was written by James Clark, with modifications by
3706 .MTO wl@gnu.org "Werner Lemberg"
3708 .MTO bwarken@mayn.de "Bernd Warken" .
3711 This document is part of
3712 .IR groff ,
3713 the GNU roff distribution.
3715 Formerly, the contents of this document was kept in the manual
3716 page
3717 .BR @g@troff (@MAN1EXT@).
3718 Only the parts dealing with the language aspects of the different
3719 .I roff
3720 systems were carried over into this document.
3723 .I troff
3724 command line options and warnings are still documented in
3725 .BR @g@troff (@MAN1EXT@).
3727 .\" --------------------------------------------------------------------
3728 .SH "SEE ALSO"
3729 .\" --------------------------------------------------------------------
3732 .I groff info
3733 .IR file ,
3734 cf.\&
3735 .BR info (1)
3736 presents all groff documentation within a single document.
3739 .BR groff (@MAN1EXT@)
3740 A list of all documentation around
3741 .IR groff .
3744 .BR groff (@MAN7EXT@)
3745 A description of the
3746 .I groff
3747 language, including a short, but complete reference of all predefined
3748 requests, registers, and escapes of plain
3749 .IR groff .
3750 From the command line, this is called using
3753 .ShellCommand man\~7\~groff
3756 .BR roff (@MAN7EXT@)
3757 A survey of
3758 .I roff
3759 systems, including pointers to further historical documentation.
3762 .RI [ CSTR\~#54\/ ]
3764 .I Nroff/\:Troff User's Manual
3766 .I J.\& F.\& Osanna
3767 of 1976 in the revision of
3768 .I Brian Kernighan
3769 of 1992, being the
3770 .URL http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz \
3771      "classical troff documentation" .
3773 .cp \n[groff_diff_C]
3775 .\" --------------------------------------------------------------------
3776 .\" Emacs variables
3777 .\" --------------------------------------------------------------------
3779 .\" Local Variables:
3780 .\" mode: nroff
3781 .\" End: