s/2006/2007/.
[s-roff.git] / man / groff_diff.man
blobe3e95c65264db584fa86948ad7aa5ec1b4a0347d
1 '\" e
2 .\" The above line should force the use of eqn as a preprocessor
3 .ig
4 groff_diff.man
6 Last update : 26 Oct 2006
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, 2006
12   Free Software Foundation, Inc.
13 written by James Clark
15 modified by Werner Lemberg <wl@gnu.org>
16             Bernd Warken <bwarken@mayn.de>
18 Permission is granted to copy, distribute and/or modify this document
19 under the terms of the GNU Free Documentation License, Version 1.1 or
20 any later version published by the Free Software Foundation; with the
21 Invariant Sections being this .ig-section and AUTHORS, with no
22 Front-Cover Texts, and with no Back-Cover Texts.
24 A copy of the Free Documentation License is included as a file called
25 FDL in the main directory of the groff source package.
28 .\" --------------------------------------------------------------------
29 .\" Setup
30 .\" --------------------------------------------------------------------
32 .do nr groff_diff_C \n[.C]
33 .cp 0
35 .mso www.tmac
37 .if n \{\
38 .  mso tty-char.tmac
39 .  ftr CR R
40 .  ftr CI I
41 .  ftr CB B
42 .\}
44 .if '\*[.T]'dvi' \
45 .  ftr CB CW
47 .\" define a string tx for the TeX logo
48 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
49 .el   .ds tx TeX
52 .\" --------------------------------------------------------------------
53 .\" start of macro definitions
55 .eo
57 .de c
60 .de TQ
61 .  br
62 .  ns
63 .  TP \$1
65 .de Text
66 .  RI "\$*"
68 .de Topic
69 .  TP 2m
70 .  Text \[bu]
72 .de squoted
73 .  ds @arg1 \$1
74 .  shift
75 .\"  Text \[oq]\f[CB]\*[@arg1]\f[]\[cq]\$*
76 .  Text \[oq]\f[B]\*[@arg1]\f[]\[cq]\$*
77 .  rm @arg1
79 .c A shell command line
80 .de ShellCommand
81 .  br
82 .  IR "shell#" "\h'1m'\f[CB]\$*\f[]\/"
84 .c reference of a request or macro
85 .de request
86 .  ds @arg1 \$1
87 .  shift 1
88 .\"  Text \f[CB]\*[@arg1]\f[]\$*
89 .  Text \f[B]\*[@arg1]\f[]\$*
90 .  rm @arg1
92 .als option request
94 .c representation of an escape sequence
95 .de esc
96 .  ds @arg1 \$1
97 .  shift
98 .\"  Text \f[CB]\[rs]\*[@arg1]\f[]\$*
99 .  Text \f[B]\[rs]\*[@arg1]\&\f[]\$*
100 .  rm @arg1
103 .\" end of macro definitions
105 .\" from old groff_out.man
106 .ie \n(.g \
107 .  ds ic \/
108 .el \
109 .  ds ic \^
112 .\" --------------------------------------------------------------------
113 .\" Title
114 .\" --------------------------------------------------------------------
116 .TH GROFF_DIFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
117 .SH NAME
118 groff_diff \- differences between GNU troff and classical troff
121 .\" --------------------------------------------------------------------
122 .SH DESCRIPTION
123 .\" --------------------------------------------------------------------
125 This manual page describes the language differences between
126 .IR groff ,
127 the GNU
128 .I roff
129 text processing system and the classical
130 .I roff
131 formatter of the freely available Unix\~7 of the 1970s, documented in
133 .I Troff User's Manual
135 .I Osanna
137 .IR Kernighan .
138 This inludes the roff language as well as the intermediate output
139 format (troff output).
142 The section
143 .I SEE ALSO
144 gives pointers to both the classical
145 .I roff
146 and the modern
147 .I groff
148 documentation.
151 .\" --------------------------------------------------------------------
152 .SH "GROFF LANGUAGE"
153 .\" --------------------------------------------------------------------
155 In this section, all additional features of
156 .I groff
157 compared to the classical Unix\~7
158 .I troff
159 are described in detail.
162 .\" --------------------------------------------------------------------
163 .SS "Long names"
164 .\" --------------------------------------------------------------------
166 The names of number registers, fonts, strings/\:macros/\:diversions,
167 special characters (glyphs), and colors can be of any length.
169 In escape sequences, additionally to the classical
170 .BI ( xx
171 construction for a two-character name, you can use
172 .BI [ xxx ]
173 for a name of arbitrary length.
176 .BI \[rs][ xxx ]
177 Print the special character (glyph) called
178 .IR xxx .
181 .BI \[rs][ "comp1 comp2 .\|.\|." ]
182 Print composite glyph consisting of multiple components.
184 Example: `\[rs][A\~ho]' is capital letter A with ogonek which finally maps
185 to glyph name `u0041_0328'.
187 See the
188 .I groff info file
189 for details how a glyph name for a composite glyph is constructed, and
190 .BR groff_char (@MAN7EXT@)
191 for list of glyph name components used composite glyph names.
194 .BI \[rs]f[ xxx ]
195 Set font
196 .IR xxx .
198 Additionally,
199 .B \[rs]f[]
200 is a new syntax equal to
201 .BR \[rs]fP ,
202 i.e., to return to the previous font.
205 .BI \[rs]*[ "xxx arg1 arg2 .\|.\|." ]
206 Interpolate string
207 .IR xxx ,
208 taking
209 .IR arg1 ,
210 .IR arg2 ,
211 .I .\|.\|.\&
212 as arguments.
215 .BI \[rs]n[ xxx ]
216 Interpolate number register
217 .IR xxx .
220 .\" --------------------------------------------------------------------
221 .SS "Fractional pointsizes"
222 .\" --------------------------------------------------------------------
225 .I scaled point
226 is equal to
227 .B 1/sizescale
228 points, where
229 .B sizescale
230 is specified in the
231 .B DESC
232 file (1 by default).
234 There is a new scale indicator
235 .B z
236 that has the effect of multiplying by sizescale.
238 Requests and escape sequences in troff interpret arguments that
239 represent a pointsize as being in units of scaled points, but they
240 evaluate each such argument using a default scale indicator of
241 .BR z .
242 Arguments treated in this way are the argument to the
243 .B ps
244 request, the third argument to the
245 .B cs
246 request, the second and fourth arguments to the
247 .B tkf
248 request, the argument to the
249 .B \[rs]H
250 escape sequence, and those variants of the
251 .B \[rs]s
252 escape sequence that take a numeric expression as their argument.
255 For example, suppose sizescale is 1000; then a scaled point is
256 equivalent to a millipoint; the call
257 .B .ps\ 10.25
258 is equivalent to
259 .B .ps\ 10.25z
260 and so sets the pointsize to 10250 scaled points, which is equal to
261 10.25 points.
264 The number register
265 .B \[rs]n[.s]
266 returns the pointsize in points as decimal fraction.
268 There is also a new number register
269 .B \[rs]n[.ps]
270 that returns the pointsize in scaled points.
273 It would make no sense to use the
274 .B z
275 scale indicator in a numeric expression whose default scale indicator
276 was neither
277 .B u
279 .BR z ,
280 and so
281 .B troff
282 disallows this.
284 Similarly it would make no sense to use a scaling indicator other than
285 .B z
287 .B u
288 in a numeric expression whose default scale indicator was
289 .BR z ,
290 and so
291 .B troff
292 disallows this as well.
295 There is also new scale indicator\~\c
296 .B s
297 which multiplies by the number of units in a scaled point.
299 So, for example,
300 .B \[rs]n[.ps]s
301 is equal to
302 .BR 1m .
303 Be sure not to confuse the
304 .B s
306 .B z
307 scale indicators.
310 .\" --------------------------------------------------------------------
311 .SS "Numeric expressions"
312 .\" --------------------------------------------------------------------
314 Spaces are permitted in a number expression within parentheses.
317 .B M
318 indicates a scale of 100ths of an em.
319 .B f
320 indicates a scale of 65536 units, providing fractions for color
321 definitions with the
322 .B defcolor
323 request.
325 For example, 0.5f = 32768u.
328 .IB e1 >? e2
329 The maximum of
330 .I e1
332 .IR e2 .
335 .IB e1 <? e2
336 The minimum of
337 .I e1
339 .IR e2 .
342 .BI ( c ; e )
343 Evaluate
344 .I e
345 using
346 .I c
347 as the default scaling indicator.
350 .I c
351 is missing, ignore scaling indicators in the evaluation of
352 .IR e .
355 .\" --------------------------------------------------------------------
356 .SS "New escape sequences"
357 .\" --------------------------------------------------------------------
360 .BI \[rs]A' anything '
361 This expands to
362 .B 1
364 .B 0
365 resp., depending on whether
366 .I anything
367 is or is not acceptable as the name of a string, macro, diversion, number
368 register, environment, font, or color.
369 It returns\~\c
370 .B 0
372 .I anything
373 is empty.
375 This is useful if you want to lookup user input in some sort of
376 associative table.
379 .BI \[rs]B' anything '
380 This expands to
381 .B 1
383 .B 0
384 resp., depending on whether
385 .I anything
386 is or is not a valid numeric expression.
388 It returns\~\c
389 .B 0
391 .I anything
392 is empty.
395 .BI \[rs]C' xxx '
396 Typeset glyph named
397 .IR xxx .
398 Normally it is more convenient to use
399 .BI \[rs][ xxx ]\f[R].
401 .B \[rs]C
402 has the advantage that it is compatible with recent versions of
403 .SM UNIX
404 and is available in compatibility mode.
407 .B \[rs]E
408 This is equivalent to an escape character, but it is not interpreted in
409 copy-mode.
411 For example, strings to start and end superscripting could be defined
412 like this
416 .ft CB
417 .Text .ds { \[rs]v'\-.3m'\[rs]s'\[rs]En[.s]*6u/10u'
419 .Text .ds } \[rs]s0\[rs]v'.3m'
423 The use of
424 .B \[rs]E
425 ensures that these definitions work even if
426 .B \[rs]*{
427 gets interpreted in copy-mode (for example, by being used in a macro
428 argument).
432 .BI \[rs]F f
434 .BI \[rs]F( fm
436 .BI \[rs]F[ fam ]
437 Change font family.
439 This is the same as the
440 .B fam
441 request.
443 .B \[rs]F[]
444 switches back to the previous color (note that
445 .B \[rs]FP
446 won't work; it selects font family `P' instead).
449 .BI \[rs]m x
451 .BI \[rs]m( xx
453 .BI \[rs]m[ xxx ]
454 Set drawing color.
455 .B \[rs]m[]
456 switches back to the previous color.
459 .BI \[rs]M x
461 .BI \[rs]M( xx
463 .BI \[rs]M[ xxx ]
464 Set background color for filled objects drawn with the
465 .BI \[rs]D' .\|.\|. '
466 commands.
467 .B \[rs]M[]
468 switches back to the previous color.
471 .BI \[rs]N' n '
472 Typeset the glyph with index
473 .I n
474 in the current font.
475 .I n
476 can be any integer.
478 Most devices only have glyphs with indices between 0 and 255.
480 If the current font does not contain a glyph with that code,
481 special fonts are
482 .I not
483 searched.
486 .B \[rs]N
487 escape sequence can be conveniently used in conjunction with the
488 .B char
489 request, for example
492 .ft CB
494 .Text .char \[rs][phone] \[rs]f(ZD\[rs]N'37'
499 The index of each glyph is given in the fourth column in the font
500 description file after the
501 .B charset
502 command.
504 It is possible to include unnamed glyphs in the font description
505 file by using a name of
506 .BR \-\-\- ;
508 .B \[rs]N
509 escape sequence is the only way to use these.
512 .BI \[rs]O n
514 .BI \[rs]O[ n ]
515 Suppressing troff output.
517 The escapes
518 .BR \[rs]02 ,
519 .BR \[rs]O3 ,
520 .BR \[rs]O4 ,
522 .B \[rs]O5
523 are intended for internal use by
524 .BR \%grohtml .
528 .B \[rs]O0
529 Disable any ditroff glyphs from being emitted to the device driver,
530 provided that the escape occurs at the outer level (see
531 .B \[rs]O3
533 .BR \[rs]O4 ).
536 .B \[rs]O1
537 Enable output of glyphs, provided that the escape occurs at the outer
538 level.
540 .B \[rs]O0
542 .B \[rs]O1
543 also reset the registers
544 .BR \[rs]n[opminx] ,
545 .BR \[rs]n[opminy] ,
546 .BR \[rs]n[opmaxx] ,
548 .B \[rs]n[opmaxy]
549 to\~-1.
551 These four registers mark the top left and bottom right hand corners
552 of a box which encompasses all written glyphs.
555 .B \[rs]O2
556 Provided that the escape occurs at the outer level, enable output of
557 glyphs and also write out to stderr the page number and four registers
558 encompassing the glyphs previously written since the last call to
559 .BR \[rs]O .
562 .B \[rs]O3
563 Begin a nesting level.
565 At start-up,
566 .B troff
567 is at outer level.
569 This is really an internal mechanism for
570 .B \%grohtml
571 while producing images.
573 They are generated by running the troff source through
574 .B troff
575 to the postscript device and
576 .B ghostscript
577 to produce images in PNG format.
580 .B \[rs]O3
581 escape starts a new page if the device is not html (to reduce the
582 possibility of images crossing a page boundary).
585 .B \[rs]O4
586 End a nesting level.
589 .BI \[rs]O5[ Pfilename ]
590 This escape is
591 .B \%grohtml
592 specific.
594 Provided that this escape occurs at the outer nesting level, write
595 .I filename
596 to stderr.
598 The position of the image,
599 .IR P ,
600 must be specified and must be one of l, r, c, or i (left, right,
601 centered, inline).
603 .I filename
604 is associated with the production of the next inline image.
608 .BI \[rs]R' name\ \[+-]n '
609 This has the same effect as
613 .BI .nr\  name\ \[+-]n
617 .BI \[rs]s( nn
619 .BI \[rs]s\[+-]( nn
620 Set the point size to
621 .I nn
622 points;
623 .I nn
624 must be exactly two digits.
627 .BI \[rs]s[\[+-] n ]
629 .BI \[rs]s\[+-][ n ]
631 .BI \[rs]s'\[+-] n '
633 .BI \[rs]s\[+-]' n '
634 Set the point size to
635 .I n
636 scaled points;
637 .I n
638 is a numeric expression with a default scale indicator of\~\c
639 .BR z .
642 .BI \[rs]V x
644 .BI \[rs]V( xx
646 .BI \[rs]V[ xxx ]
647 Interpolate the contents of the environment variable
648 .IR xxx ,
649 as returned by
650 .BR getenv (3).
651 .B \[rs]V
652 is interpreted in copy-mode.
655 .BI \[rs]Y x
657 .BI \[rs]Y( xx
659 .BI \[rs]Y[ xxx ]
660 This is approximately equivalent to
661 .BI \[rs]X'\[rs]*[ xxx ]'\f[R].
662 However the contents of the string or macro
663 .I xxx
664 are not interpreted; also it is permitted for
665 .I xxx
666 to have been defined as a macro and thus contain newlines (it is not
667 permitted for the argument to
668 .B \[rs]X
669 to contain newlines).
671 The inclusion of newlines requires an extension to the UNIX troff
672 output format, and confuses drivers that do not know about this
673 extension.
676 .BI \[rs]Z' anything '
677 Print anything and then restore the horizontal and vertical position;
678 .I anything
679 may not contain tabs or leaders.
682 .B \[rs]$0
683 The name by which the current macro was invoked.
686 .B als
687 request can make a macro have more than one name.
690 .B \[rs]$*
691 In a macro or string, the concatenation of all the arguments separated
692 by spaces.
695 .B \[rs]$@
696 In a macro or string, the concatenation of all the arguments with each
697 surrounded by double quotes, and separated by spaces.
700 .B \[rs]$^
701 In a macro, the representation of all parameters as if they were an
702 argument to the
703 .B ds
704 request.
707 .BI \[rs]$( nn
709 .BI \[rs]$[ nnn ]
710 In a macro or string, this gives the
711 .IR nn -th
713 .IR nnn -th
714 argument.
716 Macros and strings can have an unlimited number of arguments.
719 .BI \[rs]? anything \[rs]?
720 When used in a diversion, this transparently embeds
721 .I anything
722 in the diversion.
723 .I anything
724 is read in copy mode.
726 When the diversion is reread,
727 .I anything
728 is interpreted.
729 .I anything
730 may not contain newlines; use
731 .B \[rs]!\&
732 if you want to embed newlines in a diversion.
734 The escape sequence
735 .B \[rs]?\&
736 is also recognised in copy mode and turned into a single internal
737 code; it is this code that terminates
738 .IR anything .
739 Thus
743 .ne 14v+\n(.Vu
744 .ft CB
746 .Text .nr x 1
747 .Text .nf
748 .Text .di d
749 .Text \[rs]?\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\c
750 .Text \[rs]nx\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]?\[rs]?
751 .Text .di
752 .Text .nr x 2
753 .Text .di e
754 .Text .d
755 .Text .di
756 .Text .nr x 3
757 .Text .di f
758 .Text .e
759 .Text .di
760 .Text .nr x 4
761 .Text .f
767 prints\~\c
768 .BR 4 .
771 .B \[rs]/
772 This increases the width of the preceding glyph so that the
773 spacing between that glyph and the following glyph is
774 correct if the following glyph is a roman glyph.
776 .if t \{\
777 .  nop For example, if an italic f is immediately followed by a roman
778 .  nop right parenthesis, then in many fonts the top right portion of
779 .  nop the f overlaps the top left of the right parenthesis
780 .  nop producing \f[I]f\f[R])\f[R], which is ugly.
781 .  nop Inserting
782 .  B \[rs]/
783 .  nop produces
784 .  ie \n(.g \f[I]f\/\f[R])\f[R]
785 .  el       \f[I]f\|\f[R])\f[R]
786 .  nop and avoids this problem.
788 It is a good idea to use this escape sequence whenever an italic
789 glyph is immediately followed by a roman glyph without any
790 intervening space.
793 .B \[rs],
794 This modifies the spacing of the following glyph so that the
795 spacing between that glyph and the preceding glyph is
796 correct if the preceding glyph is a roman glyph.
798 .if t \{\
799 .  nop For example, inserting
800 .  B \[rs],
801 .  nop between the parenthesis and the f changes
802 .  nop \f[R](\f[I]f\f[R] to
803 .  ie \n(.g \f[R](\,\f[I]f\f[R].
804 .  el       \f[R](\^\f[I]f\f[R].
806 It is a good idea to use this escape sequence whenever a roman
807 glyph is immediately followed by an italic glyph without any
808 intervening space.
811 .B \[rs])
812 Like
813 .B \[rs]&
814 except that it behaves like a character declared with the
815 .B cflags
816 request to be transparent for the purposes of end-of-sentence
817 recognition.
820 .B \[rs]~
821 This produces an unbreakable space that stretches like a normal
822 inter-word space when a line is adjusted.
825 .B \[rs]:
826 This causes the insertion of a zero-width break point.
828 It is equal to
829 .B \[rs]%
830 within a word but without insertion of a soft hyphen character.
833 .B \[rs]#
834 Everything up to and including the next newline is ignored.
836 This is interpreted in copy mode.
838 It is like
839 .B \[rs]"
840 except that
841 .B \[rs]"
842 does not ignore the terminating newline.
845 .\" --------------------------------------------------------------------
846 .SS "New requests"
847 .\" --------------------------------------------------------------------
850 .BI .aln\  xx\ yy
851 Create an alias
852 .I xx
853 for number register object named
854 .IR yy .
855 The new name and the old name are exactly equivalent.
858 .I yy
859 is undefined, a warning of type
860 .B reg
861 is generated, and the request is ignored.
864 .BI .als\  xx\ yy
865 Create an alias
866 .I xx
867 for request, string, macro, or diversion object named
868 .IR yy .
870 The new name and the old name are exactly equivalent (it is
871 similar to a hard rather than a soft link).
874 .I yy
875 is undefined, a warning of type
876 .B mac
877 is generated, and the request is ignored.
880 .BR de ,
881 .BR am ,
882 .BR di ,
883 .BR da ,
884 .BR ds ,
886 .B as
887 requests only create a new object if the name of the macro, diversion
888 or string diversion is currently undefined or if it is defined to be a
889 request; normally they modify the value of an existing object.
892 .BI .am1\  xx\ yy
893 Similar to
894 .BR .am , 
895 but compatibility mode is switched off during execution.
897 To be more precise, a `compatibility save' token is inserted at the
898 beginning of the macro addition, and a `compatibility restore' token at
899 the end.
901 As a consequence, the requests
902 .BR am ,
903 .BR am1 ,
904 .BR de ,
906 .B de1
907 can be intermixed freely since the compatibility save/\:restore tokens
908 only affect the macro parts defined by
909 .B .am1
911 .BR .ds1 .
914 .BI .ami\  xx\ yy
915 Append to macro indirectly.
917 See the
918 .B dei
919 request below for more information.
922 .BI .ami1\  xx\ yy
923 Same as the
924 .B ami
925 request but compatibility mode is switched off during execution.
928 .BI .as1\  xx\ yy
929 Similar to
930 .BR .as , 
931 but compatibility mode is switched off during expansion.
933 To be more precise, a `compatibility save' token is inserted at the
934 beginning of the string, and a `compatibility restore' token at the end.
936 As a consequence, the requests
937 .BR as ,
938 .BR as1 ,
939 .BR ds ,
941 .B ds1
942 can be intermixed freely since the compatibility save/\:restore tokens
943 only affect the (sub)strings defined by
944 .B as1
946 .BR ds1 .
949 .BI .asciify\  xx
950 This request `unformats' the diversion
951 .I xx
952 in such a way that
953 .SM ASCII
954 and space characters (and some escape sequences) that were formatted
955 and diverted into
956 .I xx
957 are treated like ordinary input characters when
958 .I xx
959 is reread.
960 Useful for diversions in conjunction with the
961 .B .writem
962 request.
964 It can be also used for gross hacks; for example, this
968 .ne 7v+\n(.Vu
969 .ft CB
971 .Text .tr @.
972 .Text .di x
973 .Text @nr n 1
974 .Text .br
975 .Text .di
976 .Text .tr @@
977 .Text .asciify x
978 .Text .x
984 sets register\~\c
985 .B n
986 to\~1.
988 Note that glyph information (font, font size, etc.) is not preserved;
990 .B .unformat
991 instead.
994 .B .backtrace
995 Print a backtrace of the input stack on stderr.
998 .BI .blm\  xx
999 Set the blank line macro to
1000 .IR xx .
1001 If there is a blank line macro, it is invoked when a blank line
1002 is encountered instead of the usual troff behaviour.
1005 .BI .box\  xx
1007 .BI .boxa\  xx
1008 These requests are similar to the
1009 .B di
1011 .B da
1012 requests with the exception that a partially filled line does not
1013 become part of the diversion (i.e., the diversion always starts with a
1014 new line) but restored after ending the diversion, discarding the
1015 partially filled line which possibly comes from the diversion.
1018 .B .break
1019 Break out of a while loop.
1021 See also the
1022 .B while
1024 .B continue
1025 requests.
1027 Be sure not to confuse this with the
1028 .B br
1029 request.
1032 .B .brp
1033 This is the same as
1034 .BR \[rs]p .
1037 .BI .cflags\  n\ c1\ c2\|.\|.\|.\&
1038 Characters
1039 .IR c1 ,
1040 .IR c2 ,\|.\|.\|.\&
1041 have properties determined by
1042 .IR n ,
1043 which is ORed from the following:
1046 .IP 1
1047 The character ends sentences (initially characters
1048 .B .?!\&
1049 have this property).
1051 .IP 2
1052 Lines can be broken before the character (initially no characters have
1053 this property); a line is not broken at a character with this
1054 property unless the characters on each side both have non-zero
1055 hyphenation codes.
1056 This can be overridden with value 64.
1058 .IP 4
1059 Lines can be broken after the character (initially characters
1060 .B \-\[rs][hy]\[rs][em]
1061 have this property); a line is not broken at a character with
1062 this property unless the characters on each side both have non-zero
1063 hyphenation codes.
1064 This can be overridden with value 64.
1066 .IP 8
1067 The character overlaps horizontally (initially characters
1068 .B \[rs][ul]\[rs][rn]\[rs][ru]\[rs][radicalex]\[rs][sqrtex]
1069 have this property).
1071 .IP 16
1072 The character overlaps vertically (initially character
1073 .B \[rs][br]
1074 has this property).
1076 .IP 32
1077 An end-of-sentence character followed by any number of characters with
1078 this property is treated as the end of a sentence if followed by
1079 a newline or two spaces; in other words the character is transparent
1080 for the purposes of end-of-sentence recognition; this is the same as
1081 having a zero space factor in \*[tx] (initially characters
1082 .B \[dq]')]*\[rs](dg\[rs](rq
1083 have this property).
1085 .IP 64
1086 Ignore hyphenation code values of the surrounding characters.
1087 Use this in combination with values 2 and\~4 (initially no characters have
1088 this property).
1092 .BI .char\  c\ string
1093 Define glyph
1094 .I c
1095 to be
1096 .IR string .
1097 Every time glyph
1098 .I c
1099 needs to be printed,
1100 .I string
1101 is processed in a temporary environment and the result is
1102 wrapped up into a single object.
1104 Compatibility mode is turned off and the escape character is
1105 set to
1106 .B \[rs]
1107 while
1108 .I string
1109 is being processed.
1111 Any emboldening, constant spacing or track kerning is applied to
1112 this object rather than to individual glyphs in
1113 .IR string .
1116 A glyph defined by this request can be used just like a normal
1117 glyph provided by the output device.
1119 In particular other characters can be translated to it with the
1120 .B tr
1121 request; it can be made the leader character by the
1122 .B lc
1123 request; repeated patterns can be drawn with the character using the
1124 .B \[rs]l
1126 .B \[rs]L
1127 escape sequences; words containing the character can be hyphenated
1128 correctly, if the
1129 .B hcode
1130 request is used to give the character a hyphenation code.
1133 There is a special anti-recursion feature: Use of glyph within the
1134 glyph's definition is handled like normal glyphs not
1135 defined with
1136 .BR char .
1138 A glyph definition can be removed with the
1139 .B rchar
1140 request.
1143 .BI .chop\  xx
1144 Chop the last element off macro, string, or diversion
1145 .IR xx .
1146 This is useful for removing the newline from the end of diversions
1147 that are to be interpolated as strings.
1150 .BI .close\  stream
1151 Close the stream named
1152 .IR stream ;
1153 .I stream
1154 will no longer be an acceptable argument to the
1155 .B write
1156 request.
1158 See the
1159 .B open
1160 request.
1163 .BI .composite\  glyph1\ glyph2
1164 Map glyph name
1165 .I glyph1
1166 to glyph name
1167 .I glyph2
1168 if it is used in
1169 .BI \[rs][ ... ]
1170 with more than one component.
1173 .B .continue
1174 Finish the current iteration of a while loop.
1176 See also the
1177 .B while
1179 .B break
1180 requests.
1183 .BI .color\  n
1185 .I n
1186 is non-zero or missing, enable colors (this is the default), otherwise
1187 disable them.
1190 .BI .cp\  n
1192 .I n
1193 is non-zero or missing, enable compatibility mode, otherwise disable
1196 In compatibility mode, long names are not recognised, and the
1197 incompatibilities caused by long names do not arise.
1200 .BI .defcolor\  xxx\ scheme\ color_components
1201 Define color.
1202 .I scheme
1203 can be one of the following values:
1204 .B rgb
1205 (three components),
1206 .B cym
1207 (three components),
1208 .B cmyk
1209 (four components), and
1210 .B gray
1212 .B grey
1213 (one component).
1215 Color components can be given either as a hexadecimal string or as
1216 positive decimal integers in the range 0-65535.
1218 A hexadecimal string contains all color components concatenated; it
1219 must start with either
1220 .B #
1222 .BR ## .
1223 The former specifies hex values in the range 0-255 (which are
1224 internally multiplied by\~257), the latter in the range 0-65535.
1226 Examples: #FFC0CB (pink), ##ffff0000ffff (magenta).
1228 A new scaling indicator\~\c
1229 .B f
1230 has been introduced which multiplies its value by\~65536; this makes
1231 it convenient to specify color components as fractions in the range 0
1232 to\~1.
1234 Example:
1238 .ft CB
1239 .Text .defcolor darkgreen rgb 0.1f 0.5f 0.2f
1245 Note that
1246 .B f
1247 is the default scaling indicator for the
1248 .B defcolor
1249 request, thus the above statement is equivalent to
1253 .ft CB
1254 .Text .defcolor darkgreen rgb 0.1 0.5 0.2
1260 The color named
1261 .B default
1262 (which is device-specific) can't be redefined.
1264 It is possible that the default color for
1265 .esc M
1267 .esc m
1268 is not the same.
1271 .BI .de1\  xx\ yy
1272 Similar to
1273 .BR .de , 
1274 but compatibility mode is switched off during execution.
1276 On entry, the current compatibility mode is saved and restored at exit.
1279 .BI .dei\  xx\ yy
1280 Define macro indirectly.
1282 The following example
1286 .ne 2v+\n(.Vu
1287 .ft CB
1289 .Text .ds xx aa
1290 .Text .ds yy bb
1291 .Text .dei xx yy
1297 is equivalent to
1301 .ft CB
1302 .Text .de aa bb
1308 .BI .dei1\  xx\ yy
1309 Similar to the
1310 .B dei
1311 request but compatibility mode is switched off during execution.
1314 .BI .device\  anything
1315 This is (almost) the same as the
1316 .B \[rs]X
1317 escape.
1318 .I anything
1319 is read in copy mode; a leading\~\c
1320 .B \[dq]
1321 is stripped.
1324 .BI .devicem\  xx
1325 This is the same as the
1326 .B \[rs]Y
1327 escape (to embed the contents of a macro into the intermediate
1328 output preceded with `x\~X').
1331 .BI .do\  xxx
1332 Interpret
1333 .I .xxx
1334 with compatibility mode disabled.
1336 For example,
1341 .ft CB
1342 .Text .do fam T
1347 would have the same effect as
1350 .ft CB
1351 .Text .fam T
1356 except that it would work even if compatibility mode had been enabled.
1358 Note that the previous compatibility mode is restored before any files
1359 sourced by
1360 .I xxx
1361 are interpreted.
1366 .BI .ds1\  xx\ yy
1367 Similar to
1368 .BR .ds , 
1369 but compatibility mode is switched off during expansion.
1371 To be more precise, a `compatibility save' token is inserted at the
1372 beginning of the string, and a `compatibility restore' token at the end.
1375 .B .ecs
1376 Save current escape character.
1379 .B .ecr
1380 Restore escape character saved with
1381 .BR ecs .
1382 Without a previous call to
1383 .BR ecs ,
1384 .RB ` \[rs] '
1385 will be the new escape character.
1388 .BI .evc\  xx
1389 Copy the contents of environment
1390 .I xx
1391 to the current environment.
1393 No pushing or popping of environments is done.
1396 .BI .fam\  xx
1397 Set the current font family to
1398 .IR xx .
1399 The current font family is part of the current environment.
1401 .I xx
1402 is missing, switch back to previous font family.
1404 The value at start-up is `T'.
1406 See the description of the
1407 .B sty
1408 request for more information on font families.
1411 .BI .fchar\  c\ string
1412 Define fallback glyph
1413 .I c
1414 to be
1415 .IR string .
1417 The syntax of this request is the same as the
1418 .B char
1419 request; the only difference is that a glyph defined with
1420 .B char
1421 hides the glyph with the same name in the current font, whereas a
1422 glyph defined with
1423 .B fchar
1424 is checked only if the particular glyph isn't found in the current font.
1426 This test happens before checking special fonts.
1429 .BI .fcolor\  c
1430 Set the fill color to
1431 .IR c .
1433 .I c
1434 is missing,
1435 switch to the previous fill color.
1438 .BI .fschar\  f\ c\ string
1439 Define fallback glyph
1440 .I c
1441 for font
1442 .I f
1443 to be
1444 .IR string .
1446 The syntax of this request is the same as the
1447 .B char
1448 request (with an additional argument to specify the font); a glyph
1449 defined with
1450 .B fschar
1451 is searched after the list of fonts declared with the
1452 .B fspecial
1453 request but before the list of fonts declared with
1454 .BR special .
1457 .BI .fspecial\  f\ s1\ s2\|.\|.\|.\&
1458 When the current font is
1459 .IR f ,
1460 fonts
1461 .IR s1 ,
1462 .IR s2 ,\|.\|.\|.\&
1463 are special, that is, they are searched for glyphs not in
1464 the current font.
1466 Any fonts specified in the
1467 .B special
1468 request are searched after fonts specified in the
1469 .B fspecial
1470 request.
1472 Without argument, reset the list of global special fonts to be empty.
1475 .BI .ftr\  f\ g
1476 Translate font
1477 .I f
1479 .IR g .
1480 Whenever a font named
1481 .I f
1482 is referred to in an
1483 .B \[rs]f
1484 escape sequence, in the
1485 .B F
1487 .B S
1488 conditional operators, or in the
1489 .BR ft ,
1490 .BR ul ,
1491 .BR bd ,
1492 .BR cs ,
1493 .BR tkf ,
1494 .BR special ,
1495 .BR fspecial ,
1496 .BR fp ,
1498 .BR sty
1499 requests, font
1500 .I g
1501 is used.
1503 .I g
1504 is missing, or equal to
1505 .I f
1506 then font
1507 .I f
1508 is not translated.
1511 .BI .fzoom\  f\ zoom
1512 Set zoom factor
1513 .I zoom
1514 for font\~\c
1515 .IR f .
1516 .I zoom
1517 must a non-negative integer multiple of 1/1000th.
1518 If it is missing or is equal to zero, it means the same as 1000, namely no
1519 magnification.
1520 .I f\c
1521 \~must be a real font name, not a style.
1524 .BI .gcolor\  c
1525 Set the glyph color to
1526 .IR c .
1528 .I c
1529 is missing,
1530 switch to the previous glyph color.
1533 .BI .hcode \ c1\ code1\ c2\ code2\|.\|.\|.\&
1534 Set the hyphenation code of character
1535 .I c1
1537 .I code1
1538 and that of
1539 .I c2
1541 .IR code2 .
1542 A hyphenation code must be a single input character (not a special
1543 character) other than a digit or a space.
1545 Initially each lower-case letter \%a-z has a hyphenation code, which is
1546 itself, and each upper-case letter \%A-Z has a hyphenation code which is
1547 the lower-case version of itself.
1549 See also the
1550 .B hpf
1551 request.
1554 .BI .hla\  lang
1555 Set the current hyphenation language to
1556 .IR lang .
1557 Hyphenation exceptions specified with the
1558 .B hw
1559 request and hyphenation patterns specified with the
1560 .B hpf
1561 request are both associated with the current hyphenation language.
1564 .B hla
1565 request is usually invoked by the
1566 .B troffrc
1567 file.
1570 .BI .hlm\  n
1571 Set the maximum number of consecutive hyphenated lines to\~\c
1572 .IR n .
1574 .I n
1575 is negative, there is no maximum.
1577 The default value is\~\-1.
1579 This value is associated with the current environment.
1581 Only lines output from an environment count towards the maximum
1582 associated with that environment.
1584 Hyphens resulting from
1585 .B \[rs]%
1586 are counted; explicit hyphens are not.
1589 .BI .hpf\  file
1590 Read hyphenation patterns from
1591 .IR file ;
1592 this is searched for in the same way that
1593 .IB name .tmac
1594 is searched for when the
1595 .BI \-m name
1596 option is specified.
1598 It should have the same format as (simple) \*[tx] patterns files.
1600 More specifically, the following scanning rules are implemented.
1603 .IP \[bu]
1604 A percent sign starts a comment (up to the end of the line) even if
1605 preceded by a backslash.
1607 .IP \[bu]
1608 No support for `digraphs' like
1609 .BR \[rs]$ .
1611 .IP \[bu]
1612 .BI ^^ xx
1613 .RI ( x
1614 is 0-9 or a-f) and
1615 .BI ^^ x
1616 (character code of\~\c
1617 .I x
1618 in the range 0-127) are recognized; other use of
1619 .B ^
1620 causes an error.
1622 .IP \[bu]
1623 No macro expansion.
1625 .IP \[bu]
1626 .B hpf
1627 checks for the expression
1628 .B \[rs]patterns{.\|.\|.}
1629 (possibly with whitespace before and after the braces).
1631 Everything between the braces is taken as hyphenation patterns.
1633 Consequently,
1634 .B {
1636 .B }
1637 are not allowed in patterns.
1639 .IP \[bu]
1640 Similarly,
1641 .B \[rs]hyphenation{.\|.\|.}
1642 gives a list of hyphenation exceptions.
1644 .IP \[bu]
1645 .B \[rs]endinput
1646 is recognized also.
1648 .IP \[bu]
1649 For backwards compatibility, if
1650 .B \[rs]patterns
1651 is missing, the whole file is treated as a list of hyphenation patterns
1652 (only recognizing the
1653 .BR % \~\c
1654 character as the start of a comment).
1658 Use the
1659 .B hpfcode
1660 request to map the encoding used in hyphenation patterns files to
1661 .BR groff 's
1662 input encoding.
1664 The set of hyphenation patterns is associated with the current language
1665 set by the
1666 .B hla
1667 request.
1670 .B hpf
1671 request is usually invoked by the
1672 .B troffrc
1673 file; a second call replaces the old patterns with the new ones.
1676 .BI .hpfa\  file
1677 The same as
1678 .B hpf
1679 except that the hyphenation patterns from
1680 .I file
1681 are appended to the patterns already loaded in the current language.
1684 .BI .hpfcode\  a\ b\ c\ d\ .\|.\|.
1685 After reading a hyphenation patterns file with the
1686 .B hpf
1688 .B hpfa
1689 request, convert all characters with character code\~\c
1690 .I a
1691 in the recently read patterns to character code\~\c
1692 .IR b ,
1693 character code\~\c
1694 .I c
1695 to\~\c
1696 .IR d ,
1697 etc.
1699 Initially, all character codes map to themselves.
1701 The arguments of
1702 .B hpfcode
1703 must be integers in the range 0 to\~255.
1705 Note that it is even possible to use character codes which are invalid in
1706 .B groff
1707 otherwise.
1710 .BI .hym\  n
1711 Set the
1712 .I hyphenation margin
1713 to\~\c
1714 .IR n :
1715 when the current adjustment mode is not\~\c
1716 .BR b ,
1717 the line is not hyphenated if the line is no more than
1718 .I n
1719 short.
1721 The default hyphenation margin is\~0.
1723 The default scaling indicator for this request is\~\c
1724 .IR m .
1725 The hyphenation margin is associated with the current environment.
1727 The current hyphenation margin is available in the
1728 .B \[rs]n[.hym]
1729 register.
1732 .BI .hys\  n
1733 Set the
1734 .I hyphenation space
1735 to\~\c
1736 .IR n :
1737 when the current adjustment mode is\~\c
1738 .B b
1739 don't hyphenate the line if the line can be justified by adding no
1740 more than
1741 .I n
1742 extra space to each word space.
1744 The default hyphenation space is\~0.
1746 The default scaling indicator for this request is\~\c
1747 .BR m .
1748 The hyphenation space is associated with the current environment.
1750 The current hyphenation space is available in the
1751 .B \[rs]n[.hys]
1752 register.
1755 .BI .itc\  n\ macro
1756 Variant of
1757 .B .it
1758 for which a line interrupted with
1759 .B \[rs]c
1760 counts as one input line.
1763 .BI .kern\  n
1765 .I n
1766 is non-zero or missing, enable pairwise kerning, otherwise disable it.
1769 .BI .length\  xx\ string
1770 Compute the length of
1771 .I string
1772 and return it in the number register
1773 .I xx
1774 (which is not necessarily defined before).
1777 .BI .linetabs\  n
1779 .I n
1780 is non-zero or missing, enable line-tabs mode, otherwise disable it
1781 (which is the default).
1783 In line-tabs mode, tab distances are computed relative to the
1784 (current) output line.
1786 Otherwise they are taken relative to the input line.
1788 For example, the following
1792 .ne 6v+\n(.Vu
1793 .ft CB
1795 .Text .ds x a\[rs]t\[rs]c
1796 .Text .ds y b\[rs]t\[rs]c
1797 .Text .ds z c
1798 .Text .ta 1i 3i
1799 .Text \[rs]*x
1800 .Text \[rs]*y
1801 .Text \[rs]*z
1807 yields
1811 a         b         c
1815 In line-tabs mode, the same code gives
1819 a         b                   c
1823 Line-tabs mode is associated with the current environment; the
1824 read-only number register
1825 .B \\[rs]n[.linetabs]
1826 is set to\~1 if in line-tabs mode, and 0 otherwise.
1829 .BI .mso\  file
1830 The same as the
1831 .B so
1832 request except that
1833 .I file
1834 is searched for in the same directories as macro files for the the
1835 .B \-m
1836 command line option.
1838 If the file name to be included has the form
1839 .IB name .tmac
1840 and it isn't found,
1841 .B mso
1842 tries to include
1843 .BI tmac. name
1844 instead and vice versa.
1847 .BI .nop \ anything
1848 Execute
1849 .IR anything .
1850 This is similar to `.if\ 1'.
1853 .B .nroff
1854 Make the
1855 .B n
1856 built-in condition true and the
1857 .B t
1858 built-in condition false.
1860 This can be reversed using the
1861 .B troff
1862 request.
1865 .BI .open\  stream\ filename
1866 Open
1867 .I filename
1868 for writing and associate the stream named
1869 .I stream
1870 with it.
1872 See also the
1873 .B close
1875 .B write
1876 requests.
1878 .TP 
1879 .BI .opena\  stream\ filename
1880 Like
1881 .BR open ,
1882 but if
1883 .I filename
1884 exists, append to it instead of truncating it.
1887 .BI .output\  string
1888 Emit
1889 .I string
1890 directly to the intermediate output (subject to copy-mode interpretation);
1891 this is similar to
1892 .B \[rs]!
1893 used at the top level.
1895 An initial double quote in
1896 .I string
1897 is stripped off to allow initial blanks.
1900 .B .pev
1901 Print the current environment and each defined environment state on
1902 stderr.
1905 .B .pnr
1906 Print the names and contents of all currently defined number registers
1907 on stderr.
1910 .BI .psbb \ filename
1911 Get the bounding box of a PostScript image
1912 .IR filename .
1913 This file must conform to Adobe's Document Structuring Conventions;
1914 the command looks for a
1915 .B \%%%BoundingBox
1916 comment to extract the bounding box values.
1918 After a successful call, the coordinates (in PostScript units) of the
1919 lower left and upper right corner can be found in the registers
1920 .BR \[rs]n[llx] ,
1921 .BR \[rs]n[lly] ,
1922 .BR \[rs]n[urx] ,
1924 .BR \[rs]n[ury] ,
1925 respectively.
1927 If some error has occurred, the four registers are set to zero.
1930 .BI .pso \ command
1931 This behaves like the
1932 .B so
1933 request except that input comes from the standard output of
1934 .IR command .
1937 .B .ptr
1938 Print the names and positions of all traps (not including input line
1939 traps and diversion traps) on stderr.
1941 Empty slots in the page trap list are printed as well, because they
1942 can affect the priority of subsequently planted traps.
1945 .BI .pvs \ \[+-]n
1946 Set the post-vertical line space to
1947 .IR n ;
1948 default scale indicator is\~\c
1949 .BR p .
1951 This value is added to each line after it has been output.
1953 With no argument, the post-vertical line space is set to its previous
1954 value.
1957 The total vertical line spacing consists of four components:
1958 .B .vs
1960 .B \[rs]x
1961 with a negative value which are applied before the line is output, and
1962 .B .pvs
1964 .B \[rs]x
1965 with a positive value which are applied after the line is output.
1968 .BI .rchar\  c1\ c2\|.\|.\|.\&
1969 Remove the definitions of glyphs
1970 .IR c1 ,
1971 .IR c2 ,\|.\|.\|.
1972 This undoes the effect of a
1973 .B char
1974 request.
1977 .B .return
1978 Within a macro, return immediately.
1980 If called with an argument, return twice, namely from the current macro and
1981 from the macro one level higher.
1983 No effect otherwise.
1986 .BI .rfschar\  c1\ c2\|.\|.\|.\&
1987 Remove the font-specific definitions of glyphs
1988 .IR c1 ,
1989 .IR c2 ,\|.\|.\|.
1990 This undoes the effect of a
1991 .B fschar
1992 request.
1995 .B .rj
1997 .BI .rj \~n
1998 Right justify the next
1999 .IR n \~\c
2000 input lines.
2002 Without an argument right justify the next input line.
2004 The number of lines to be right justified is available in the
2005 .B \[rs]n[.rj]
2006 register.
2008 This implicitly does
2009 .BR .ce \~0 .
2011 .B ce
2012 request implicitly does
2013 .BR .rj \~0 .
2016 .BI .rnn \ xx\ yy
2017 Rename number register
2018 .I xx
2020 .IR yy .
2023 .BI .schar\  c\ string
2024 Define global fallback glyph
2025 .I c
2026 to be
2027 .IR string .
2029 The syntax of this request is the same as the
2030 .B char
2031 request; a glyph defined with
2032 .B schar
2033 is searched after the list of fonts declared with the
2034 .B special
2035 request but before the mounted special fonts.
2038 .BI .shc\  c
2039 Set the soft hyphen character to
2040 .IR c .
2042 .I c
2043 is omitted, the soft hyphen character is set to the default
2044 .BR \[rs](hy .
2045 The soft hyphen character is the glyph which is inserted when
2046 a word is hyphenated at a line break.
2048 If the soft hyphen character does not exist in the font of the
2049 glyph immediately preceding a potential break point, then the line
2050 is not broken at that point.
2052 Neither definitions (specified with the
2053 .B char
2054 request) nor translations (specified with the
2055 .B tr
2056 request) are considered when finding the soft hyphen character.
2059 .BI .shift\  n
2060 In a macro, shift the arguments by
2061 .I n
2062 positions: argument\~\c
2063 .I i
2064 becomes argument
2065 .IR i \- n ;
2066 arguments 1 to\~\c
2067 .I n
2068 are no longer available.
2071 .I n
2072 is missing, arguments are shifted by\~1.
2074 Shifting by negative amounts is currently undefined.
2077 .BI .sizes\  s1\ s2\|.\|.\|.\|sn\  [0]
2078 This command is similar to the
2079 .B sizes
2080 command of a
2081 .B DESC
2082 file.
2084 It sets the available font sizes for the current font to
2085 .IR s1 ,
2086 .IR s2 ,\|.\|.\|.\|,\~ sn
2087 scaled points.
2089 The list of sizes can be terminated by an optional\~\c
2090 .BR 0 .
2092 Each
2093 .I si
2094 can also be a range of sizes
2095 .IR m - n .
2097 Contrary to the font file command, the list can't extend over more
2098 than a single line.
2101 .BI .special\  s1\ s2\|.\|.\|.\&
2102 Fonts
2103 .IR s1 ,
2104 .IR s2 ,
2105 are special and are searched for glyphs not in the current
2106 font.
2108 Without arguments, reset the list of special fonts to be empty.
2111 .BI .spreadwarn\  limit
2112 Make
2113 .B troff
2114 emit a warning if the additional space inserted for each space between
2115 words in an output line is larger or equal to
2116 .IR limit .
2118 A negative value is changed to zero; no argument toggles the warning on
2119 and off without changing
2120 .IR limit .
2122 The default scaling indicator is\~\c
2123 .BR m .
2125 At startup,
2126 .B spreadwarn
2127 is deactivated, and
2128 .I limit
2129 is set to 3m.
2131 For example,
2132 .B .spreadwarn\ 0.2m
2133 causes a warning if
2134 .B troff
2135 must add 0.2m or more for each interword space in a line.
2137 This request is active only if text is justified to both margins (using
2138 .BR .ad\ b ).
2141 .BI .sty\  n\ f
2142 Associate style\~\c
2143 .I f
2144 with font position\~\c
2145 .IR n .
2146 A font position can be associated either with a font or with a style.
2148 The current font is the index of a font position and so is also either
2149 a font or a style.
2151 When it is a style, the font that is actually used is the font the
2152 name of which is the concatenation of the name of the current family
2153 and the name of the current style.
2155 For example, if the current font is\~1 and font position\~1 is
2156 associated with style\~\c
2157 .B R
2158 and the current font family is\~\c
2159 .BR T ,
2160 then font
2161 .BR TR
2162 is used.
2164 If the current font is not a style, then the current family is ignored.
2166 When the requests
2167 .BR cs ,
2168 .BR bd ,
2169 .BR tkf ,
2170 .BR uf ,
2172 .B fspecial
2173 are applied to a style, then they are applied instead to the
2174 member of the current family corresponding to that style.
2176 The default family can be set with the
2177 .B \-f
2178 option.
2181 .B styles
2182 command in the
2183 .SM DESC
2184 file controls which font positions (if any) are initially associated
2185 with styles rather than fonts.
2188 .BI .substring\  xx\ n1\  [ n2 ]
2189 Replace the string named
2190 .I xx
2191 with the substring defined by the indices
2192 .I n1
2194 .IR n2 .
2195 The first character in the string has index\~0.
2198 .I n2
2199 is omitted, it is taken to be equal to the string's length.
2201 If the index value
2202 .I n1
2204 .I n2
2205 is negative, it is counted from the end of the string,
2206 going backwards:
2208 The last character has index\~-1, the character before the last
2209 character has index\~-2, etc.
2212 .BI .tkf\  f\ s1\ n1\ s2\ n2
2213 Enable track kerning for font
2214 .IR f .
2215 When the current font is
2216 .I f
2217 the width of every glyph is increased by an amount between
2218 .I n1
2220 .IR n2 ;
2221 when the current point size is less than or equal to
2222 .I s1
2223 the width is increased by
2224 .IR n1 ;
2225 when it is greater than or equal to
2226 .I s2
2227 the width is increased by
2228 .IR n2 ;
2229 when the point size is greater than or equal to
2230 .I s1
2231 and less than or equal to
2232 .I s2
2233 the increase in width is a linear function of the point size.
2236 .BI .tm1\  string
2237 Similar to the
2238 .B tm
2239 request,
2240 .I string
2241 is read in copy mode and written on the standard error, but an initial
2242 double quote in
2243 .I string
2244 is stripped off to allow initial blanks.
2247 .BI .tmc\  string
2248 Similar to
2249 .B tm1
2250 but without writing a final newline.
2253 .BI .trf\  filename
2254 Transparently output the contents of file
2255 .IR filename .
2256 Each line is output as if preceded by
2257 .BR \[rs]! ;
2258 however, the lines are not subject to copy-mode interpretation.
2260 If the file does not end with a newline, then a newline is added.
2262 For example, you can define a macro\~\c
2263 .I x
2264 containing the contents of file\~\c
2265 .IR f ,
2266 using
2270 .ne 2v+\n(.Vu
2271 .ft CB
2273 .Text .di x
2274 .Text .trf f
2275 .Text .di
2281 Unlike with the
2282 .B cf
2283 request, the file cannot contain characters such as
2284 .SM NUL
2285 that are not valid troff input characters.
2288 .BI .trin\  abcd
2289 This is the same as the
2290 .B tr
2291 request except that the
2292 .B asciify
2293 request uses the character code (if any) before the character
2294 translation.
2296 Example:
2301 .ft CB
2302 .Text .trin ax
2303 .Text .di xxx
2304 .Text a
2305 .Text .br
2306 .Text .di
2307 .Text .xxx
2308 .Text .trin aa
2309 .Text .asciify xxx
2310 .Text .xxx
2316 The result is
2317 .BR x\ a .
2319 Using
2320 .BR tr ,
2321 the result would be
2322 .BR x\ x .
2325 .BI .trnt\  abcd
2326 This is the same as the
2327 .B tr
2328 request except that the translations do not apply to text that is
2329 transparently throughput into a diversion with
2330 .BR \[rs]! .
2331 For example,
2336 .ft CB
2337 .Text .tr ab
2338 .Text .di x
2339 .Text \[rs]!.tm a
2340 .Text .di
2341 .Text .x
2347 prints\~\c
2348 .BR b ;
2350 .B trnt
2351 is used instead of
2352 .B tr
2353 it prints\~\c
2354 .BR a .
2358 .B .troff
2359 Make the
2360 .B n
2361 built-in condition false, and the
2362 .B t
2363 built-in condition true.
2365 This undoes the effect of the
2366 .B nroff
2367 request.
2370 .BI .unformat\  xx
2371 This request `unformats' the diversion
2372 .IR xx .
2373 Contrary to the
2374 .B .asciify
2375 request, which tries to convert formatted elements of the diversion
2376 back to input tokens as much as possible,
2377 .B .unformat
2378 only handles tabs and spaces between words (usually caused by
2379 spaces or newlines in the input) specially.
2381 The former are treated as if they were input tokens, and the latter
2382 are stretchable again.
2384 Note that the vertical size of lines is not preserved.
2386 Glyph information (font, font size, space width, etc.) is retained.
2388 Useful in conjunction with the
2389 .B .box
2391 .B .boxa
2392 requests.
2395 .BI .vpt\  n
2396 Enable vertical position traps if
2397 .I n
2398 is non-zero, disable them otherwise.
2400 Vertical position traps are traps set by the
2401 .B wh
2403 .B dt
2404 requests.
2406 Traps set by the
2407 .B it
2408 request are not vertical position traps.
2410 The parameter that controls whether vertical position traps are
2411 enabled is global.
2413 Initially vertical position traps are enabled.
2416 .BI .warn\  n
2417 Control warnings.
2418 .I n
2419 is the sum of the numbers associated with each warning that is to be
2420 enabled; all other warnings are disabled.
2422 The number associated with each warning is listed in
2423 .BR @g@troff (@MAN1EXT@).
2425 For example,
2426 .B .warn\~0
2427 disables all warnings, and
2428 .B .warn\~1
2429 disables all warnings except that about missing glyphs.
2432 .I n
2433 is not given, all warnings are enabled.
2436 .BI .warnscale\  si
2437 Set the scaling indicator used in warnings to
2438 .IR si .
2440 Valid values for
2441 .I si
2443 .BR u ,
2444 .BR i ,
2445 .BR c ,
2446 .BR p ,
2448 .BR P .
2450 At startup, it is set to\~\c
2451 .BR i .
2454 .BI .while \ c\ anything
2455 While condition\~\c
2456 .I c
2457 is true, accept
2458 .I anything
2459 as input;
2460 .IR c \~\c
2461 can be any condition acceptable to an
2462 .B if
2463 request;
2464 .I anything
2465 can comprise multiple lines if the first line starts with
2466 .B \[rs]{
2467 and the last line ends with
2468 .BR \[rs]} .
2469 See also the
2470 .B break
2472 .B continue
2473 requests.
2476 .BI .write\  stream\ anything
2477 Write
2478 .I anything
2479 to the stream named
2480 .IR stream .
2481 .I stream
2482 must previously have been the subject of an
2483 .B open
2484 request.
2485 .I anything
2486 is read in copy mode;
2487 a leading\~\c
2488 .B \[dq]
2489 is stripped.
2492 .BI .writec\  stream\ anything
2493 Similar to
2494 .B write
2495 but without writing a final newline.
2498 .BI .writem\  stream\ xx
2499 Write the contents of the macro or string
2500 .I xx
2501 to the stream named
2502 .IR stream .
2503 .I stream
2504 must previously have been the subject of an
2505 .B open
2506 request.
2507 .I xx
2508 is read in copy mode.
2511 .\" --------------------------------------------------------------------
2512 .SS "Extended escape sequences"
2513 .\" --------------------------------------------------------------------
2516 .BI \[rs]D' .\|.\|. '
2517 All drawing commands of groff's intermediate output are accepted.
2519 See subsection
2520 .B "Drawing Commands"
2521 below for more information.
2524 .\" --------------------------------------------------------------------
2525 .SS "Extended requests"
2526 .\" --------------------------------------------------------------------
2529 .BI .cf\  filename
2530 When used in a diversion, this embeds in the diversion an object
2531 which, when reread, will cause the contents of
2532 .I filename
2533 to be transparently copied through to the output.
2535 In UNIX troff, the contents of
2536 .I filename
2537 is immediately copied through to the output regardless of whether
2538 there is a current diversion; this behaviour is so anomalous that it
2539 must be considered a bug.
2542 .BI .de\  xx\ yy
2544 .BI .am\  xx\ yy
2546 .BI .ds\  xx\ yy
2548 .BI .as\  xx\ yy
2549 In compatibility mode, these requests behaves similar to
2550 .BR .de1 ,
2551 .BR .am1 ,
2552 .BR .ds1 ,
2554 .BR .as1 ,
2555 respectively: A `compatibility save' token is inserted at the
2556 beginning, and a `compatibility restore' token at the end, with
2557 compatibility mode switched on during execution.
2560 .BI .ev\  xx
2562 .I xx
2563 is not a number, this switches to a named environment called
2564 .IR xx .
2565 The environment should be popped with a matching
2566 .B ev
2567 request without any arguments, just as for numbered environments.
2569 There is no limit on the number of named environments; they are
2570 created the first time that they are referenced.
2573 .BI .ss\  m\ n
2574 When two arguments are given to the
2575 .B ss
2576 request, the second argument gives the
2577 .IR "sentence space size" .
2578 If the second argument is not given, the sentence space size
2579 is the same as the word space size.
2581 Like the word space size, the sentence space is in units of
2582 one twelfth of the spacewidth parameter for the current font.
2584 Initially both the word space size and the sentence
2585 space size are\~12.
2587 Contrary to UNIX troff, GNU troff handles this request in nroff mode
2588 also; a given value is then rounded down to the nearest multiple
2589 of\~12.
2591 The sentence space size is used in two circumstances.
2593 If the end of a sentence occurs at the end of a line in fill mode,
2594 then both an inter-word space and a sentence space are added; if
2595 two spaces follow the end of a sentence in the middle of a line, then
2596 the second space is a sentence space.
2598 Note that the behaviour of UNIX troff are exactly that exhibited
2599 by GNU troff if a second argument is never given to the
2600 .B ss
2601 request.
2603 In GNU troff, as in UNIX troff, you should always follow a sentence
2604 with either a newline or two spaces.
2607 .BI .ta\  n1\ n2\|.\|.\|.nn \ T\  r1\ r2\|.\|.\|.\|rn
2608 Set tabs at positions
2609 .IR n1 ,
2610 .IR n2 ,\|.\|.\|.\|,
2611 .I nn
2612 and then set tabs at
2613 .IR nn + r1 ,
2614 .IR nn + r2 ,\|.\|.\|.\|,
2615 .IR nn + rn
2616 and then at
2617 .IR nn + rn + r1 ,
2618 .IR nn + rn + r2 ,\|.\|.\|.\|,
2619 .IR nn + rn + rn ,
2620 and so on.
2621 For example,
2625 .ft CB
2626 .Text .ta T .5i
2631 sets tabs every half an inch.
2635 .\" --------------------------------------------------------------------
2636 .SS "New number registers"
2637 .\" --------------------------------------------------------------------
2639 The following read-only registers are available:
2642 .B \[rs]n[.br]
2643 Within a macro call, it is set to\~1 if the macro is called with the
2644 `normal' control character (`.' by default), and set to\~0 otherwise.
2645 This allows to reliably modify requests.
2649 .ne 6v+\n(.Vu
2650 .ft CB
2652 .Text .als bp*orig bp
2653 .Text .de bp
2654 .Text .tm before bp
2655 .Text .ie \[rs]\[rs]n[.br] .bp*orig
2656 .Text .el 'bp*orig
2657 .Text .tm after bp
2658 .Text ..
2663 Using this register outside of a macro makes no sense (it always returns
2664 zero in such cases).
2667 .B \[rs]n[.C]
2668 1\~if compatibility mode is in effect, 0\~otherwise.
2671 .B \[rs]n[.cdp]
2672 The depth of the last glyph added to the current environment.
2674 It is positive if the glyph extends below the baseline.
2677 .B \[rs]n[.ce]
2678 The number of lines remaining to be centered, as set by the
2679 .B ce
2680 request.
2683 .B \[rs]n[.cht]
2684 The height of the last glyph added to the current environment.
2686 It is positive if the glyph extends above the baseline.
2689 .B \[rs]n[.color]
2690 1\~if colors are enabled, 0\~otherwise.
2693 .B \[rs]n[.csk]
2694 The skew of the last glyph added to the current environment.
2697 .I skew
2698 of a glyph is how far to the right of the center of a glyph
2699 the center of an accent over that glyph should be placed.
2702 .B \[rs]n[.ev]
2703 The name or number of the current environment.
2705 This is a string-valued register.
2708 .B \[rs]n[.fam]
2709 The current font family.
2711 This is a string-valued register.
2714 .B \[rs]n[.fn]
2715 The current (internal) real font name.
2717 This is a string-valued register.
2719 If the current font is a style, the value of
2720 .B \[rs]n[.fn]
2721 is the proper concatenation of family and style name.
2724 .B \[rs]n[.fp]
2725 The number of the next free font position.
2728 .B \[rs]n[.g]
2729 Always\~1.
2731 Macros should use this to determine whether they are running under GNU
2732 troff.
2735 .B \[rs]n[.height]
2736 The current height of the font as set with
2737 .BR \[rs]H .
2740 .B \[rs]n[.hla]
2741 The current hyphenation language as set by the
2742 .B hla
2743 request.
2746 .B \[rs]n[.hlc]
2747 The number of immediately preceding consecutive hyphenated lines.
2750 .B \[rs]n[.hlm]
2751 The maximum allowed number of consecutive hyphenated lines, as set by
2753 .B hlm
2754 request.
2757 .B \[rs]n[.hy]
2758 The current hyphenation flags (as set by the
2759 .B hy
2760 request).
2763 .B \[rs]n[.hym]
2764 The current hyphenation margin (as set by the
2765 .B hym
2766 request).
2769 .B \[rs]n[.hys]
2770 The current hyphenation space (as set by the
2771 .B hys
2772 request).
2775 .B \[rs]n[.in]
2776 The indent that applies to the current output line.
2779 .B \[rs]n[.int]
2780 Set to a positive value if last output line is interrupted (i.e., if
2781 it contains
2782 .IR \[rs]c ).
2785 .B \[rs]n[.kern]
2786 1\~if pairwise kerning is enabled, 0\~otherwise.
2789 .B \[rs]n[.lg]
2790 The current ligature mode (as set by the
2791 .B lg
2792 request).
2795 .B \[rs]n[.linetabs]
2796 The current line-tabs mode (as set by the
2797 .B linetabs
2798 request).
2801 .B \[rs]n[.ll]
2802 The line length that applies to the current output line.
2805 .B \[rs]n[.lt]
2806 The title length as set by the
2807 .B lt
2808 request.
2811 .B \[rs]n[.m]
2812 The name of the current drawing color.
2814 This is a string-valued register.
2817 .B \[rs]n[.M]
2818 The name of the current background color.
2820 This is a string-valued register.
2823 .B \[rs]n[.ne]
2824 The amount of space that was needed in the last
2825 .B ne
2826 request that caused a trap to be sprung.
2828 Useful in conjunction with the
2829 .B \[rs]n[.trunc]
2830 register.
2833 .B \[rs]n[.ns]
2834 1\~if no-space mode is active, 0\~otherwise.
2837 .B \[rs]n[.pe]
2838 1\~during a page ejection caused by the
2839 .B bp
2840 request, 0\~otherwise.
2843 .B \[rs]n[.pn]
2844 The number of the next page, either the value set by a
2845 .B pn
2846 request, or the number of the current page plus\~1.
2849 .B \[rs]n[.ps]
2850 The current pointsize in scaled points.
2853 .B \[rs]n[.psr]
2854 The last-requested pointsize in scaled points.
2857 .B \[rs]n[.pvs]
2858 The current post-vertical line space as set with the
2859 .B pvs
2860 request.
2863 .B \[rs]n[.rj]
2864 The number of lines to be right-justified as set by the
2865 .B rj
2866 request.
2869 .B \[rs]n[.slant]
2870 The slant of the current font as set with
2871 .BR \[rs]S .
2874 .B \[rs]n[.sr]
2875 The last requested pointsize in points as a decimal fraction.
2877 This is a string-valued register.
2880 .B \[rs]n[.ss]
2882 .B \[rs]n[.sss]
2883 These give the values of the parameters set by the first and second
2884 arguments of the
2885 .B ss
2886 request.
2889 .B \[rs]n[.sty]
2890 The current font style.
2892 This is a string-valued register.
2895 .B \[rs]n[.tabs]
2896 A string representation of the current tab settings suitable for use
2897 as an argument to the
2898 .B ta
2899 request.
2902 .B \[rs]n[.trunc]
2903 The amount of vertical space truncated by the most recently sprung
2904 vertical position trap, or, if the trap was sprung by a
2905 .B ne
2906 request, minus the amount of vertical motion produced by the
2907 .B ne
2908 request.
2910 In  other  words, at the point  a  trap is  sprung,  it represents the
2911 difference of  what the vertical position  would have been but for the
2912 trap, and what the vertical position actually is.
2914 Useful in conjunction with the
2915 .B \[rs]n[.ne]
2916 register.
2919 .B \[rs]n[.U]
2920 Set to 1 if in safer mode and to 0 if in unsafe mode (as given with the
2921 .B \-U
2922 command line option).
2925 .B \[rs]n[.vpt]
2926 1\~if vertical position traps are enabled, 0\~otherwise.
2929 .B \[rs]n[.warn]
2930 The sum of the numbers associated with each of the currently enabled
2931 warnings.
2933 The number associated with each warning is listed in
2934 .BR @g@troff (@MAN1EXT@).
2937 .B \[rs]n[.x]
2938 The major version number.
2940 For example, if the version number is 1.03, then
2941 .B \[rs]n[.x]
2942 contains\~1.
2945 .B \[rs]n[.y]
2946 The minor version number.
2948 For example, if the version number is 1.03, then
2949 .B \[rs]n[.y]
2950 contains\~03.
2953 .B \[rs]n[.Y]
2954 The revision number of groff.
2957 .B \[rs]n[.zoom]
2958 The zoom value of the current font, in multiples of 1/1000th.
2959 Zero if no magnification.
2962 .B \[rs]n[llx]
2964 .B \[rs]n[lly]
2966 .B \[rs]n[urx]
2968 .B \[rs]n[ury]
2969 These four registers are set by the
2970 .B .psbb
2971 request and contain the bounding box values (in PostScript units) of a
2972 given PostScript image.
2975 The following read/write registers are set by the
2976 .B \[rs]w
2977 escape sequence:
2980 .B \[rs]n[rst]
2982 .B \[rs]n[rsb]
2983 Like the
2984 .B st
2986 .B sb
2987 registers, but take account of the heights and depths of glyphs.
2990 .B \[rs]n[ssc]
2991 The amount of horizontal space (possibly negative) that should be
2992 added to the last glyph before a subscript.
2995 .B \[rs]n[skw]
2996 How far to right of the center of the last glyph in the
2997 .B \[rs]w
2998 argument, the center of an accent from a roman font should be placed
2999 over that glyph.
3002 Other available read/write number registers are:
3005 .B \[rs]n[c.]
3006 The current input line number.
3007 .B \[rs]n[.c]
3008 is a read-only alias to this register.
3011 .B \[rs]n[hours]
3012 The number of hours past midnight.
3014 Initialized at start-up.
3017 .B \[rs]n[hp]
3018 The current horizontal position at input line.
3021 .B \[rs]n[minutes]
3022 The number of minutes after the hour.
3024 Initialized at start-up.
3027 .B \[rs]n[seconds]
3028 The number of seconds after the minute.
3030 Initialized at start-up.
3033 .B \[rs]n[systat]
3034 The return value of the system() function executed by the last
3035 .B sy
3036 request.
3039 .B \[rs]n[slimit]
3040 If greater than\~0, the maximum number of objects on the input stack.
3042 If less than or equal to\~0, there is no limit on the number of
3043 objects on the input stack.
3045 With no limit, recursion can continue until virtual memory is
3046 exhausted.
3049 .B \[rs]n[year]
3050 The current year.
3052 Note that the traditional
3053 .B troff
3054 number register
3055 .B \[rs]n[yr]
3056 is the current year minus 1900.
3059 .\" --------------------------------------------------------------------
3060 .SS Miscellaneous
3061 .\" --------------------------------------------------------------------
3063 .B @g@troff
3064 predefines a single (read/write) string-based register,
3065 .BR \[rs]*(.T ,
3066 which contains the argument given to the
3067 .B \-T
3068 command line option, namely the current output device (for example,
3069 .I latin1
3071 .IR ascii ).
3072 Note that this is not the same as the (read-only) number register
3073 .B \[rs]n[.T]
3074 which is defined to be\~1 if
3075 .B troff
3076 is called with the
3077 .B \-T
3078 command line option, and zero otherwise.
3080 This behaviour is different to UNIX troff.
3083 Fonts not listed in the
3084 .SM DESC
3085 file are automatically mounted on the next available font position
3086 when they are referenced.
3088 If a font is to be mounted explicitly with the
3089 .B fp
3090 request on an unused font position, it should be mounted on the first
3091 unused font position, which can be found in the
3092 .B \[rs]n[.fp]
3093 register; although
3094 .B troff
3095 does not enforce this strictly, it does not allow a font to be mounted
3096 at a position whose number is much greater than that of any currently
3097 used position.
3100 Interpolating a string does not hide existing macro arguments.
3102 Thus in a macro, a more efficient way of doing
3105 .BI . xx\  \[rs]\[rs]$@
3110 .BI \[rs]\[rs]*[ xx ]\[rs]\[rs]  
3113 If the font description file contains pairwise kerning information,
3114 glyphs from that font are kerned.
3116 Kerning between two glyphs can be inhibited by placing a
3117 .B \[rs]&
3118 between them.
3121 In a string comparison in a condition, characters that appear at
3122 different input levels to the first delimiter character are not
3123 recognised as the second or third delimiters.
3125 This applies also to the
3126 .B tl
3127 request.
3129 In a
3130 .B \[rs]w
3131 escape sequence, a character that appears at a different input level
3132 to the starting delimiter character is not recognised as the
3133 closing delimiter character.
3135 The same is true for
3136 .BR \[rs]A ,
3137 .BR \[rs]b ,
3138 .BR \[rs]B ,
3139 .BR \[rs]C ,
3140 .BR \[rs]l ,
3141 .BR \[rs]L ,
3142 .BR \[rs]o ,
3143 .BR \[rs]X ,
3145 .BR \[rs]Z .
3147 When decoding a macro or string argument that is delimited by double
3148 quotes, a character that appears at a different input level to the starting
3149 delimiter character is not recognised as the closing delimiter
3150 character.
3152 The implementation of
3153 .B \[rs]$@
3154 ensures that the double quotes surrounding an argument appear at the
3155 same input level, which is different to the input level of the
3156 argument itself.
3158 In a long escape name
3159 .B ]
3160 is not recognized as a closing delimiter except when it occurs at
3161 the same input level as the opening
3162 .BR ] .
3164 In compatibility mode, no attention is paid to the input-level.
3167 There are some new types of condition:
3170 .BI .if\ r xxx
3171 True if there is a number register named
3172 .IR xxx .
3175 .BI .if\ d xxx
3176 True if there is a string, macro, diversion, or request named
3177 .IR xxx .
3180 .BI .if\ m xxx
3181 True if there is a color named
3182 .IR xxx .
3185 .BI .if\ c ch
3186 True if there is a glyph
3187 .IR ch
3188 available;
3189 .I ch
3190 is either an
3191 .SM ASCII
3192 character or a glyph (special character)
3193 .BI \[rs]N' xxx '\f[R],
3194 .BI \[rs]( xx
3196 .BI \[rs][ xxx ]\f[R];
3197 the condition is also true if
3198 .I ch
3199 has been defined by the
3200 .B char
3201 request.
3204 .BI .if\ F f
3205 True if font
3206 .I f
3207 exists.
3209 .B f
3210 is handled as if it was opened with the
3211 .B ft
3212 request (this is, font translation and styles are applied), without
3213 actually mounting it.
3216 .BI .if\ S s
3217 True if style
3218 .I s
3219 has been registered.
3221 Font translation is applied.
3225 .B tr
3226 request can now map characters onto
3227 .BR \[rs]~ .
3230 It is now possible to have whitespace between the first and second dot
3231 (or the name of the ending macro) to end a macro definition.
3233 Example:
3236 .ne 6v+\n(.Vu
3237 .ft CB
3239 .Text .if t \[rs]{\[rs]
3240 .Text .  de bar
3241 .Text .    nop Hello, I'm `bar'.
3242 .Text .  .
3243 .Text .\[rs]}
3247 .\" --------------------------------------------------------------------
3248 .SH "INTERMEDIATE OUTPUT FORMAT"
3249 .\" --------------------------------------------------------------------
3251 This section describes the format output by GNU troff.
3253 The output format used by GNU troff is very similar to that used
3254 by Unix device-independent troff.
3256 Only the differences are documented here.
3259 .\" --------------------------------------------------------------------
3260 .SS "Units"
3261 .\" --------------------------------------------------------------------
3263 The argument to the
3264 .B s
3265 command is in scaled points (units of
3266 .RI points/ n ,
3267 where
3268 .I n
3269 is the argument to the
3270 .B sizescale
3271 command  in the DESC file).
3273 The argument to the
3274 .B x\ Height
3275 command is also in scaled points.
3278 .\" --------------------------------------------------------------------
3279 .SS "Text Commands"
3280 .\" --------------------------------------------------------------------
3283 .BI N n
3284 Print glyph with index\~\c
3285 .I n
3286 (a non-negative integer) of the current font.
3289 If the
3290 .B tcommand
3291 line is present in the DESC file, troff uses the following two
3292 commands.
3295 .BI t xxx
3296 .I xxx
3297 is any sequence of characters terminated by a space or a newline (to
3298 be more precise, it is a sequence of glyphs which are accessed with
3299 the corresponding characters); the first character should be printed at
3300 the current position, the current horizontal position should be increased
3301 by the width of the first character, and so on for each character.
3303 The width of the glyph is that given in the font file,
3304 appropriately scaled for the current point size, and rounded so that
3305 it is a multiple of the horizontal resolution.
3307 Special characters cannot be printed using this command.
3310 .BI u n\ xxx
3311 This is same as the
3312 .B t
3313 command except that after printing each character, the current
3314 horizontal position is increased by the sum of the width of that
3315 character and
3316 .IR n .
3319 Note that single characters can have the eighth bit set, as can the
3320 names of fonts and special characters.
3323 The names of glyphs and fonts can be of arbitrary length; drivers
3324 should not assume that they are only two characters long.
3327 When a glyph is to be printed, that glyph is always
3328 in the current font.
3330 Unlike device-independent troff, it is not necessary for drivers to
3331 search special fonts to find a glyph.
3334 For color support, some new commands have been added:
3337 .Text \f[B]mc \f[I]cyan magenta yellow\f[R]
3339 .Text \f[B]md\f[R]
3341 .Text \f[B]mg \f[I]gray\f[R]
3343 .Text \f[B]mk \f[I]cyan magenta yellow black\f[R]
3345 .Text \f[B]mr \f[I]red green blue\f[R]
3346 Set the color components of the current drawing color, using various
3347 color schemes.
3349 .B md
3350 resets the drawing color to the default value.
3352 The arguments are integers in the range 0 to 65536.
3356 .B x
3357 device control command has been extended.
3360 .Text \f[B]x u \f[I]n\f[R]
3362 .I n
3363 is\~1, start underlining of spaces.
3366 .I n
3367 is\~0, stop underlining of spaces.
3369 This is needed for the
3370 .B cu
3371 request in nroff mode and is ignored otherwise.
3374 .\" --------------------------------------------------------------------
3375 .SS "Drawing Commands"
3376 .\" --------------------------------------------------------------------
3379 .B D
3380 drawing command has been extended.
3382 These extensions are not used by GNU pic if the
3383 .B \-n
3384 option is given.
3387 .Text \f[B]Df \f[I]n\f[R]\*[ic]\[rs]n
3388 Set the shade of gray to be used for filling solid objects to
3389 .IR n ;
3390 .I n
3391 must be an integer between 0 and 1000, where 0 corresponds solid white
3392 and 1000 to solid black, and values in between correspond to
3393 intermediate shades of gray.
3395 This applies only to solid circles, solid ellipses and solid
3396 polygons.
3398 By default, a level of 1000 is used.
3400 Whatever color a solid object has, it should completely obscure
3401 everything beneath it.
3403 A value greater than 1000 or less than 0 can also be used: this means
3404 fill with the shade of gray that is currently being used for lines and
3405 text.
3407 Normally this is black, but some drivers may provide a way of
3408 changing this.
3411 The corresponding
3412 .BI \[rs]D'f .\|.\|. '
3413 command shouldn't be used since its argument is always rounded to an
3414 integer multiple of the horizontal resolution which can lead to
3415 surprising results.
3418 .Text \f[B]DC \f[I]d\f[R]\*[ic]\[rs]n
3419 Draw a solid circle with a diameter of
3420 .I d
3421 with the leftmost point at the current position.
3424 .Text \f[B]DE \f[I]dx dy\f[R]\*[ic]\[rs]n
3425 Draw a solid ellipse with a horizontal diameter of
3426 .I dx
3427 and a vertical diameter of
3428 .I dy
3429 with the leftmost point at the current position.
3431 delim $$
3435 .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
3436 Draw a polygon with, for $i = 1 ,..., n+1$, the
3437 .IR i -th
3438 vertex at the current position 
3440 $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$.
3442 At the moment, GNU pic only uses this command to generate triangles
3443 and rectangles.
3446 .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
3448 Like
3449 .B Dp
3450 but draw a solid rather than outlined polygon.
3453 .Text \f[B]Dt \f[I]n\f[R]\*[ic]\[rs]n
3454 Set the current line thickness to
3455 .I n
3456 machine units.
3458 Traditionally Unix troff drivers use a line thickness proportional to
3459 the current point size; drivers should continue to do this if no
3460 .B Dt
3461 command has been given, or if a
3462 .B Dt
3463 command has been given with a negative value of
3464 .IR n .
3465 A zero value of
3466 .I n
3467 selects the smallest available line thickness.
3470 A difficulty arises in how the current position should be changed after
3471 the execution of these commands.
3473 This is not of great importance since the code generated by GNU pic
3474 does not depend on this.
3476 Given a drawing command of the form
3478 \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]
3481 where
3482 .I c
3483 is not one of
3484 .BR c ,
3485 .BR e ,
3486 .BR l ,
3487 .BR a ,
3489 .BR ~ ,
3490 Unix troff treats each of the $x sub i$ as a horizontal quantity,
3491 and each of the $y sub i$ as a vertical quantity and assumes that
3492 the width of the drawn object is $sum from i=1 to n x sub i$,
3493 and that the height is $sum from i=1 to n y sub i$.
3495 (The assumption about the height can be seen by examining the
3496 .B st
3498 .B sb
3499 registers after using such a
3500 .B D
3501 command in a \[rs]w escape sequence).
3503 This rule also holds for all the original drawing commands with the
3504 exception of
3505 .BR De .
3506 For the sake of compatibility GNU troff also follows this rule, even
3507 though it produces an ugly result in the case of the
3508 .B Dt
3510 .BR Df ,
3511 and, to a lesser extent,
3512 .B DE
3513 commands.
3515 Thus after executing a
3516 .B D
3517 command of the form
3519 \f[B]D\f[I]c\f[R] $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ \c
3520 $x sub n$ $y sub n$\[rs]n
3523 the current position should be increased by
3525 $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
3528 Another set of extensions is
3531 .Text \f[B]DFc \f[I]cyan magenta yellow\f[R]\*[ic]\[rs]n
3533 .Text \f[B]DFd\f[R]\*[ic]\[rs]n
3535 .Text \f[B]DFg \f[I]gray\f[R]\*[ic]\[rs]n
3537 .Text \f[B]DFk \f[I]cyan magenta yellow black\f[R]\*[ic]\[rs]n
3539 .Text \f[B]DFr \f[I]red green blue\f[R]\*[ic]\[rs]n
3540 Set the color components of the filling color similar to the
3541 .B m
3542 commands above.
3545 The current position isn't changed by those colour commands (contrary to
3546 .BR Df ).
3549 .\" --------------------------------------------------------------------
3550 .SS "Device Control Commands"
3551 .\" --------------------------------------------------------------------
3553 There is a continuation convention which permits the argument to the
3554 .B x\ X
3555 command to contain newlines: when outputting the argument to the
3556 .B x\ X
3557 command, GNU troff follows each newline in the argument with a
3558 .B +
3559 character (as usual, it terminates the entire argument with a
3560 newline); thus if the line after the line containing the
3561 .B x\ X
3562 command starts with
3563 .BR + ,
3564 then the newline ending the line containing the
3565 .B x\ X
3566 command should be treated as part of the argument to the
3567 .B x\ X
3568 command, the
3569 .B +
3570 should be ignored, and the part of the line following the
3571 .B +
3572 should be treated like the part of the line following the
3573 .B x\ X
3574 command.
3577 The first three output commands are guaranteed to be:
3579 .BI x\ T\  device
3581 .BI x\ res\  n\ h\ v
3583 .B x init
3586 .\" --------------------------------------------------------------------
3587 .SH INCOMPATIBILITIES
3588 .\" --------------------------------------------------------------------
3590 In spite of the many extensions, groff has retained compatibility to
3591 classical troff to a large degree.
3593 For the cases where the extensions lead to collisions, a special
3594 compatibility mode with the restricted, old functionality was created
3595 for groff.
3598 .\" --------------------------------------------------------------------
3599 .SS "Groff Language"
3600 .\" --------------------------------------------------------------------
3602 .I groff
3603 provides a
3604 .B compatibility mode
3605 that allows to process roff code written for classical
3606 .B troff
3607 or for other implementations of roff in a consistent way.
3610 Compatibility mode can be turned on with the
3611 .option \-C
3612 command line option, and turned on or off with the
3613 .request .cp
3614 request.
3616 The number register
3617 .esc n(.C
3618 is\~1 if compatibility mode is on, 0\~otherwise.
3621 This became necessary because the GNU concept for long names causes
3622 some incompatibilities.
3623 .I Classical troff
3624 interprets
3626 .request .dsabcd
3629 as defining a string
3630 .B ab
3631 with contents
3632 .BR cd .
3634 .IR groff
3635 mode, this is considered as a call of a macro named
3636 .request dsabcd .
3639 Also
3640 .I classical troff
3641 interprets
3642 .esc *[
3644 .esc n[
3645 as references to a string or number register called
3646 .request [
3647 while
3648 .I groff
3649 takes this as the start of a long name.
3653 .IR "compatibility mode" ,
3654 groff interprets these things in the traditional way; so long
3655 names are not recognized.
3658 On the other hand, groff in
3659 .I GNU native mode
3660 does not allow to use the single-character escapes
3661 .esc \[rs]
3662 (backslash),
3663 .esc |
3664 (vertical bar),
3665 .esc ^
3666 (caret),
3667 .esc &
3668 (ampersand),
3669 .esc {
3670 (opening brace),
3671 .esc }
3672 (closing brace),
3673 .squoted "\[rs]\ "
3674 (space),
3675 .esc '
3676 (single quote),
3677 .esc `
3678 (backquote),
3679 .esc \-
3680 (minus),
3681 .esc _
3682 (underline),
3683 .esc !
3684 (bang),
3685 .esc %
3686 (percent),
3688 .esc c
3689 (character c) in names of strings, macros, diversions, number
3690 registers, fonts or environments, whereas
3691 .I classical troff
3692 does.
3696 .esc A
3697 escape sequence can be helpful in avoiding these escape sequences in
3698 names.
3701 Fractional pointsizes cause one noteworthy incompatibility.
3704 .I classical
3705 .IR troff ,
3707 .request ps
3708 request ignores scale indicators and so
3711 .B .ps\~10u
3715 sets the pointsize to 10\~points, whereas in groff native mode the
3716 pointsize is set to 10\~scaled points.
3720 .IR groff ,
3721 there is a fundamental difference between unformatted input
3722 characters, and formatted output characters (glyphs).
3724 Everything that affects how a glyph is output is
3725 stored with the glyph; once a glyph has been
3726 constructed it is unaffected by any subsequent requests that are
3727 executed, including the
3728 .request bd ,
3729 .request cs ,
3730 .request tkf ,
3731 .request tr ,
3733 .request fp
3734 requests.
3737 Normally glyphs are constructed from input characters at
3738 the moment immediately before the glyph is added to the current
3739 output line.
3741 Macros, diversions and strings are all, in fact, the same type of
3742 object; they contain lists of input characters and glyphs
3743 in any combination.
3746 Special characters can be both; before being added to the output, they
3747 act as input entities, afterwards they denote glyphs.
3750 A glyph does not behave like an input character for the
3751 purposes of macro processing; it does not inherit any of the special
3752 properties that the input character from which it was constructed
3753 might have had.
3755 The following example makes things clearer.
3760 .ft CB
3761 .Text .di x
3762 .Text \[rs]\[rs]\[rs]\[rs]
3763 .Text .br
3764 .Text .di
3765 .Text .x
3771 With
3772 .I GNU troff
3773 this is printed as
3774 .esc \[rs] .
3775 So each pair of input backslashes
3776 .squoted \[rs]\[rs]
3777 is turned into a single output backslash glyph
3778 .squoted \[rs]
3779 and the resulting output backslashes are not interpreted as escape
3780 characters when they are reread.
3783 .I Classical troff
3784 would interpret them as escape characters when they were reread and
3785 would end up printing a single backslash
3786 .squoted \[rs] .
3789 In GNU, the correct way to get a printable version of the backslash
3790 character
3791 .squoted \[rs]
3792 is the
3793 .esc (rs
3794 escape sequence, but classical troff does not provide a clean feature
3795 for getting a non-syntactical backslash.
3797 A close method is the printable version of the current escape
3798 character using the
3799 .esc e
3800 escape sequence; this works if the current escape character is not
3801 redefined.
3803 It works in both GNU mode and compatibility mode, while dirty tricks
3804 like specifying a sequence of multiple backslashes do not work
3805 reliably; for the different handling in diversions, macro definitions,
3806 or text mode quickly leads to a confusion about the necessary number of
3807 backslashes.
3810 To store an escape sequence in a diversion that is interpreted
3811 when the diversion is reread, either the traditional
3812 .esc !
3813 transparent output facility or the
3815 .esc ?
3816 escape sequence can be used.
3819 .\" --------------------------------------------------------------------
3820 .SS "Intermediate Output"
3821 .\" --------------------------------------------------------------------
3823 The groff intermediate output format is in a state of evolution.
3825 So far it has some incompatibilities, but it is intended to establish
3826 a full compatibility to the classical troff output format.
3828 Actually the following incompatibilities exist:
3830 .Topic
3831 The positioning after the drawing of the polygons conflicts with the
3832 classical definition.
3834 .Topic
3835 The intermediate output cannot be rescaled to other devices as
3836 classical "device-independent" troff did.
3839 .\" --------------------------------------------------------------------
3840 .SH AUTHORS
3841 .\" --------------------------------------------------------------------
3843 Copyright (C) 1989, 2001, 2002, 2003, 2004, 2006
3844 Free Software Foundation, Inc.
3847 This document is distributed under the terms of the FDL (GNU Free
3848 Documentation License) version 1.1 or later.
3850 You should have received a copy of the FDL on your system, it is also
3851 available on-line at the
3852 .URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
3854 This document was written by James Clark, with modifications by
3855 .MTO wl@gnu.org "Werner Lemberg"
3857 .MTO bwarken@mayn.de "Bernd Warken" .
3860 This document is part of
3861 .IR groff ,
3862 the GNU roff distribution.
3864 Formerly, the contents of this document was kept in the manual
3865 page
3866 .BR @g@troff (@MAN1EXT@).
3867 Only the parts dealing with the language aspects of the different
3868 .I roff
3869 systems were carried over into this document.
3872 .I troff
3873 command line options and warnings are still documented in
3874 .BR @g@troff (@MAN1EXT@).
3876 .\" --------------------------------------------------------------------
3877 .SH "SEE ALSO"
3878 .\" --------------------------------------------------------------------
3881 .I groff info
3882 .IR file ,
3883 cf.\&
3884 .BR info (1)
3885 presents all groff documentation within a single document.
3888 .BR groff (@MAN1EXT@)
3889 A list of all documentation around
3890 .IR groff .
3893 .BR groff (@MAN7EXT@)
3894 A description of the
3895 .I groff
3896 language, including a short, but complete reference of all predefined
3897 requests, registers, and escapes of plain
3898 .IR groff .
3899 From the command line, this is called using
3902 .ShellCommand man\~7\~groff
3905 .BR roff (@MAN7EXT@)
3906 A survey of
3907 .I roff
3908 systems, including pointers to further historical documentation.
3911 .RI [ CSTR\~#54\/ ]
3913 .I Nroff/\:Troff User's Manual
3915 .I J.\& F.\& Osanna
3916 of 1976 in the revision of
3917 .I Brian Kernighan
3918 of 1992, being the
3919 .URL http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz \
3920      "classical troff documentation" .
3922 .cp \n[groff_diff_C]
3924 .\" --------------------------------------------------------------------
3925 .\" Emacs variables
3926 .\" --------------------------------------------------------------------
3928 .\" Local Variables:
3929 .\" mode: nroff
3930 .\" End: