Merge branch 'topic/prestrip-down'
[s-roff.git] / man / groff_diff.man
blobfb3121b8fe657324da3694d9c0877e7630729b98
1 '\" e
2 .\" The above line should force the use of eqn as a preprocessor
3 .ig
4 groff_diff.man
6 This file is part of groff, the GNU roff type-setting system.
7 It is the source of the man-page groff_diff(7).
9 Copyright (C) 1989, 2001, 2002, 2003, 2004, 2006, 2007, 2008
10   Free Software Foundation, Inc.
11 written by James Clark
13 modified by Werner Lemberg <wl@gnu.org>
14             Bernd Warken <bwarken@mayn.de>
16 Permission is granted to copy, distribute and/or modify this document
17 under the terms of the GNU Free Documentation License, Version 1.1 or
18 any later version published by the Free Software Foundation; with the
19 Invariant Sections being this .ig-section and AUTHORS, with no
20 Front-Cover Texts, and with no Back-Cover Texts.
22 A copy of the Free Documentation License is included as a file called
23 FDL in the main directory of the groff source package.
27 .\" --------------------------------------------------------------------
28 .\" Local definitions
29 .\" --------------------------------------------------------------------
31 .\" define a string tx for the TeX logo
32 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
33 .el   .ds tx TeX
36 .\" from old groff_out.man
37 .ie \n(.g \
38 .  ds ic \/
39 .el \
40 .  ds ic \^
43 .\" --------------------------------------------------------------------
44 .\" Title
45 .\" --------------------------------------------------------------------
47 .TH GROFF_DIFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
48 .SH NAME
49 groff_diff \- differences between GNU troff and classical troff
52 .\" --------------------------------------------------------------------
53 .SH DESCRIPTION
54 .\" --------------------------------------------------------------------
56 This manual page describes the language differences between
57 .IR groff ,
58 the GNU
59 .I roff
60 text processing system, and the classical
61 .I roff
62 formatter of the freely available Unix\~7 of the 1970s, documented in
63 the
64 .I Troff User's Manual
66 .I Ossanna
67 and
68 .IR Kernighan .
69 This inludes the roff language as well as the intermediate output
70 format (troff output).
73 The section
74 .I SEE ALSO
75 gives pointers to both the classical
76 .I roff
77 and the modern
78 .I groff
79 documentation.
82 .\" --------------------------------------------------------------------
83 .SH "GROFF LANGUAGE"
84 .\" --------------------------------------------------------------------
86 In this section, all additional features of
87 .I groff
88 compared to the classical Unix\~7
89 .I troff
90 are described in detail.
93 .\" --------------------------------------------------------------------
94 .SS "Long names"
95 .\" --------------------------------------------------------------------
97 The names of number registers, fonts, strings/\:macros/\:diversions,
98 special characters (glyphs), and colors can be of any length.
100 In escape sequences, additionally to the classical `\fB(\fP\fIxx\fP'
101 construction for a two-character glyph name, you can use
102 `\fB[\fP\fIxxx\fP\fB]\fP' for a name of arbitrary length.
105 .BI \[rs][ xxx ]
106 Print the special character (glyph) called
107 .IR xxx .
110 .BI \[rs][ "comp1 comp2 .\|.\|." ]
111 Print composite glyph consisting of multiple components.
113 Example: `\[rs][A\~ho]' is capital letter A with ogonek which finally maps
114 to glyph name `u0041_0328'.
116 See the
117 .I groff info file
118 for details how a glyph name for a composite glyph is constructed, and
119 .BR groff_char (@MAN7EXT@)
120 for a list of glyph name components used in composite glyph names.
123 .BI \[rs]f[ xxx ]
124 Set font
125 .IR xxx .
127 Additionally,
128 .B \[rs]f[]
129 is a new syntax form equal to
130 .BR \[rs]fP ,
131 i.e., to return to the previous font.
134 .BI \[rs]*[ "xxx arg1 arg2 .\|.\|." ]
135 Interpolate string
136 .IR xxx ,
137 taking
138 .IR arg1 ,
139 .IR arg2 ,
140 .I .\|.\|.\&
141 as arguments.
144 .BI \[rs]n[ xxx ]
145 Interpolate number register
146 .IR xxx .
149 .\" --------------------------------------------------------------------
150 .SS "Fractional point sizes"
151 .\" --------------------------------------------------------------------
154 .I scaled point
155 is equal to
156 .B 1/sizescale
157 points, where
158 .B sizescale
159 is specified in the
160 .B DESC
161 file (1 by default).
163 There is a new scale indicator\~\c
164 .B z
165 that has the effect of multiplying by sizescale.
167 Requests and escape sequences in troff interpret arguments that
168 represent a point size as being in units of scaled points, but they
169 evaluate each such argument using a default scale indicator of\~\c
170 .BR z .
171 Arguments treated in this way are the argument to the
172 .B ps
173 request, the third argument to the
174 .B cs
175 request, the second and fourth arguments to the
176 .B tkf
177 request, the argument to the
178 .B \[rs]H
179 escape sequence, and those variants of the
180 .B \[rs]s
181 escape sequence that take a numeric expression as their argument.
184 For example, suppose sizescale is 1000; then a scaled point is
185 equivalent to a millipoint; the call
186 .B .ps\ 10.25
187 is equivalent to
188 .B .ps\ 10.25z
189 and so sets the point size to 10250 scaled points, which is equal to
190 10.25 points.
193 The number register
194 .B \[rs]n[.s]
195 returns the point size in points as decimal fraction.
197 There is also a new number register
198 .B \[rs]n[.ps]
199 that returns the point size in scaled points.
202 It would make no sense to use the
203 .BR z \~\c
204 scale indicator in a numeric expression whose default scale indicator
205 was neither
206 .B u
207 nor\~\c
208 .BR z ,
209 and so
210 .B troff
211 disallows this.
213 Similarly it would make no sense to use a scaling indicator other than
214 .B z
215 or\~\c
216 .B u
217 in a numeric expression whose default scale indicator was\~\c
218 .BR z ,
219 and so
220 .B troff
221 disallows this as well.
224 There is also new scale indicator\~\c
225 .B s
226 which multiplies by the number of units in a scaled point.
228 So, for example,
229 .B \[rs]n[.ps]s
230 is equal to
231 .BR 1m .
232 Be sure not to confuse the
233 .B s
235 .BR z \~\c
236 scale indicators.
239 .\" --------------------------------------------------------------------
240 .SS "Numeric expressions"
241 .\" --------------------------------------------------------------------
243 Spaces are permitted in a number expression within parentheses.
246 .B M
247 indicates a scale of 100ths of an em.
248 .B f
249 indicates a scale of 65536 units, providing fractions for color
250 definitions with the
251 .B defcolor
252 request.
254 For example, 0.5f = 32768u.
257 .IB e1 >? e2
258 The maximum of
259 .I e1
261 .IR e2 .
264 .IB e1 <? e2
265 The minimum of
266 .I e1
268 .IR e2 .
271 .BI ( c ; e )
272 Evaluate
273 .I e
274 using
275 .I c
276 as the default scaling indicator.
279 .I c
280 is missing, ignore scaling indicators in the evaluation of\~\c
281 .IR e .
284 .\" --------------------------------------------------------------------
285 .SS "New escape sequences"
286 .\" --------------------------------------------------------------------
289 .BI \[rs]A' anything '
290 This expands to
291 .B 1
292 or\~\c
293 .BR 0 ,
294 depending on whether
295 .I anything
296 is or is not acceptable as the name of a string, macro, diversion, number
297 register, environment, font, or color.
298 It returns\~\c
299 .B 0
301 .I anything
302 is empty.
304 This is useful if you want to look up user input in some sort of
305 associative table.
308 .BI \[rs]B' anything '
309 This expands to
310 .B 1
311 or\~\c
312 .BR 0 ,
313 depending on whether
314 .I anything
315 is or is not a valid numeric expression.
317 It returns\~\c
318 .B 0
320 .I anything
321 is empty.
324 .BI \[rs]C' xxx '
325 Typeset glyph named
326 .IR xxx .
327 Normally it is more convenient to use
328 .BI \[rs][ xxx ]\f[R].
330 .B \[rs]C
331 has the advantage that it is compatible with recent versions of
332 .SM UNIX
333 and is available in compatibility mode.
336 .B \[rs]E
337 This is equivalent to an escape character, but it is not interpreted in
338 copy mode.
340 For example, strings to start and end superscripting could be defined
341 like this
346 \&.ds { \[rs]v'\-.3m'\[rs]s'\[rs]En[.s]*6u/10u'
347 \&.ds } \[rs]s0\[rs]v'.3m'
352 The use of
353 .B \[rs]E
354 ensures that these definitions work even if
355 .B \[rs]*{
356 gets interpreted in copy mode (for example, by being used in a macro
357 argument).
361 .BI \[rs]F f
363 .BI \[rs]F( fm
365 .BI \[rs]F[ fam ]
366 Change font family.
368 This is the same as the
369 .B fam
370 request.
372 .B \[rs]F[]
373 switches back to the previous color (note that
374 .B \[rs]FP
375 won't work; it selects font family `P' instead).
378 .BI \[rs]m x
380 .BI \[rs]m( xx
382 .BI \[rs]m[ xxx ]
383 Set drawing color.
384 .B \[rs]m[]
385 switches back to the previous color.
388 .BI \[rs]M x
390 .BI \[rs]M( xx
392 .BI \[rs]M[ xxx ]
393 Set background color for filled objects drawn with the
394 .BI \[rs]D' .\|.\|. '
395 commands.
396 .B \[rs]M[]
397 switches back to the previous color.
400 .BI \[rs]N' n '
401 Typeset the glyph with index\~\c
402 .I n
403 in the current font.
404 .IR n \~\c
405 can be any integer.
407 Most devices only have glyphs with indices between 0 and 255.
409 If the current font does not contain a glyph with that code,
410 special fonts are
411 .I not
412 searched.
415 .B \[rs]N
416 escape sequence can be conveniently used in conjunction with the
417 .B char
418 request, for example
423 \&.char \[rs][phone] \[rs]f(ZD\[rs]N'37'
428 The index of each glyph is given in the fourth column in the font
429 description file after the
430 .B charset
431 command.
433 It is possible to include unnamed glyphs in the font description
434 file by using a name of
435 .BR \-\-\- ;
437 .B \[rs]N
438 escape sequence is the only way to use these.
441 .BI \[rs]O n
443 .BI \[rs]O[ n ]
444 Suppress troff output.
446 The escapes
447 .BR \[rs]O2 ,
448 .BR \[rs]O3 ,
449 .BR \[rs]O4 ,
451 .B \[rs]O5
452 are intended for internal use by
453 .BR \%grohtml .
457 .B \[rs]O0
458 Disable any ditroff glyphs from being emitted to the device driver,
459 provided that the escape occurs at the outer level (see
460 .B \[rs]O3
462 .BR \[rs]O4 ).
465 .B \[rs]O1
466 Enable output of glyphs, provided that the escape occurs at the outer
467 level.
469 .B \[rs]O0
471 .B \[rs]O1
472 also reset the registers
473 .BR \[rs]n[opminx] ,
474 .BR \[rs]n[opminy] ,
475 .BR \[rs]n[opmaxx] ,
477 .B \[rs]n[opmaxy]
478 to\~\-1.
480 These four registers mark the top left and bottom right hand corners
481 of a box which encompasses all written glyphs.
484 .B \[rs]O2
485 Provided that the escape occurs at the outer level, enable output of
486 glyphs and also write out to stderr the page number and four registers
487 encompassing the glyphs previously written since the last call to
488 .BR \[rs]O .
491 .B \[rs]O3
492 Begin a nesting level.
494 At start-up,
495 .B troff
496 is at outer level.
498 This is really an internal mechanism for
499 .B \%grohtml
500 while producing images.
502 They are generated by running the troff source through
503 .B troff
504 to the postscript device and
505 .B ghostscript
506 to produce images in PNG format.
509 .B \[rs]O3
510 escape starts a new page if the device is not html (to reduce the
511 possibility of images crossing a page boundary).
514 .B \[rs]O4
515 End a nesting level.
518 .BI \[rs]O5[ Pfilename ]
519 This escape is
520 .B \%grohtml
521 specific.
523 Provided that this escape occurs at the outer nesting level, write
524 .I filename
525 to stderr.
527 The position of the image,
528 .IR P ,
529 must be specified and must be one of
530 .BR l ,
531 .BR r ,
532 .BR c ,
534 .B i
535 (left, right, centered, inline).
537 .I filename
538 is associated with the production of the next inline image.
542 .BI \[rs]R' name\ \[+-]n '
543 This has the same effect as
547 .BI .nr\  name\ \[+-]n
551 .BI \[rs]s( nn
553 .BI \[rs]s\[+-]( nn
554 Set the point size to
555 .I nn
556 points;
557 .I nn
558 must be exactly two digits.
561 .BI \[rs]s[\[+-] n ]
563 .BI \[rs]s\[+-][ n ]
565 .BI \[rs]s'\[+-] n '
567 .BI \[rs]s\[+-]' n '
568 Set the point size to
569 .I n
570 scaled points;
571 .I n
572 is a numeric expression with a default scale indicator of\~\c
573 .BR z .
576 .BI \[rs]V x
578 .BI \[rs]V( xx
580 .BI \[rs]V[ xxx ]
581 Interpolate the contents of the environment variable
582 .IR xxx ,
583 as returned by
584 .BR getenv (3).
585 .B \[rs]V
586 is interpreted in copy mode.
589 .BI \[rs]Y x
591 .BI \[rs]Y( xx
593 .BI \[rs]Y[ xxx ]
594 This is approximately equivalent to
595 .BI \[rs]X'\[rs]*[ xxx ]'\f[R].
596 However the contents of the string or macro
597 .I xxx
598 are not interpreted; also it is permitted for
599 .I xxx
600 to have been defined as a macro and thus contain newlines (it is not
601 permitted for the argument to
602 .B \[rs]X
603 to contain newlines).
605 The inclusion of newlines requires an extension to the UNIX troff
606 output format, and confuses drivers that do not know about this
607 extension.
610 .BI \[rs]Z' anything '
611 Print anything and then restore the horizontal and vertical position;
612 .I anything
613 may not contain tabs or leaders.
616 .B \[rs]$0
617 The name by which the current macro was invoked.
620 .B als
621 request can make a macro have more than one name.
624 .B \[rs]$*
625 In a macro or string, the concatenation of all the arguments separated
626 by spaces.
629 .B \[rs]$@
630 In a macro or string, the concatenation of all the arguments with each
631 surrounded by double quotes, and separated by spaces.
634 .B \[rs]$^
635 In a macro, the representation of all parameters as if they were an
636 argument to the
637 .B ds
638 request.
641 .BI \[rs]$( nn
643 .BI \[rs]$[ nnn ]
644 In a macro or string, this gives the
645 .IR nn -th
647 .IR nnn -th
648 argument.
650 Macros and strings can have an unlimited number of arguments.
653 .BI \[rs]? anything \[rs]?
654 When used in a diversion, this transparently embeds
655 .I anything
656 in the diversion.
657 .I anything
658 is read in copy mode.
660 When the diversion is reread,
661 .I anything
662 is interpreted.
663 .I anything
664 may not contain newlines; use
665 .B \[rs]!\&
666 if you want to embed newlines in a diversion.
668 The escape sequence
669 .B \[rs]?\&
670 is also recognized in copy mode and turned into a single internal
671 code; it is this code that terminates
672 .IR anything .
673 Thus
678 .ne 14v+\n(.Vu
679 \&.nr x 1
680 \&.nf
681 \&.di d
682 \&\[rs]?\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\c
683 \&\[rs]nx\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]?\[rs]?
684 \&.di
685 \&.nr x 2
686 \&.di e
687 \&.d
688 \&.di
689 \&.nr x 3
690 \&.di f
691 \&.e
692 \&.di
693 \&.nr x 4
694 \&.f
699 prints\~\c
700 .BR 4 .
703 .B \[rs]/
704 This increases the width of the preceding glyph so that the
705 spacing between that glyph and the following glyph is
706 correct if the following glyph is a roman glyph.
708 .if t \{\
709 .  nop For example, if an italic\~f is immediately followed by a roman
710 .  nop right parenthesis, then in many fonts the top right portion of
711 .  nop the\~f overlaps the top left of the right parenthesis
712 .  nop producing \f[I]f\f[R])\f[R], which is ugly.
713 .  nop Inserting
714 .  B \[rs]/
715 .  nop produces
716 .  ie \n(.g \f[I]f\/\f[R])\f[R]
717 .  el       \f[I]f\|\f[R])\f[R]
718 .  nop and avoids this problem.
720 It is a good idea to use this escape sequence whenever an italic
721 glyph is immediately followed by a roman glyph without any
722 intervening space.
725 .B \[rs],
726 This modifies the spacing of the following glyph so that the
727 spacing between that glyph and the preceding glyph is
728 correct if the preceding glyph is a roman glyph.
730 .if t \{\
731 .  nop For example, inserting
732 .  B \[rs],
733 .  nop between the parenthesis and the\~f changes
734 .  nop \f[R](\f[I]f\f[R] to
735 .  ie \n(.g \f[R](\,\f[I]f\f[R].
736 .  el       \f[R](\^\f[I]f\f[R].
738 It is a good idea to use this escape sequence whenever a roman
739 glyph is immediately followed by an italic glyph without any
740 intervening space.
743 .B \[rs])
744 Like
745 .B \[rs]&
746 except that it behaves like a character declared with the
747 .B cflags
748 request to be transparent for the purposes of end-of-sentence
749 recognition.
752 .B \[rs]~
753 This produces an unbreakable space that stretches like a normal
754 inter-word space when a line is adjusted.
757 .B \[rs]:
758 This causes the insertion of a zero-width break point.
760 It is equal to
761 .B \[rs]%
762 within a word but without insertion of a soft hyphen glyph.
765 .B \[rs]#
766 Everything up to and including the next newline is ignored.
768 This is interpreted in copy mode.
770 It is like
771 .B \[rs]"
772 except that
773 .B \[rs]"
774 does not ignore the terminating newline.
777 .\" --------------------------------------------------------------------
778 .SS "New requests"
779 .\" --------------------------------------------------------------------
782 .BI .aln\  xx\ yy
783 Create an alias
784 .I xx
785 for number register object named
786 .IR yy .
787 The new name and the old name are exactly equivalent.
790 .I yy
791 is undefined, a warning of type
792 .B reg
793 is generated, and the request is ignored.
796 .BI .als\  xx\ yy
797 Create an alias
798 .I xx
799 for request, string, macro, or diversion object named
800 .IR yy .
802 The new name and the old name are exactly equivalent (it is
803 similar to a hard rather than a soft link).
806 .I yy
807 is undefined, a warning of type
808 .B mac
809 is generated, and the request is ignored.
812 .BR de ,
813 .BR am ,
814 .BR di ,
815 .BR da ,
816 .BR ds ,
818 .B as
819 requests only create a new object if the name of the macro, diversion
820 or string is currently undefined or if it is defined to be a
821 request; normally they modify the value of an existing object.
824 .BI .am1\  xx\ yy
825 Similar to
826 .BR .am , 
827 but compatibility mode is switched off during execution.
829 To be more precise, a `compatibility save' token is inserted at the
830 beginning of the macro addition, and a `compatibility restore' token at
831 the end.
833 As a consequence, the requests
834 .BR am ,
835 .BR am1 ,
836 .BR de ,
838 .B de1
839 can be intermixed freely since the compatibility save/\:restore tokens
840 only affect the macro parts defined by
841 .B .am1
843 .BR .ds1 .
846 .BI .ami\  xx\ yy
847 Append to macro indirectly.
849 See the
850 .B dei
851 request below for more information.
854 .BI .ami1\  xx\ yy
855 Same as the
856 .B ami
857 request but compatibility mode is switched off during execution.
860 .BI .as1\  xx\ yy
861 Similar to
862 .BR .as , 
863 but compatibility mode is switched off during expansion.
865 To be more precise, a `compatibility save' token is inserted at the
866 beginning of the string, and a `compatibility restore' token at the end.
868 As a consequence, the requests
869 .BR as ,
870 .BR as1 ,
871 .BR ds ,
873 .B ds1
874 can be intermixed freely since the compatibility save/\:restore tokens
875 only affect the (sub)strings defined by
876 .B as1
878 .BR ds1 .
881 .BI .asciify\  xx
882 This request `unformats' the diversion
883 .I xx
884 in such a way that
885 .SM ASCII
886 and space characters (and some escape sequences) that were formatted
887 and diverted into
888 .I xx
889 are treated like ordinary input characters when
890 .I xx
891 is reread.
892 Useful for diversions in conjunction with the
893 .B writem
894 request.
896 It can be also used for gross hacks; for example, this
901 .ne 7v+\n(.Vu
902 \&.tr @.
903 \&.di x
904 \&@nr n 1
905 \&.br
906 \&.di
907 \&.tr @@
908 \&.asciify x
909 \&.x
914 sets register\~\c
915 .B n
916 to\~1.
918 Note that glyph information (font, font size, etc.) is not preserved;
920 .B .unformat
921 instead.
924 .B .backtrace
925 Print a backtrace of the input stack on stderr.
928 .BI .blm\  xx
929 Set the blank line macro to
930 .IR xx .
931 If there is a blank line macro, it is invoked when a blank line
932 is encountered instead of the usual troff behaviour.
935 .BI .box\  xx
937 .BI .boxa\  xx
938 These requests are similar to the
939 .B di
941 .B da
942 requests with the exception that a partially filled line does not
943 become part of the diversion (i.e., the diversion always starts with a
944 new line) but is restored after ending the diversion, discarding the
945 partially filled line which possibly comes from the diversion.
948 .B .break
949 Break out of a while loop.
951 See also the
952 .B while
954 .B continue
955 requests.
957 Be sure not to confuse this with the
958 .B br
959 request.
962 .B .brp
963 This is the same as
964 .BR \[rs]p .
967 .BI .cflags\  n\ c1\ c2\|.\|.\|.\&
968 Characters
969 .IR c1 ,
970 .IR c2 ,\|.\|.\|.\&
971 have properties determined by
972 .IR n ,
973 which is ORed from the following:
976 .IP 1
977 The character ends sentences (initially characters
978 .B .?!\&
979 have this property).
981 .IP 2
982 Lines can be broken before the character (initially no characters have
983 this property); a line is not broken at a character with this property
984 unless the characters on each side both have non-zero hyphenation
985 codes.
986 This can be overridden with value 64.
988 .IP 4
989 Lines can be broken after the character (initially characters
990 .B \-\[rs][hy]\[rs][em]
991 have this property); a line is not broken at a character with this
992 property unless the characters on each side both have non-zero
993 hyphenation codes.
995 This can be overridden with value 64.
997 .IP 8
998 The glyph associated with this character overlaps horizontally
999 (initially characters
1000 .B \[rs][ul]\[rs][rn]\[rs][ru]\[rs][radicalex]\[rs][sqrtex]
1001 have this property).
1003 .IP 16
1004 The glyph associated with this character overlaps vertically
1005 (initially glyph
1006 .B \[rs][br]
1007 has this property).
1009 .IP 32
1010 An end-of-sentence character followed by any number of characters with
1011 this property is treated as the end of a sentence if followed by a
1012 newline or two spaces; in other words the character is transparent for
1013 the purposes of end-of-sentence recognition; this is the same as having
1014 a zero space factor in \*[tx] (initially characters
1015 .B \[dq]')]*\[rs][dg]\[rs][rq]
1016 have this property).
1018 .IP 64
1019 Ignore hyphenation code values of the surrounding characters.
1020 Use this in combination with values 2 and\~4 (initially no characters
1021 have this property).
1025 .BI .char\  c\ string
1026 [This request can both define characters and glyphs.]
1029 Define entity\~\c
1030 .I c
1031 to be
1032 .IR string .
1034 To be more precise, define (or even override) a groff entity which
1035 can be accessed with name\~\c
1036 .I c
1037 on the input side, and which uses
1038 .I string
1039 on the output side.
1041 Every time glyph\~\c
1042 .I c
1043 needs to be printed,
1044 .I string
1045 is processed in a temporary environment and the result is
1046 wrapped up into a single object.
1048 Compatibility mode is turned off and the escape character is
1049 set to\~\c
1050 .B \[rs]
1051 while
1052 .I string
1053 is being processed.
1055 Any emboldening, constant spacing or track kerning is applied to
1056 this object rather than to individual glyphs in
1057 .IR string .
1060 A groff object defined by this request can be used just like a
1061 normal glyph provided by the output device.
1063 In particular other characters can be translated to it with the
1064 .B tr
1065 request; it can be made the leader glyph by the
1066 .B lc
1067 request; repeated patterns can be drawn with the glyph using the
1068 .B \[rs]l
1070 .B \[rs]L
1071 escape sequences; words containing\~\c
1072 .I c
1073 can be hyphenated correctly, if the
1074 .B hcode
1075 request is used to give the object a hyphenation code.
1078 There is a special anti-recursion feature: Use of glyph within the
1079 glyph's definition is handled like normal glyphs not
1080 defined with
1081 .BR char .
1083 A glyph definition can be removed with the
1084 .B rchar
1085 request.
1088 .BI .chop\  xx
1089 Chop the last element off macro, string, or diversion
1090 .IR xx .
1091 This is useful for removing the newline from the end of diversions
1092 that are to be interpolated as strings.
1095 .BI .close\  stream
1096 Close the stream named
1097 .IR stream ;
1098 .I stream
1099 will no longer be an acceptable argument to the
1100 .B write
1101 request.
1103 See the
1104 .B open
1105 request.
1108 .BI .composite\  glyph1\ glyph2
1109 Map glyph name
1110 .I glyph1
1111 to glyph name
1112 .I glyph2
1113 if it is used in
1114 .BI \[rs][ .\|.\|. ]
1115 with more than one component.
1118 .B .continue
1119 Finish the current iteration of a while loop.
1121 See also the
1122 .B while
1124 .B break
1125 requests.
1128 .BI .color\  n
1130 .I n
1131 is non-zero or missing, enable colors (this is the default), otherwise
1132 disable them.
1135 .BI .cp\  n
1137 .I n
1138 is non-zero or missing, enable compatibility mode, otherwise disable
1141 In compatibility mode, long names are not recognized, and the
1142 incompatibilities caused by long names do not arise.
1145 .BI .defcolor\  xxx\ scheme\ color_components
1146 Define color
1147 .IR xxx .
1148 .I scheme
1149 can be one of the following values:
1150 .B rgb
1151 (three components),
1152 .B cmy
1153 (three components),
1154 .B cmyk
1155 (four components), and
1156 .B gray
1158 .B grey
1159 (one component).
1161 Color components can be given either as a hexadecimal string or as
1162 positive decimal integers in the range 0-65535.
1164 A hexadecimal string contains all color components concatenated; it
1165 must start with either
1166 .B #
1168 .BR ## .
1169 The former specifies hex values in the range 0-255 (which are
1170 internally multiplied by\~257), the latter in the range 0-65535.
1172 Examples: #FFC0CB (pink), ##ffff0000ffff (magenta).
1174 A new scaling indicator\~\c
1175 .B f
1176 has been introduced which multiplies its value by\~65536; this makes
1177 it convenient to specify color components as fractions in the range 0
1178 to\~1.
1180 Example:
1185 \&.defcolor darkgreen rgb 0.1f 0.5f 0.2f
1190 Note that
1191 .B f
1192 is the default scaling indicator for the
1193 .B defcolor
1194 request, thus the above statement is equivalent to
1199 \&.defcolor darkgreen rgb 0.1 0.5 0.2
1204 The color named
1205 .B default
1206 (which is device-specific) can't be redefined.
1208 It is possible that the default color for
1209 .B \[rs]M
1211 .B \[rs]m
1212 is not the same.
1215 .BI .de1\  xx\ yy
1216 Similar to
1217 .BR .de , 
1218 but compatibility mode is switched off during execution.
1220 On entry, the current compatibility mode is saved and restored at exit.
1223 .BI .dei\  xx\ yy
1224 Define macro indirectly.
1226 The following example
1230 .ne 2v+\n(.Vu
1232 \&.ds xx aa
1233 \&.ds yy bb
1234 \&.dei xx yy
1239 is equivalent to
1244 \&.de aa bb
1249 .BI .dei1\  xx\ yy
1250 Similar to the
1251 .B dei
1252 request but compatibility mode is switched off during execution.
1255 .BI .device\  anything
1256 This is (almost) the same as the
1257 .B \[rs]X
1258 escape.
1259 .I anything
1260 is read in copy mode; a leading\~\c
1261 .B \[dq]
1262 is stripped.
1265 .BI .devicem\  xx
1266 This is the same as the
1267 .B \[rs]Y
1268 escape (to embed the contents of a macro into the intermediate
1269 output preceded with `x\~X').
1272 .BI .do\  xxx
1273 Interpret
1274 .I .xxx
1275 with compatibility mode disabled.
1277 For example,
1283 \&.do fam T
1287 would have the same effect as
1291 \&.fam T
1295 except that it would work even if compatibility mode had been enabled.
1297 Note that the previous compatibility mode is restored before any files
1298 sourced by
1299 .I xxx
1300 are interpreted.
1305 .BI .ds1\  xx\ yy
1306 Similar to
1307 .BR .ds , 
1308 but compatibility mode is switched off during expansion.
1310 To be more precise, a `compatibility save' token is inserted at the
1311 beginning of the string, and a `compatibility restore' token at the end.
1314 .B .ecs
1315 Save current escape character.
1318 .B .ecr
1319 Restore escape character saved with
1320 .BR ecs .
1321 Without a previous call to
1322 .BR ecs ,
1323 .RB ` \[rs] '
1324 will be the new escape character.
1327 .BI .evc\  xx
1328 Copy the contents of environment
1329 .I xx
1330 to the current environment.
1332 No pushing or popping of environments is done.
1335 .BI .fam\  xx
1336 Set the current font family to
1337 .IR xx .
1338 The current font family is part of the current environment.
1340 .I xx
1341 is missing, switch back to previous font family.
1343 The value at start-up is `T'.
1345 See the description of the
1346 .B sty
1347 request for more information on font families.
1350 .BI .fchar\  c\ string
1351 Define fallback character (or glyph)\~\c
1352 .I c
1353 to be
1354 .IR string .
1356 The syntax of this request is the same as the
1357 .B char
1358 request; the only difference is that a glyph defined with
1359 .B char
1360 hides the glyph with the same name in the current font, whereas a
1361 glyph defined with
1362 .B fchar
1363 is checked only if the particular glyph isn't found in the current font.
1365 This test happens before checking special fonts.
1368 .BI .fcolor\  c
1369 Set the fill color to\~\c
1370 .IR c .
1372 .I c
1373 is missing,
1374 switch to the previous fill color.
1377 .BI .fschar\  f\ c\ string
1378 Define fallback character (or glyph)\~\c
1379 .I c
1380 for font\~\c
1381 .I f
1382 to be
1383 .IR string .
1385 The syntax of this request is the same as the
1386 .B char
1387 request (with an additional argument to specify the font); a glyph
1388 defined with
1389 .B fschar
1390 is searched after the list of fonts declared with the
1391 .B fspecial
1392 request but before the list of fonts declared with
1393 .BR .special .
1396 .BI .fspecial\  f\ s1\ s2\|.\|.\|.\&
1397 When the current font is\~\c
1398 .IR f ,
1399 fonts
1400 .IR s1 ,
1401 .IR s2 ,\|.\|.\|.\&
1402 are special, that is, they are searched for glyphs not in
1403 the current font.
1405 Any fonts specified in the
1406 .B special
1407 request are searched after fonts specified in the
1408 .B fspecial
1409 request.
1411 Without argument, reset the list of global special fonts to be empty.
1414 .BI .ftr\  f\ g
1415 Translate font\~\c
1416 .I f
1417 to\~\c
1418 .IR g .
1419 Whenever a font named\~\c
1420 .I f
1421 is referred to in an
1422 .B \[rs]f
1423 escape sequence, in the
1424 .B F
1426 .B S
1427 conditional operators, or in the
1428 .BR ft ,
1429 .BR ul ,
1430 .BR bd ,
1431 .BR cs ,
1432 .BR tkf ,
1433 .BR special ,
1434 .BR fspecial ,
1435 .BR fp ,
1437 .BR sty
1438 requests, font\~\c
1439 .I g
1440 is used.
1442 .I g
1443 is missing, or equal to\~\c
1444 .I f
1445 then font\~\c
1446 .I f
1447 is not translated.
1450 .BI .fzoom\  f\ zoom
1451 Set zoom factor
1452 .I zoom
1453 for font\~\c
1454 .IR f .
1455 .I zoom
1456 must a non-negative integer multiple of 1/1000th.
1457 If it is missing or is equal to zero, it means the same as 1000, namely no
1458 magnification.
1459 .IR f \~\c
1460 must be a real font name, not a style.
1463 .BI .gcolor\  c
1464 Set the glyph color to\~\c
1465 .IR c .
1467 .I c
1468 is missing,
1469 switch to the previous glyph color.
1472 .BI .hcode \ c1\ code1\ c2\ code2\|.\|.\|.\&
1473 Set the hyphenation code of character
1474 .I c1
1476 .I code1
1477 and that of
1478 .I c2
1480 .IR code2 .
1481 A hyphenation code must be a single input character (not a special
1482 character) other than a digit or a space.
1484 Initially each lower-case letter \%a-z has a hyphenation code, which is
1485 itself, and each upper-case letter \%A-Z has a hyphenation code which is
1486 the lower-case version of itself.
1488 See also the
1489 .B hpf
1490 request.
1493 .BI .hla\  lang
1494 Set the current hyphenation language to
1495 .IR lang .
1496 Hyphenation exceptions specified with the
1497 .B hw
1498 request and hyphenation patterns specified with the
1499 .B hpf
1500 request are both associated with the current hyphenation language.
1503 .B hla
1504 request is usually invoked by the
1505 .B troffrc
1506 file to set up a default language.
1509 .BI .hlm\  n
1510 Set the maximum number of consecutive hyphenated lines to\~\c
1511 .IR n .
1513 .I n
1514 is negative, there is no maximum.
1516 The default value is\~\-1.
1518 This value is associated with the current environment.
1520 Only lines output from an environment count towards the maximum
1521 associated with that environment.
1523 Hyphens resulting from
1524 .B \[rs]%
1525 are counted; explicit hyphens are not.
1528 .BI .hpf\  file
1529 Read hyphenation patterns from
1530 .IR file ;
1531 this is searched for in the same way that
1532 .IB name .tmac
1533 is searched for when the
1534 .BI \-m name
1535 option is specified.
1537 It should have the same format as (simple) \*[tx] patterns files.
1539 More specifically, the following scanning rules are implemented.
1542 .IP \[bu]
1543 A percent sign starts a comment (up to the end of the line) even if
1544 preceded by a backslash.
1546 .IP \[bu]
1547 No support for `digraphs' like
1548 .BR \[rs]$ .
1550 .IP \[bu]
1551 .BI ^^ xx
1552 .RI ( x
1553 is 0-9 or a-f) and
1554 .BI ^^ x
1555 (character code of\~\c
1556 .I x
1557 in the range 0-127) are recognized; other use of\~\c
1558 .B ^
1559 causes an error.
1561 .IP \[bu]
1562 No macro expansion.
1564 .IP \[bu]
1565 .B hpf
1566 checks for the expression
1567 .BR \[rs]patterns{ .\|.\|. }
1568 (possibly with whitespace before and after the braces).
1570 Everything between the braces is taken as hyphenation patterns.
1572 Consequently,
1573 .BR { \~\c
1574 and\~\c
1575 .B }
1576 are not allowed in patterns.
1578 .IP \[bu]
1579 Similarly,
1580 .BR \[rs]hyphenation{ .\|.\|. }
1581 gives a list of hyphenation exceptions.
1583 .IP \[bu]
1584 .B \[rs]endinput
1585 is recognized also.
1587 .IP \[bu]
1588 For backwards compatibility, if
1589 .B \[rs]patterns
1590 is missing, the whole file is treated as a list of hyphenation patterns
1591 (only recognizing the
1592 .BR % \~\c
1593 character as the start of a comment).
1597 Use the
1598 .B hpfcode
1599 request to map the encoding used in hyphenation patterns files to
1600 .BR groff 's
1601 input encoding.
1603 The set of hyphenation patterns is associated with the current language
1604 set by the
1605 .B hla
1606 request.
1609 .B hpf
1610 request is usually invoked by the
1611 .B troffrc
1612 file; a second call replaces the old patterns with the new ones.
1615 .BI .hpfa\  file
1616 The same as
1617 .B hpf
1618 except that the hyphenation patterns from
1619 .I file
1620 are appended to the patterns already loaded in the current language.
1623 .BI .hpfcode\  a\ b\ c\ d\ .\|.\|.
1624 After reading a hyphenation patterns file with the
1625 .B hpf
1627 .B hpfa
1628 request, convert all characters with character code\~\c
1629 .I a
1630 in the recently read patterns to character code\~\c
1631 .IR b ,
1632 character code\~\c
1633 .I c
1634 to\~\c
1635 .IR d ,
1636 etc.
1638 Initially, all character codes map to themselves.
1640 The arguments of
1641 .B hpfcode
1642 must be integers in the range 0 to\~255.
1644 Note that it is even possible to use character codes which are invalid in
1645 .B groff
1646 otherwise.
1649 .BI .hym\  n
1650 Set the
1651 .I hyphenation margin
1652 to\~\c
1653 .IR n :
1654 when the current adjustment mode is not\~\c
1655 .BR b ,
1656 the line is not hyphenated if the line is no more than
1657 .I n
1658 short.
1660 The default hyphenation margin is\~0.
1662 The default scaling indicator for this request is\~\c
1663 .BR m .
1664 The hyphenation margin is associated with the current environment.
1666 The current hyphenation margin is available in the
1667 .B \[rs]n[.hym]
1668 register.
1671 .BI .hys\  n
1672 Set the
1673 .I hyphenation space
1674 to\~\c
1675 .IR n :
1676 When the current adjustment mode is\~\c
1677 .B b
1678 don't hyphenate the line if the line can be justified by adding no
1679 more than
1680 .I n
1681 extra space to each word space.
1683 The default hyphenation space is\~0.
1685 The default scaling indicator for this request is\~\c
1686 .BR m .
1687 The hyphenation space is associated with the current environment.
1689 The current hyphenation space is available in the
1690 .B \[rs]n[.hys]
1691 register.
1694 .BI .itc\  n\ macro
1695 Variant of
1696 .B .it
1697 for which a line interrupted with
1698 .B \[rs]c
1699 counts as one input line.
1702 .BI .kern\  n
1704 .I n
1705 is non-zero or missing, enable pairwise kerning, otherwise disable it.
1708 .BI .length\  xx\ string
1709 Compute the length of
1710 .I string
1711 and return it in the number register
1712 .I xx
1713 (which is not necessarily defined before).
1716 .BI .linetabs\  n
1718 .I n
1719 is non-zero or missing, enable line-tabs mode, otherwise disable it
1720 (which is the default).
1722 In line-tabs mode, tab distances are computed relative to the
1723 (current) output line.
1725 Otherwise they are taken relative to the input line.
1727 For example, the following
1731 .ne 6v+\n(.Vu
1733 \&.ds x a\[rs]t\[rs]c
1734 \&.ds y b\[rs]t\[rs]c
1735 \&.ds z c
1736 \&.ta 1i 3i
1737 \&\[rs]*x
1738 \&\[rs]*y
1739 \&\[rs]*z
1744 yields
1749 a         b         c
1754 In line-tabs mode, the same code gives
1759 a         b                   c
1764 Line-tabs mode is associated with the current environment; the
1765 read-only number register
1766 .B \[rs]n[.linetabs]
1767 is set to\~1 if in line-tabs mode, and 0 otherwise.
1770 .BI .mso\  file
1771 The same as the
1772 .B so
1773 request except that
1774 .I file
1775 is searched for in the same directories as macro files for the the
1776 .B \-m
1777 command line option.
1779 If the file name to be included has the form
1780 .IB name .tmac
1781 and it isn't found,
1782 .B mso
1783 tries to include
1784 .BI tmac. name
1785 instead and vice versa.
1788 .BI .nop \ anything
1789 Execute
1790 .IR anything .
1791 This is similar to `.if\ 1'.
1794 .B .nroff
1795 Make the
1796 .B n
1797 built-in condition true and the
1798 .B t
1799 built-in condition false.
1801 This can be reversed using the
1802 .B troff
1803 request.
1806 .BI .open\  stream\ filename
1807 Open
1808 .I filename
1809 for writing and associate the stream named
1810 .I stream
1811 with it.
1813 See also the
1814 .B close
1816 .B write
1817 requests.
1819 .TP 
1820 .BI .opena\  stream\ filename
1821 Like
1822 .BR open ,
1823 but if
1824 .I filename
1825 exists, append to it instead of truncating it.
1828 .BI .output\  string
1829 Emit
1830 .I string
1831 directly to the intermediate output (subject to copy-mode interpretation);
1832 this is similar to
1833 .B \[rs]!\&
1834 used at the top level.
1836 An initial double quote in
1837 .I string
1838 is stripped off to allow initial blanks.
1841 .B .pev
1842 Print the current environment and each defined environment state on
1843 stderr.
1846 .B .pnr
1847 Print the names and contents of all currently defined number registers
1848 on stderr.
1851 .BI .psbb \ filename
1852 Get the bounding box of a PostScript image
1853 .IR filename .
1854 This file must conform to Adobe's Document Structuring Conventions;
1855 the command looks for a
1856 .B \%%%BoundingBox
1857 comment to extract the bounding box values.
1859 After a successful call, the coordinates (in PostScript units) of the
1860 lower left and upper right corner can be found in the registers
1861 .BR \[rs]n[llx] ,
1862 .BR \[rs]n[lly] ,
1863 .BR \[rs]n[urx] ,
1865 .BR \[rs]n[ury] ,
1866 respectively.
1868 If some error has occurred, the four registers are set to zero.
1871 .BI .pso \ command
1872 This behaves like the
1873 .B so
1874 request except that input comes from the standard output of
1875 .IR command .
1878 .B .ptr
1879 Print the names and positions of all traps (not including input line
1880 traps and diversion traps) on stderr.
1882 Empty slots in the page trap list are printed as well, because they
1883 can affect the priority of subsequently planted traps.
1886 .BI .pvs \ \[+-]n
1887 Set the post-vertical line space to\~\c
1888 .IR n ;
1889 default scale indicator is\~\c
1890 .BR p .
1892 This value is added to each line after it has been output.
1894 With no argument, the post-vertical line space is set to its previous
1895 value.
1898 The total vertical line spacing consists of four components:
1899 .B .vs
1901 .B \[rs]x
1902 with a negative value which are applied before the line is output, and
1903 .B .pvs
1905 .B \[rs]x
1906 with a positive value which are applied after the line is output.
1909 .BI .rchar\  c1\ c2\|.\|.\|.\&
1910 Remove the definitions of glyphs
1911 .IR c1 ,
1912 .IR c2 ,\|.\|.\|.
1913 This undoes the effect of a
1914 .B char
1915 request.
1918 .B .return
1919 Within a macro, return immediately.
1921 If called with an argument, return twice, namely from the current macro and
1922 from the macro one level higher.
1924 No effect otherwise.
1927 .BI .rfschar\  c1\ c2\|.\|.\|.\&
1928 Remove the font-specific definitions of glyphs
1929 .IR c1 ,
1930 .IR c2 ,\|.\|.\|.
1931 This undoes the effect of a
1932 .B fschar
1933 request.
1936 .B .rj
1938 .BI .rj \~n
1939 Right justify the next
1940 .IR n \~\c
1941 input lines.
1943 Without an argument right justify the next input line.
1945 The number of lines to be right justified is available in the
1946 .B \[rs]n[.rj]
1947 register.
1949 This implicitly does
1950 .BR .ce\~0 .
1952 .B ce
1953 request implicitly does
1954 .BR .rj\~0 .
1957 .BI .rnn \ xx\ yy
1958 Rename number register
1959 .I xx
1961 .IR yy .
1964 .BI .schar\  c\ string
1965 Define global fallback character (or glyph)\~\c
1966 .I c
1967 to be
1968 .IR string .
1970 The syntax of this request is the same as the
1971 .B char
1972 request; a glyph defined with
1973 .B schar
1974 is searched after the list of fonts declared with the
1975 .B special
1976 request but before the mounted special fonts.
1979 .BI .shc\  c
1980 Set the soft hyphen character to\~\c
1981 .IR c .
1983 .I c
1984 is omitted, the soft hyphen character is set to the default
1985 .BR \[rs][hy] .
1986 The soft hyphen character is the glyph which is inserted when
1987 a word is hyphenated at a line break.
1989 If the soft hyphen character does not exist in the font of the
1990 glyph immediately preceding a potential break point, then the line
1991 is not broken at that point.
1993 Neither definitions (specified with the
1994 .B char
1995 request) nor translations (specified with the
1996 .B tr
1997 request) are considered when finding the soft hyphen character.
2000 .BI .shift\  n
2001 In a macro, shift the arguments by
2002 .I n
2003 positions: argument\~\c
2004 .I i
2005 becomes argument
2006 .IR i \|\-\| n ;
2007 arguments 1 to\~\c
2008 .I n
2009 are no longer available.
2012 .I n
2013 is missing, arguments are shifted by\~1.
2015 Shifting by negative amounts is currently undefined.
2018 .BI .sizes\  s1\ s2\|.\|.\|.\|sn\  [0]
2019 This command is similar to the
2020 .B sizes
2021 command of a
2022 .B DESC
2023 file.
2025 It sets the available font sizes for the current font to
2026 .IR s1 ,
2027 .IR s2 ,\|.\|.\|.\|,\~ sn
2028 scaled points.
2030 The list of sizes can be terminated by an optional\~\c
2031 .BR 0 .
2033 Each
2034 .I si
2035 can also be a range of sizes
2036 .IR m - n .
2038 Contrary to the font file command, the list can't extend over more
2039 than a single line.
2042 .BI .special\  s1\ s2\|.\|.\|.\&
2043 Fonts
2044 .IR s1 ,
2045 .IR s2 ,\|.\|.\|.\&
2046 are special and are searched for glyphs not in the current
2047 font.
2049 Without arguments, reset the list of special fonts to be empty.
2052 .BI .spreadwarn\  limit
2053 Make
2054 .B troff
2055 emit a warning if the additional space inserted for each space between
2056 words in an output line is larger or equal to
2057 .IR limit .
2059 A negative value is changed to zero; no argument toggles the warning on
2060 and off without changing
2061 .IR limit .
2063 The default scaling indicator is\~\c
2064 .BR m .
2066 At startup,
2067 .B spreadwarn
2068 is deactivated, and
2069 .I limit
2070 is set to 3m.
2072 For example,
2073 .B .spreadwarn\ 0.2m
2074 causes a warning if
2075 .B troff
2076 must add 0.2m or more for each interword space in a line.
2078 This request is active only if text is justified to both margins (using
2079 .BR .ad\ b ).
2082 .BI .sty\  n\ f
2083 Associate style\~\c
2084 .I f
2085 with font position\~\c
2086 .IR n .
2087 A font position can be associated either with a font or with a style.
2089 The current font is the index of a font position and so is also either
2090 a font or a style.
2092 When it is a style, the font that is actually used is the font the
2093 name of which is the concatenation of the name of the current family
2094 and the name of the current style.
2096 For example, if the current font is\~1 and font position\~1 is
2097 associated with style\~\c
2098 .B R
2099 and the current font family is\~\c
2100 .BR T ,
2101 then font
2102 .BR TR
2103 is used.
2105 If the current font is not a style, then the current family is ignored.
2107 When the requests
2108 .BR cs ,
2109 .BR bd ,
2110 .BR tkf ,
2111 .BR uf ,
2113 .B fspecial
2114 are applied to a style, then they are applied instead to the
2115 member of the current family corresponding to that style.
2117 The default family can be set with the
2118 .B \-f
2119 command line option.
2122 .B styles
2123 command in the
2124 .SM DESC
2125 file controls which font positions (if any) are initially associated
2126 with styles rather than fonts.
2129 .BI .substring\  xx\ n1\  [ n2 ]
2130 Replace the string named
2131 .I xx
2132 with the substring defined by the indices
2133 .I n1
2135 .IR n2 .
2136 The first character in the string has index\~0.
2139 .I n2
2140 is omitted, it is taken to be equal to the string's length.
2142 If the index value
2143 .I n1
2145 .I n2
2146 is negative, it is counted from the end of the string,
2147 going backwards:
2149 The last character has index\~\-1, the character before the last
2150 character has index\~\-2, etc.
2153 .BI .tkf\  f\ s1\ n1\ s2\ n2
2154 Enable track kerning for font\~\c
2155 .IR f .
2156 When the current font is\~\c
2157 .I f
2158 the width of every glyph is increased by an amount between
2159 .I n1
2161 .IR n2 ;
2162 when the current point size is less than or equal to
2163 .I s1
2164 the width is increased by
2165 .IR n1 ;
2166 when it is greater than or equal to
2167 .I s2
2168 the width is increased by
2169 .IR n2 ;
2170 when the point size is greater than or equal to
2171 .I s1
2172 and less than or equal to
2173 .I s2
2174 the increase in width is a linear function of the point size.
2177 .BI .tm1\  string
2178 Similar to the
2179 .B tm
2180 request,
2181 .I string
2182 is read in copy mode and written on the standard error, but an initial
2183 double quote in
2184 .I string
2185 is stripped off to allow initial blanks.
2188 .BI .tmc\  string
2189 Similar to
2190 .B tm1
2191 but without writing a final newline.
2194 .BI .trf\  filename
2195 Transparently output the contents of file
2196 .IR filename .
2197 Each line is output as if preceded by
2198 .BR \[rs]! ;
2199 however, the lines are not subject to copy-mode interpretation.
2201 If the file does not end with a newline, then a newline is added.
2203 For example, you can define a macro\~\c
2204 .I x
2205 containing the contents of file\~\c
2206 .IR f ,
2207 using
2211 .ne 2v+\n(.Vu
2213 \&.di x
2214 \&.trf f
2215 \&.di
2220 Unlike with the
2221 .B cf
2222 request, the file cannot contain characters such as
2223 .SM NUL
2224 that are not valid troff input characters.
2227 .BI .trin\  abcd
2228 This is the same as the
2229 .B tr
2230 request except that the
2231 .B asciify
2232 request uses the character code (if any) before the character
2233 translation.
2235 Example:
2240 \&.trin ax
2241 \&.di xxx
2243 \&.br
2244 \&.di
2245 \&.xxx
2246 \&.trin aa
2247 \&.asciify xxx
2248 \&.xxx
2253 The result is
2254 .BR x\ a .
2256 Using
2257 .BR tr ,
2258 the result would be
2259 .BR x\ x .
2262 .BI .trnt\  abcd
2263 This is the same as the
2264 .B tr
2265 request except that the translations do not apply to text that is
2266 transparently throughput into a diversion with
2267 .BR \[rs]! .
2268 For example,
2273 \&.tr ab
2274 \&.di x
2275 \&\[rs]!.tm a
2276 \&.di
2277 \&.x
2282 prints\~\c
2283 .BR b ;
2285 .B trnt
2286 is used instead of
2287 .B tr
2288 it prints\~\c
2289 .BR a .
2293 .B .troff
2294 Make the
2295 .B n
2296 built-in condition false, and the
2297 .B t
2298 built-in condition true.
2300 This undoes the effect of the
2301 .B nroff
2302 request.
2305 .BI .unformat\  xx
2306 This request `unformats' the diversion
2307 .IR xx .
2308 Contrary to the
2309 .B asciify
2310 request, which tries to convert formatted elements of the diversion
2311 back to input tokens as much as possible,
2312 .B .unformat
2313 only handles tabs and spaces between words (usually caused by
2314 spaces or newlines in the input) specially.
2316 The former are treated as if they were input tokens, and the latter
2317 are stretchable again.
2319 Note that the vertical size of lines is not preserved.
2321 Glyph information (font, font size, space width, etc.) is retained.
2323 Useful in conjunction with the
2324 .B box
2326 .B boxa
2327 requests.
2330 .BI .vpt\  n
2331 Enable vertical position traps if
2332 .I n
2333 is non-zero, disable them otherwise.
2335 Vertical position traps are traps set by the
2336 .B wh
2338 .B dt
2339 requests.
2341 Traps set by the
2342 .B it
2343 request are not vertical position traps.
2345 The parameter that controls whether vertical position traps are
2346 enabled is global.
2348 Initially vertical position traps are enabled.
2351 .BI .warn\  n
2352 Control warnings.
2353 .IR n \~\c
2354 is the sum of the numbers associated with each warning that is to be
2355 enabled; all other warnings are disabled.
2357 The number associated with each warning is listed in
2358 .BR @g@troff (@MAN1EXT@).
2360 For example,
2361 .B .warn\~0
2362 disables all warnings, and
2363 .B .warn\~1
2364 disables all warnings except that about missing glyphs.
2367 .I n
2368 is not given, all warnings are enabled.
2371 .BI .warnscale\  si
2372 Set the scaling indicator used in warnings to
2373 .IR si .
2375 Valid values for
2376 .I si
2378 .BR u ,
2379 .BR i ,
2380 .BR c ,
2381 .BR p ,
2382 and\~\c
2383 .BR P .
2385 At startup, it is set to\~\c
2386 .BR i .
2389 .BI .while \ c\ anything
2390 While condition\~\c
2391 .I c
2392 is true, accept
2393 .I anything
2394 as input;
2395 .IR c \~\c
2396 can be any condition acceptable to an
2397 .B if
2398 request;
2399 .I anything
2400 can comprise multiple lines if the first line starts with
2401 .B \[rs]{
2402 and the last line ends with
2403 .BR \[rs]} .
2404 See also the
2405 .B break
2407 .B continue
2408 requests.
2411 .BI .write\  stream\ anything
2412 Write
2413 .I anything
2414 to the stream named
2415 .IR stream .
2416 .I stream
2417 must previously have been the subject of an
2418 .B open
2419 request.
2420 .I anything
2421 is read in copy mode;
2422 a leading\~\c
2423 .B \[dq]
2424 is stripped.
2427 .BI .writec\  stream\ anything
2428 Similar to
2429 .B write
2430 but without writing a final newline.
2433 .BI .writem\  stream\ xx
2434 Write the contents of the macro or string
2435 .I xx
2436 to the stream named
2437 .IR stream .
2438 .I stream
2439 must previously have been the subject of an
2440 .B open
2441 request.
2442 .I xx
2443 is read in copy mode.
2446 .\" --------------------------------------------------------------------
2447 .SS "Extended escape sequences"
2448 .\" --------------------------------------------------------------------
2451 .BR \[rs]D' .\|.\|. '
2452 All drawing commands of groff's intermediate output are accepted.
2454 See subsection
2455 .B "Drawing Commands"
2456 below for more information.
2459 .\" --------------------------------------------------------------------
2460 .SS "Extended requests"
2461 .\" --------------------------------------------------------------------
2464 .BI .cf\  filename
2465 When used in a diversion, this embeds in the diversion an object
2466 which, when reread, will cause the contents of
2467 .I filename
2468 to be transparently copied through to the output.
2470 In UNIX troff, the contents of
2471 .I filename
2472 is immediately copied through to the output regardless of whether
2473 there is a current diversion; this behaviour is so anomalous that it
2474 must be considered a bug.
2477 .BI .de\  xx\ yy
2479 .BI .am\  xx\ yy
2481 .BI .ds\  xx\ yy
2483 .BI .as\  xx\ yy
2484 In compatibility mode, these requests behaves similar to
2485 .BR .de1 ,
2486 .BR .am1 ,
2487 .BR .ds1 ,
2489 .BR .as1 ,
2490 respectively: A `compatibility save' token is inserted at the
2491 beginning, and a `compatibility restore' token at the end, with
2492 compatibility mode switched on during execution.
2495 .BI .ev\  xx
2497 .I xx
2498 is not a number, this switches to a named environment called
2499 .IR xx .
2500 The environment should be popped with a matching
2501 .B ev
2502 request without any arguments, just as for numbered environments.
2504 There is no limit on the number of named environments; they are
2505 created the first time that they are referenced.
2508 .BI .ss\  m\ n
2509 When two arguments are given to the
2510 .B ss
2511 request, the second argument gives the
2512 .IR "sentence space size" .
2513 If the second argument is not given, the sentence space size
2514 is the same as the word space size.
2516 Like the word space size, the sentence space is in units of
2517 one twelfth of the spacewidth parameter for the current font.
2519 Initially both the word space size and the sentence
2520 space size are\~12.
2522 Contrary to UNIX troff, GNU troff handles this request in nroff mode
2523 also; a given value is then rounded down to the nearest multiple
2524 of\~12.
2526 The sentence space size is used in two circumstances.
2528 If the end of a sentence occurs at the end of a line in fill mode,
2529 then both an inter-word space and a sentence space are added; if
2530 two spaces follow the end of a sentence in the middle of a line, then
2531 the second space is a sentence space.
2533 Note that the behaviour of UNIX troff are exactly that exhibited
2534 by GNU troff if a second argument is never given to the
2535 .B ss
2536 request.
2538 In GNU troff, as in UNIX troff, you should always follow a sentence
2539 with either a newline or two spaces.
2542 .BI .ta\  n1\ n2\|.\|.\|.nn \ T\  r1\ r2\|.\|.\|.\|rn
2543 Set tabs at positions
2544 .IR n1 ,
2545 .IR n2 ,\|.\|.\|.\|,
2546 .I nn
2547 and then set tabs at
2548 .IR nn \|+\| r1 ,
2549 .IR nn \|+\| r2 ,\|.\|.\|.\|,
2550 .IR nn \|+\| rn
2551 and then at
2552 .IR nn \|+\| rn \|+\| r1 ,
2553 .IR nn \|+\| rn \|+\| r2 ,\|.\|.\|.\|,
2554 .IR nn \|+\| rn \|+\| rn ,
2555 and so on.
2556 For example,
2561 \&.ta T .5i
2565 sets tabs every half an inch.
2569 .\" --------------------------------------------------------------------
2570 .SS "New number registers"
2571 .\" --------------------------------------------------------------------
2573 The following read-only registers are available:
2576 .B \[rs]n[.br]
2577 Within a macro call, it is set to\~1 if the macro is called with the
2578 `normal' control character (`.' by default), and set to\~0 otherwise.
2579 This allows to reliably modify requests.
2583 .ne 6v+\n(.Vu
2585 \&.als bp*orig bp
2586 \&.de bp
2587 \&.tm before bp
2588 \&.ie \[rs]\[rs]n[.br] .bp*orig
2589 \&.el 'bp*orig
2590 \&.tm after bp
2591 \&..
2596 Using this register outside of a macro makes no sense (it always returns
2597 zero in such cases).
2600 .B \[rs]n[.C]
2601 1\~if compatibility mode is in effect, 0\~otherwise.
2604 .B \[rs]n[.cdp]
2605 The depth of the last glyph added to the current environment.
2607 It is positive if the glyph extends below the baseline.
2610 .B \[rs]n[.ce]
2611 The number of lines remaining to be centered, as set by the
2612 .B ce
2613 request.
2616 .B \[rs]n[.cht]
2617 The height of the last glyph added to the current environment.
2619 It is positive if the glyph extends above the baseline.
2622 .B \[rs]n[.color]
2623 1\~if colors are enabled, 0\~otherwise.
2626 .B \[rs]n[.csk]
2627 The skew of the last glyph added to the current environment.
2630 .I skew
2631 of a glyph is how far to the right of the center of a glyph
2632 the center of an accent over that glyph should be placed.
2635 .B \[rs]n[.ev]
2636 The name or number of the current environment.
2638 This is a string-valued register.
2641 .B \[rs]n[.fam]
2642 The current font family.
2644 This is a string-valued register.
2647 .B \[rs]n[.fn]
2648 The current (internal) real font name.
2650 This is a string-valued register.
2652 If the current font is a style, the value of
2653 .B \[rs]n[.fn]
2654 is the proper concatenation of family and style name.
2657 .B \[rs]n[.fp]
2658 The number of the next free font position.
2661 .B \[rs]n[.g]
2662 Always\~1.
2664 Macros should use this to determine whether they are running under GNU
2665 troff.
2668 .B \[rs]n[.height]
2669 The current height of the font as set with
2670 .BR \[rs]H .
2673 .B \[rs]n[.hla]
2674 The current hyphenation language as set by the
2675 .B hla
2676 request.
2679 .B \[rs]n[.hlc]
2680 The number of immediately preceding consecutive hyphenated lines.
2683 .B \[rs]n[.hlm]
2684 The maximum allowed number of consecutive hyphenated lines, as set by
2686 .B hlm
2687 request.
2690 .B \[rs]n[.hy]
2691 The current hyphenation flags (as set by the
2692 .B hy
2693 request).
2696 .B \[rs]n[.hym]
2697 The current hyphenation margin (as set by the
2698 .B hym
2699 request).
2702 .B \[rs]n[.hys]
2703 The current hyphenation space (as set by the
2704 .B hys
2705 request).
2708 .B \[rs]n[.in]
2709 The indentation that applies to the current output line.
2712 .B \[rs]n[.int]
2713 Set to a positive value if last output line is interrupted (i.e., if
2714 it contains
2715 .BR \[rs]c ).
2718 .B \[rs]n[.kern]
2719 1\~if pairwise kerning is enabled, 0\~otherwise.
2722 .B \[rs]n[.lg]
2723 The current ligature mode (as set by the
2724 .B lg
2725 request).
2728 .B \[rs]n[.linetabs]
2729 The current line-tabs mode (as set by the
2730 .B linetabs
2731 request).
2734 .B \[rs]n[.ll]
2735 The line length that applies to the current output line.
2738 .B \[rs]n[.lt]
2739 The title length as set by the
2740 .B lt
2741 request.
2744 .B \[rs]n[.m]
2745 The name of the current drawing color.
2747 This is a string-valued register.
2750 .B \[rs]n[.M]
2751 The name of the current background color.
2753 This is a string-valued register.
2756 .B \[rs]n[.ne]
2757 The amount of space that was needed in the last
2758 .B ne
2759 request that caused a trap to be sprung.
2761 Useful in conjunction with the
2762 .B \[rs]n[.trunc]
2763 register.
2766 .B \[rs]n[.ns]
2767 1\~if no-space mode is active, 0\~otherwise.
2770 .B \[rs]n[.pe]
2771 1\~during a page ejection caused by the
2772 .B bp
2773 request, 0\~otherwise.
2776 .B \[rs]n[.pn]
2777 The number of the next page, either the value set by a
2778 .B pn
2779 request, or the number of the current page plus\~1.
2782 .B \[rs]n[.ps]
2783 The current point size in scaled points.
2786 .B \[rs]n[.psr]
2787 The last-requested point size in scaled points.
2790 .B \[rs]n[.pvs]
2791 The current post-vertical line space as set with the
2792 .B pvs
2793 request.
2796 .B \[rs]n[.rj]
2797 The number of lines to be right-justified as set by the
2798 .B rj
2799 request.
2802 .B \[rs]n[.slant]
2803 The slant of the current font as set with
2804 .BR \[rs]S .
2807 .B \[rs]n[.sr]
2808 The last requested point size in points as a decimal fraction.
2810 This is a string-valued register.
2813 .B \[rs]n[.ss]
2815 .B \[rs]n[.sss]
2816 These give the values of the parameters set by the first and second
2817 arguments of the
2818 .B ss
2819 request.
2822 .B \[rs]n[.sty]
2823 The current font style.
2825 This is a string-valued register.
2828 .B \[rs]n[.tabs]
2829 A string representation of the current tab settings suitable for use
2830 as an argument to the
2831 .B ta
2832 request.
2835 .B \[rs]n[.trunc]
2836 The amount of vertical space truncated by the most recently sprung
2837 vertical position trap, or, if the trap was sprung by a
2838 .B ne
2839 request, minus the amount of vertical motion produced by the
2840 .B ne
2841 request.
2843 In  other  words, at the point  a  trap is  sprung,  it represents the
2844 difference of  what the vertical position  would have been but for the
2845 trap, and what the vertical position actually is.
2847 Useful in conjunction with the
2848 .B \[rs]n[.ne]
2849 register.
2852 .B \[rs]n[.U]
2853 Set to\~1 if in safer mode and to\~0 if in unsafe mode (as given with
2855 .B \-U
2856 command line option).
2859 .B \[rs]n[.vpt]
2860 1\~if vertical position traps are enabled, 0\~otherwise.
2863 .B \[rs]n[.warn]
2864 The sum of the numbers associated with each of the currently enabled
2865 warnings.
2867 The number associated with each warning is listed in
2868 .BR @g@troff (@MAN1EXT@).
2871 .B \[rs]n[.x]
2872 The major version number.
2874 For example, if the version number is 1.03, then
2875 .B \[rs]n[.x]
2876 contains\~1.
2879 .B \[rs]n[.y]
2880 The minor version number.
2882 For example, if the version number is 1.03, then
2883 .B \[rs]n[.y]
2884 contains\~03.
2887 .B \[rs]n[.Y]
2888 The revision number of groff.
2891 .B \[rs]n[.zoom]
2892 The zoom value of the current font, in multiples of 1/1000th.
2893 Zero if no magnification.
2896 .B \[rs]n[llx]
2898 .B \[rs]n[lly]
2900 .B \[rs]n[urx]
2902 .B \[rs]n[ury]
2903 These four registers are set by the
2904 .B psbb
2905 request and contain the bounding box values (in PostScript units) of a
2906 given PostScript image.
2909 The following read/\:write registers are set by the
2910 .B \[rs]w
2911 escape sequence:
2914 .B \[rs]n[rst]
2916 .B \[rs]n[rsb]
2917 Like the
2918 .B st
2920 .B sb
2921 registers, but take account of the heights and depths of glyphs.
2924 .B \[rs]n[ssc]
2925 The amount of horizontal space (possibly negative) that should be
2926 added to the last glyph before a subscript.
2929 .B \[rs]n[skw]
2930 How far to right of the center of the last glyph in the
2931 .B \[rs]w
2932 argument, the center of an accent from a roman font should be placed
2933 over that glyph.
2936 Other available read/write number registers are:
2939 .B \[rs]n[c.]
2940 The current input line number.
2941 .B \[rs]n[.c]
2942 is a read-only alias to this register.
2945 .B \[rs]n[hours]
2946 The number of hours past midnight.
2948 Initialized at start-up.
2951 .B \[rs]n[hp]
2952 The current horizontal position at input line.
2955 .B \[rs]n[minutes]
2956 The number of minutes after the hour.
2958 Initialized at start-up.
2961 .B \[rs]n[seconds]
2962 The number of seconds after the minute.
2964 Initialized at start-up.
2967 .B \[rs]n[systat]
2968 The return value of the system() function executed by the last
2969 .B sy
2970 request.
2973 .B \[rs]n[slimit]
2974 If greater than\~0, the maximum number of objects on the input stack.
2976 If less than or equal to\~0, there is no limit on the number of
2977 objects on the input stack.
2979 With no limit, recursion can continue until virtual memory is
2980 exhausted.
2983 .B \[rs]n[year]
2984 The current year.
2986 Note that the traditional
2987 .B troff
2988 number register
2989 .B \[rs]n[yr]
2990 is the current year minus 1900.
2993 .\" --------------------------------------------------------------------
2994 .SS Miscellaneous
2995 .\" --------------------------------------------------------------------
2997 .B @g@troff
2998 predefines a single (read/write) string-based register,
2999 .BR \[rs]*[.T] ,
3000 which contains the argument given to the
3001 .B \-T
3002 command line option, namely the current output device (for example,
3003 .I latin1
3005 .IR ascii ).
3006 Note that this is not the same as the (read-only) number register
3007 .B \[rs]n[.T]
3008 which is defined to be\~1 if
3009 .B troff
3010 is called with the
3011 .B \-T
3012 command line option, and zero otherwise.
3014 This behaviour is different to UNIX troff.
3017 Fonts not listed in the
3018 .SM DESC
3019 file are automatically mounted on the next available font position
3020 when they are referenced.
3022 If a font is to be mounted explicitly with the
3023 .B fp
3024 request on an unused font position, it should be mounted on the first
3025 unused font position, which can be found in the
3026 .B \[rs]n[.fp]
3027 register; although
3028 .B troff
3029 does not enforce this strictly, it does not allow a font to be mounted
3030 at a position whose number is much greater than that of any currently
3031 used position.
3034 Interpolating a string does not hide existing macro arguments.
3036 Thus in a macro, a more efficient way of doing
3039 .BI . xx\  \[rs]\[rs]$@
3044 .BI \[rs]\[rs]*[ xx ]\[rs]\[rs]  
3047 If the font description file contains pairwise kerning information,
3048 glyphs from that font are kerned.
3050 Kerning between two glyphs can be inhibited by placing a
3051 .B \[rs]&
3052 between them.
3055 In a string comparison in a condition, characters that appear at
3056 different input levels to the first delimiter character are not
3057 recognized as the second or third delimiters.
3059 This applies also to the
3060 .B tl
3061 request.
3063 In a
3064 .B \[rs]w
3065 escape sequence, a character that appears at a different input level
3066 to the starting delimiter character is not recognized as the
3067 closing delimiter character.
3069 The same is true for
3070 .BR \[rs]A ,
3071 .BR \[rs]b ,
3072 .BR \[rs]B ,
3073 .BR \[rs]C ,
3074 .BR \[rs]l ,
3075 .BR \[rs]L ,
3076 .BR \[rs]o ,
3077 .BR \[rs]X ,
3079 .BR \[rs]Z .
3081 When decoding a macro or string argument that is delimited by double
3082 quotes, a character that appears at a different input level to the starting
3083 delimiter character is not recognized as the closing delimiter
3084 character.
3086 The implementation of
3087 .B \[rs]$@
3088 ensures that the double quotes surrounding an argument appear at the
3089 same input level, which is different to the input level of the
3090 argument itself.
3092 In a long escape name
3093 .B ]
3094 is not recognized as a closing delimiter except when it occurs at
3095 the same input level as the opening\~\c
3096 .BR ] .
3098 In compatibility mode, no attention is paid to the input-level.
3101 There are some new types of condition:
3104 .BI .if\ r xxx
3105 True if there is a number register named
3106 .IR xxx .
3109 .BI .if\ d xxx
3110 True if there is a string, macro, diversion, or request named
3111 .IR xxx .
3114 .BI .if\ m xxx
3115 True if there is a color named
3116 .IR xxx .
3119 .BI .if\ c ch
3120 True if there is a character (or glyph)
3121 .IR ch
3122 available;
3123 .I ch
3124 is either an
3125 .SM ASCII
3126 character or a glyph (special character)
3127 .BI \[rs]N' xxx '\f[R],
3128 .BI \[rs]( xx
3130 .BI \[rs][ xxx ]\f[R];
3131 the condition is also true if
3132 .I ch
3133 has been defined by the
3134 .B char
3135 request.
3138 .BI .if\ F f
3139 True if font\~\c
3140 .I f
3141 exists.
3143 .BR f \~\c
3144 is handled as if it was opened with the
3145 .B ft
3146 request (this is, font translation and styles are applied), without
3147 actually mounting it.
3150 .BI .if\ S s
3151 True if style\~\c
3152 .I s
3153 has been registered.
3155 Font translation is applied.
3159 .B tr
3160 request can now map characters onto
3161 .BR \[rs]~ .
3164 The space width emitted by the
3165 .B \[rs]|
3167 .B \[rs]^
3168 escape sequences can be controlled on a per-font basis.
3169 If there is a glyph named
3170 .B \[rs]|
3172 .BR \[rs]^ ,
3173 respectively (note the leading backslash), defined in the current font file,
3174 use this glyph's width instead of the default value.
3177 It is now possible to have whitespace between the first and second dot
3178 (or the name of the ending macro) to end a macro definition.
3180 Example:
3183 .ne 6v+\n(.Vu
3185 \&.if t \[rs]{\[rs]
3186 \&.  de bar
3187 \&.    nop Hello, I'm `bar'.
3188 \&.  .
3189 \&.\[rs]}
3193 .\" --------------------------------------------------------------------
3194 .SH "INTERMEDIATE OUTPUT FORMAT"
3195 .\" --------------------------------------------------------------------
3197 This section describes the format output by GNU troff.
3199 The output format used by GNU troff is very similar to that used
3200 by Unix device-independent troff.
3202 Only the differences are documented here.
3205 .\" --------------------------------------------------------------------
3206 .SS "Units"
3207 .\" --------------------------------------------------------------------
3209 The argument to the
3210 .BR s \~\c
3211 command is in scaled points (units of
3212 .RI points/ n ,
3213 where
3214 .I n
3215 is the argument to the
3216 .B sizescale
3217 command  in the DESC file).
3219 The argument to the
3220 .B x\ Height
3221 command is also in scaled points.
3224 .\" --------------------------------------------------------------------
3225 .SS "Text Commands"
3226 .\" --------------------------------------------------------------------
3229 .BI N n
3230 Print glyph with index\~\c
3231 .I n
3232 (a non-negative integer) of the current font.
3235 If the
3236 .B tcommand
3237 line is present in the DESC file, troff uses the following two
3238 commands.
3241 .BI t xxx
3242 .I xxx
3243 is any sequence of characters terminated by a space or a newline (to
3244 be more precise, it is a sequence of glyphs which are accessed with
3245 the corresponding characters); the first character should be printed at
3246 the current position, the current horizontal position should be increased
3247 by the width of the first character, and so on for each character.
3249 The width of the glyph is that given in the font file,
3250 appropriately scaled for the current point size, and rounded so that
3251 it is a multiple of the horizontal resolution.
3253 Special characters cannot be printed using this command.
3256 .BI u n\ xxx
3257 This is same as the
3258 .BR t \~\c
3259 command except that after printing each character, the current
3260 horizontal position is increased by the sum of the width of that
3261 character and\~\c
3262 .IR n .
3265 Note that single characters can have the eighth bit set, as can the
3266 names of fonts and special characters.
3269 The names of glyphs and fonts can be of arbitrary length; drivers
3270 should not assume that they are only two characters long.
3273 When a glyph is to be printed, that glyph is always
3274 in the current font.
3276 Unlike device-independent troff, it is not necessary for drivers to
3277 search special fonts to find a glyph.
3280 For color support, some new commands have been added:
3283 \f[B]mc \f[I]cyan magenta yellow\f[R]
3285 \f[B]md\f[R]
3287 \f[B]mg \f[I]gray\f[R]
3289 \f[B]mk \f[I]cyan magenta yellow black\f[R]
3291 \f[B]mr \f[I]red green blue\f[R]
3292 Set the color components of the current drawing color, using various
3293 color schemes.
3295 .B md
3296 resets the drawing color to the default value.
3298 The arguments are integers in the range 0 to 65536.
3302 .BR x \~\c
3303 device control command has been extended.
3306 \f[B]x u \f[I]n\f[R]
3308 .I n
3309 is\~1, start underlining of spaces.
3312 .I n
3313 is\~0, stop underlining of spaces.
3315 This is needed for the
3316 .B cu
3317 request in nroff mode and is ignored otherwise.
3320 .\" --------------------------------------------------------------------
3321 .SS "Drawing Commands"
3322 .\" --------------------------------------------------------------------
3325 .B D
3326 drawing command has been extended.
3328 These extensions are not used by GNU pic if the
3329 .B \-n
3330 option is given.
3333 \f[B]Df \f[I]n\f[R]\*[ic]\[rs]n
3334 Set the shade of gray to be used for filling solid objects to
3335 .IR n ;
3336 .I n
3337 must be an integer between 0 and 1000, where 0 corresponds solid white
3338 and 1000 to solid black, and values in between correspond to
3339 intermediate shades of gray.
3341 This applies only to solid circles, solid ellipses and solid
3342 polygons.
3344 By default, a level of 1000 is used.
3346 Whatever color a solid object has, it should completely obscure
3347 everything beneath it.
3349 A value greater than 1000 or less than\~0 can also be used: this means
3350 fill with the shade of gray that is currently being used for lines and
3351 text.
3353 Normally this is black, but some drivers may provide a way of
3354 changing this.
3357 The corresponding
3358 .BI \[rs]D'f .\|.\|. '
3359 command shouldn't be used since its argument is always rounded to an
3360 integer multiple of the horizontal resolution which can lead to
3361 surprising results.
3364 \f[B]DC \f[I]d\f[R]\*[ic]\[rs]n
3365 Draw a solid circle with a diameter of
3366 .I d
3367 with the leftmost point at the current position.
3370 \f[B]DE \f[I]dx dy\f[R]\*[ic]\[rs]n
3371 Draw a solid ellipse with a horizontal diameter of
3372 .I dx
3373 and a vertical diameter of
3374 .I dy
3375 with the leftmost point at the current position.
3377 delim $$
3381 \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
3382 Draw a polygon with, for $i = 1 ,..., n+1$, the
3383 .IR i -th
3384 vertex at the current position 
3386 $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$.
3388 At the moment, GNU pic only uses this command to generate triangles
3389 and rectangles.
3392 \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
3394 Like
3395 .B Dp
3396 but draw a solid rather than outlined polygon.
3399 \f[B]Dt \f[I]n\f[R]\*[ic]\[rs]n
3400 Set the current line thickness to
3401 .IR n \~\c
3402 machine units.
3404 Traditionally Unix troff drivers use a line thickness proportional to
3405 the current point size; drivers should continue to do this if no
3406 .B Dt
3407 command has been given, or if a
3408 .B Dt
3409 command has been given with a negative value of\~\c
3410 .IR n .
3411 A zero value of\~\c
3412 .I n
3413 selects the smallest available line thickness.
3416 A difficulty arises in how the current position should be changed after
3417 the execution of these commands.
3419 This is not of great importance since the code generated by GNU pic
3420 does not depend on this.
3422 Given a drawing command of the form
3424 \f[B]\[rs]D'\f[I]c\f[R] $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ $x sub n$ $y sub n$\f[B]'\f[R]
3427 where
3428 .I c
3429 is not one of
3430 .BR c ,
3431 .BR e ,
3432 .BR l ,
3433 .BR a ,
3434 or\~\c
3435 .BR ~ ,
3436 Unix troff treats each of the $x sub i$ as a horizontal quantity,
3437 and each of the $y sub i$ as a vertical quantity and assumes that
3438 the width of the drawn object is $sum from i=1 to n x sub i$,
3439 and that the height is $sum from i=1 to n y sub i$.
3441 (The assumption about the height can be seen by examining the
3442 .B st
3444 .B sb
3445 registers after using such a
3446 .BR D \~\c
3447 command in a
3448 .B \[rs]w
3449 escape sequence).
3451 This rule also holds for all the original drawing commands with the
3452 exception of
3453 .BR De .
3454 For the sake of compatibility GNU troff also follows this rule, even
3455 though it produces an ugly result in the case of the
3456 .B Dt
3458 .BR Df ,
3459 and, to a lesser extent,
3460 .B DE
3461 commands.
3463 Thus after executing a
3464 .BR D \~\c
3465 command of the form
3467 \f[B]D\f[I]c\f[R] $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ $x sub n$ $y sub n$\[rs]n
3470 the current position should be increased by
3472 $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
3475 Another set of extensions is
3478 \f[B]DFc \f[I]cyan magenta yellow\f[R]\*[ic]\[rs]n
3480 \f[B]DFd\f[R]\*[ic]\[rs]n
3482 \f[B]DFg \f[I]gray\f[R]\*[ic]\[rs]n
3484 \f[B]DFk \f[I]cyan magenta yellow black\f[R]\*[ic]\[rs]n
3486 \f[B]DFr \f[I]red green blue\f[R]\*[ic]\[rs]n
3487 Set the color components of the filling color similar to the
3488 .BR m \~\c
3489 commands above.
3492 The current position isn't changed by those colour commands (contrary to
3493 .BR Df ).
3496 .\" --------------------------------------------------------------------
3497 .SS "Device Control Commands"
3498 .\" --------------------------------------------------------------------
3500 There is a continuation convention which permits the argument to the
3501 .B x\ X
3502 command to contain newlines: when outputting the argument to the
3503 .B x\ X
3504 command, GNU troff follows each newline in the argument with a
3505 .B +
3506 character (as usual, it terminates the entire argument with a
3507 newline); thus if the line after the line containing the
3508 .B x\ X
3509 command starts with
3510 .BR + ,
3511 then the newline ending the line containing the
3512 .B x\ X
3513 command should be treated as part of the argument to the
3514 .B x\ X
3515 command, the
3516 .B +
3517 should be ignored, and the part of the line following the
3518 .B +
3519 should be treated like the part of the line following the
3520 .B x\ X
3521 command.
3524 The first three output commands are guaranteed to be:
3526 .BI x\ T\  device
3528 .BI x\ res\  n\ h\ v
3530 .B x init
3533 .\" --------------------------------------------------------------------
3534 .SH INCOMPATIBILITIES
3535 .\" --------------------------------------------------------------------
3537 In spite of the many extensions, groff has retained compatibility to
3538 classical troff to a large degree.
3540 For the cases where the extensions lead to collisions, a special
3541 compatibility mode with the restricted, old functionality was created
3542 for groff.
3545 .\" --------------------------------------------------------------------
3546 .SS "Groff Language"
3547 .\" --------------------------------------------------------------------
3549 .I groff
3550 provides a
3551 .B compatibility mode
3552 that allows to process roff code written for classical
3553 .B troff
3554 or for other implementations of roff in a consistent way.
3557 Compatibility mode can be turned on with the
3558 .B \-C
3559 command line option, and turned on or off with the
3560 .B .cp
3561 request.
3563 The number register
3564 .B \[rs]n(.C
3565 is\~1 if compatibility mode is on, 0\~otherwise.
3568 This became necessary because the GNU concept for long names causes
3569 some incompatibilities.
3570 .I Classical troff
3571 interprets
3573 .B .dsabcd
3576 as defining a string
3577 .B ab
3578 with contents
3579 .BR cd .
3581 .IR groff
3582 mode, this is considered as a call of a macro named
3583 .BR dsabcd .
3586 Also
3587 .I classical troff
3588 interprets
3589 .B \[rs]*[
3591 .B \[rs]n[
3592 as references to a string or number register called\~\c
3593 .B [
3594 while
3595 .I groff
3596 takes this as the start of a long name.
3600 .IR "compatibility mode" ,
3601 groff interprets these things in the traditional way; so long
3602 names are not recognized.
3605 On the other hand, groff in
3606 .I GNU native mode
3607 does not allow to use the single-character escapes
3608 .B \[rs]\[rs]
3609 (backslash),
3610 .B \[rs]|
3611 (vertical bar),
3612 .B \[rs]^
3613 (caret),
3614 .B \[rs]&
3615 (ampersand),
3616 .B \[rs]{
3617 (opening brace),
3618 .B \[rs]}
3619 (closing brace),
3620 .RB ` \[rs]\  '
3621 (space),
3622 .B \[rs]'
3623 (single quote),
3624 .B \[rs]`
3625 (backquote),
3626 .B \[rs]\-
3627 (minus),
3628 .B \[rs]_
3629 (underline),
3630 .B \[rs]!\&
3631 (bang),
3632 .B \[rs]%
3633 (percent),
3635 .B \[rs]c
3636 (character\~c) in names of strings, macros, diversions, number
3637 registers, fonts or environments, whereas
3638 .I classical troff
3639 does.
3643 .B \[rs]A
3644 escape sequence can be helpful in avoiding these escape sequences in
3645 names.
3648 Fractional point sizes cause one noteworthy incompatibility.
3651 .I classical
3652 .IR troff ,
3654 .B ps
3655 request ignores scale indicators and so
3658 .B .ps\~10u
3662 sets the point size to 10\~points, whereas in groff native mode the
3663 point size is set to 10\~scaled points.
3667 .IR groff ,
3668 there is a fundamental difference between unformatted input
3669 characters, and formatted output characters (glyphs).
3671 Everything that affects how a glyph is output is
3672 stored with the glyph; once a glyph has been
3673 constructed it is unaffected by any subsequent requests that are
3674 executed, including the
3675 .BR bd ,
3676 .BR cs ,
3677 .BR tkf ,
3678 .BR tr ,
3680 .B fp
3681 requests.
3684 Normally glyphs are constructed from input characters at
3685 the moment immediately before the glyph is added to the current
3686 output line.
3688 Macros, diversions and strings are all, in fact, the same type of
3689 object; they contain lists of input characters and glyphs
3690 in any combination.
3693 Special characters can be both; before being added to the output, they
3694 act as input entities, afterwards they denote glyphs.
3697 A glyph does not behave like an input character for the
3698 purposes of macro processing; it does not inherit any of the special
3699 properties that the input character from which it was constructed
3700 might have had.
3702 The following example makes things clearer.
3707 \&.di x
3708 \[rs]\[rs]\[rs]\[rs]
3709 \&.br
3710 \&.di
3711 \&.x
3716 With
3717 .I GNU troff
3718 this is printed as
3719 .BR \[rs]\[rs] .
3720 So each pair of input backslashes
3721 \&`\[rs]\[rs]'
3722 is turned into a single output backslash glyph
3723 \&`\[rs]'
3724 and the resulting output backslashes are not interpreted as escape
3725 characters when they are reread.
3728 .I Classical troff
3729 would interpret them as escape characters when they were reread and
3730 would end up printing a single backslash `\[rs]'.
3733 In GNU, the correct way to get a printable version of the backslash
3734 character `\[rs]'
3735 is the
3736 .B \[rs](rs
3737 escape sequence, but classical troff does not provide a clean feature
3738 for getting a non-syntactical backslash.
3740 A close method is the printable version of the current escape
3741 character using the
3742 .B \[rs]e
3743 escape sequence; this works if the current escape character is not
3744 redefined.
3746 It works in both GNU mode and compatibility mode, while dirty tricks
3747 like specifying a sequence of multiple backslashes do not work
3748 reliably; for the different handling in diversions, macro definitions,
3749 or text mode quickly leads to a confusion about the necessary number of
3750 backslashes.
3753 To store an escape sequence in a diversion that is interpreted
3754 when the diversion is reread, either the traditional
3755 .B \[rs]!\&
3756 transparent output facility or the
3758 .B \[rs]?\&
3759 escape sequence can be used.
3762 .\" --------------------------------------------------------------------
3763 .SS "Intermediate Output"
3764 .\" --------------------------------------------------------------------
3766 The groff intermediate output format is in a state of evolution.
3768 So far it has some incompatibilities, but it is intended to establish
3769 a full compatibility to the classical troff output format.
3771 Actually the following incompatibilities exist:
3773 .IP \[bu] 2m
3774 The positioning after the drawing of the polygons conflicts with the
3775 classical definition.
3777 .IP \[bu] 2m
3778 The intermediate output cannot be rescaled to other devices as
3779 classical `device-independent' troff did.
3782 .\" --------------------------------------------------------------------
3783 .SH AUTHORS
3784 .\" --------------------------------------------------------------------
3786 Copyright (C) 1989, 2001, 2002, 2003, 2004, 2006, 2007, 2008
3787 Free Software Foundation, Inc.
3790 This document is distributed under the terms of the FDL (GNU Free
3791 Documentation License) version 1.1 or later.
3793 You should have received a copy of the FDL on your system, it is also
3794 available on-line at the
3795 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
3796 GNU copyleft site
3797 .UE .
3799 This document was written by James Clark, with modifications by
3800 .MT wl@gnu.org
3801 Werner Lemberg
3804 .MT bwarken@mayn.de
3805 Bernd Warken
3806 .ME .
3809 This document is part of
3810 .IR groff ,
3811 the GNU roff distribution.
3813 Formerly, the contents of this document was kept in the manual
3814 page
3815 .BR @g@troff (@MAN1EXT@).
3816 Only the parts dealing with the language aspects of the different
3817 .I roff
3818 systems were carried over into this document.
3821 .I troff
3822 command line options and warnings are still documented in
3823 .BR @g@troff (@MAN1EXT@).
3825 .\" --------------------------------------------------------------------
3826 .SH "SEE ALSO"
3827 .\" --------------------------------------------------------------------
3830 .I groff info
3831 .IR file ,
3832 cf.\&
3833 .BR info (1)
3834 presents all groff documentation within a single document.
3837 .BR groff (@MAN1EXT@)
3838 A list of all documentation around
3839 .IR groff .
3842 .BR groff (@MAN7EXT@)
3843 A description of the
3844 .I groff
3845 language, including a short, but complete reference of all predefined
3846 requests, registers, and escapes of plain
3847 .IR groff .
3848 From the command line, this is called using
3853 man 7 groff
3858 .BR roff (@MAN7EXT@)
3859 A survey of
3860 .I roff
3861 systems, including pointers to further historical documentation.
3864 .RI [ CSTR\~#54\/ ]
3866 .I Nroff/\:Troff User's Manual
3868 .I J.\& F.\& Ossanna
3869 of 1976 in the revision of
3870 .I Brian Kernighan
3871 of 1992, being the
3872 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz
3873 classical troff documentation
3874 .UE .
3876 .\" --------------------------------------------------------------------
3877 .\" Emacs variables
3878 .\" --------------------------------------------------------------------
3880 .\" Local Variables:
3881 .\" mode: nroff
3882 .\" End: