* src/libs/libgroff/string.cpp (string::remove_spaces): Fix memory
[s-roff.git] / man / groff_diff.man
blob2e013f6761c503cce2ed69193810ef1b58109ed7
1 '\" e
2 .\" The above line should force the use of eqn as a preprocessor
3 .ig
4 groff_diff.man
6 Last update:
7 08 Feb 2007 -- macro simplification by ESR.
9 This file is part of groff, the GNU roff type-setting system.
10 It is the source of the man-page groff_diff(7).
12 Copyright (C) 1989, 2001, 2002, 2003, 2004, 2006, 2007
13   Free Software Foundation, Inc.
14 written by James Clark
16 modified by Werner Lemberg <wl@gnu.org>
17             Bernd Warken <bwarken@mayn.de>
19 Permission is granted to copy, distribute and/or modify this document
20 under the terms of the GNU Free Documentation License, Version 1.1 or
21 any later version published by the Free Software Foundation; with the
22 Invariant Sections being this .ig-section and AUTHORS, with no
23 Front-Cover Texts, and with no Back-Cover Texts.
25 A copy of the Free Documentation License is included as a file called
26 FDL in the main directory of the groff source package.
30 .\" --------------------------------------------------------------------
31 .\" Local definitions
32 .\" --------------------------------------------------------------------
34 .\" define a string tx for the TeX logo
35 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
36 .el   .ds tx TeX
39 .\" from old groff_out.man
40 .ie \n(.g \
41 .  ds ic \/
42 .el \
43 .  ds ic \^
46 .\" --------------------------------------------------------------------
47 .\" Title
48 .\" --------------------------------------------------------------------
50 .TH GROFF_DIFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
51 .SH NAME
52 groff_diff \- differences between GNU troff and classical troff
55 .\" --------------------------------------------------------------------
56 .SH DESCRIPTION
57 .\" --------------------------------------------------------------------
59 This manual page describes the language differences between
60 .IR groff ,
61 the GNU
62 .I roff
63 text processing system and the classical
64 .I roff
65 formatter of the freely available Unix\~7 of the 1970s, documented in
66 the
67 .I Troff User's Manual
69 .I Osanna
70 and
71 .IR Kernighan .
72 This inludes the roff language as well as the intermediate output
73 format (troff output).
76 The section
77 .I SEE ALSO
78 gives pointers to both the classical
79 .I roff
80 and the modern
81 .I groff
82 documentation.
85 .\" --------------------------------------------------------------------
86 .SH "GROFF LANGUAGE"
87 .\" --------------------------------------------------------------------
89 In this section, all additional features of
90 .I groff
91 compared to the classical Unix\~7
92 .I troff
93 are described in detail.
96 .\" --------------------------------------------------------------------
97 .SS "Long names"
98 .\" --------------------------------------------------------------------
100 The names of number registers, fonts, strings/\:macros/\:diversions,
101 special characters (glyphs), and colors can be of any length.
103 In escape sequences, additionally to the classical
104 .BI ( xx
105 construction for a two-character name, you can use
106 .BI [ xxx ]
107 for a name of arbitrary length.
110 .BI \[rs][ xxx ]
111 Print the special character (glyph) called
112 .IR xxx .
115 .BI \[rs][ "comp1 comp2 .\|.\|." ]
116 Print composite glyph consisting of multiple components.
118 Example: `\[rs][A\~ho]' is capital letter A with ogonek which finally maps
119 to glyph name `u0041_0328'.
121 See the
122 .I groff info file
123 for details how a glyph name for a composite glyph is constructed, and
124 .BR groff_char (@MAN7EXT@)
125 for list of glyph name components used composite glyph names.
128 .BI \[rs]f[ xxx ]
129 Set font
130 .IR xxx .
132 Additionally,
133 .B \[rs]f[]
134 is a new syntax equal to
135 .BR \[rs]fP ,
136 i.e., to return to the previous font.
139 .BI \[rs]*[ "xxx arg1 arg2 .\|.\|." ]
140 Interpolate string
141 .IR xxx ,
142 taking
143 .IR arg1 ,
144 .IR arg2 ,
145 .I .\|.\|.\&
146 as arguments.
149 .BI \[rs]n[ xxx ]
150 Interpolate number register
151 .IR xxx .
154 .\" --------------------------------------------------------------------
155 .SS "Fractional pointsizes"
156 .\" --------------------------------------------------------------------
159 .I scaled point
160 is equal to
161 .B 1/sizescale
162 points, where
163 .B sizescale
164 is specified in the
165 .B DESC
166 file (1 by default).
168 There is a new scale indicator
169 .B z
170 that has the effect of multiplying by sizescale.
172 Requests and escape sequences in troff interpret arguments that
173 represent a pointsize as being in units of scaled points, but they
174 evaluate each such argument using a default scale indicator of
175 .BR z .
176 Arguments treated in this way are the argument to the
177 .B ps
178 request, the third argument to the
179 .B cs
180 request, the second and fourth arguments to the
181 .B tkf
182 request, the argument to the
183 .B \[rs]H
184 escape sequence, and those variants of the
185 .B \[rs]s
186 escape sequence that take a numeric expression as their argument.
189 For example, suppose sizescale is 1000; then a scaled point is
190 equivalent to a millipoint; the call
191 .B .ps\ 10.25
192 is equivalent to
193 .B .ps\ 10.25z
194 and so sets the pointsize to 10250 scaled points, which is equal to
195 10.25 points.
198 The number register
199 .B \[rs]n[.s]
200 returns the pointsize in points as decimal fraction.
202 There is also a new number register
203 .B \[rs]n[.ps]
204 that returns the pointsize in scaled points.
207 It would make no sense to use the
208 .B z
209 scale indicator in a numeric expression whose default scale indicator
210 was neither
211 .B u
213 .BR z ,
214 and so
215 .B troff
216 disallows this.
218 Similarly it would make no sense to use a scaling indicator other than
219 .B z
221 .B u
222 in a numeric expression whose default scale indicator was
223 .BR z ,
224 and so
225 .B troff
226 disallows this as well.
229 There is also new scale indicator\~\c
230 .B s
231 which multiplies by the number of units in a scaled point.
233 So, for example,
234 .B \[rs]n[.ps]s
235 is equal to
236 .BR 1m .
237 Be sure not to confuse the
238 .B s
240 .B z
241 scale indicators.
244 .\" --------------------------------------------------------------------
245 .SS "Numeric expressions"
246 .\" --------------------------------------------------------------------
248 Spaces are permitted in a number expression within parentheses.
251 .B M
252 indicates a scale of 100ths of an em.
253 .B f
254 indicates a scale of 65536 units, providing fractions for color
255 definitions with the
256 .B defcolor
257 request.
259 For example, 0.5f = 32768u.
262 .IB e1 >? e2
263 The maximum of
264 .I e1
266 .IR e2 .
269 .IB e1 <? e2
270 The minimum of
271 .I e1
273 .IR e2 .
276 .BI ( c ; e )
277 Evaluate
278 .I e
279 using
280 .I c
281 as the default scaling indicator.
284 .I c
285 is missing, ignore scaling indicators in the evaluation of
286 .IR e .
289 .\" --------------------------------------------------------------------
290 .SS "New escape sequences"
291 .\" --------------------------------------------------------------------
294 .BI \[rs]A' anything '
295 This expands to
296 .B 1
298 .B 0
299 resp., depending on whether
300 .I anything
301 is or is not acceptable as the name of a string, macro, diversion, number
302 register, environment, font, or color.
303 It returns\~\c
304 .B 0
306 .I anything
307 is empty.
309 This is useful if you want to lookup user input in some sort of
310 associative table.
313 .BI \[rs]B' anything '
314 This expands to
315 .B 1
317 .B 0
318 resp., depending on whether
319 .I anything
320 is or is not a valid numeric expression.
322 It returns\~\c
323 .B 0
325 .I anything
326 is empty.
329 .BI \[rs]C' xxx '
330 Typeset glyph named
331 .IR xxx .
332 Normally it is more convenient to use
333 .BI \[rs][ xxx ]\f[R].
335 .B \[rs]C
336 has the advantage that it is compatible with recent versions of
337 .SM UNIX
338 and is available in compatibility mode.
341 .B \[rs]E
342 This is equivalent to an escape character, but it is not interpreted in
343 copy-mode.
345 For example, strings to start and end superscripting could be defined
346 like this
351 \&.ds { \[rs]v'\-.3m'\[rs]s'\[rs]En[.s]*6u/10u'
352 \&.ds } \[rs]s0\[rs]v'.3m'
357 The use of
358 .B \[rs]E
359 ensures that these definitions work even if
360 .B \[rs]*{
361 gets interpreted in copy-mode (for example, by being used in a macro
362 argument).
366 .BI \[rs]F f
368 .BI \[rs]F( fm
370 .BI \[rs]F[ fam ]
371 Change font family.
373 This is the same as the
374 .B fam
375 request.
377 .B \[rs]F[]
378 switches back to the previous color (note that
379 .B \[rs]FP
380 won't work; it selects font family `P' instead).
383 .BI \[rs]m x
385 .BI \[rs]m( xx
387 .BI \[rs]m[ xxx ]
388 Set drawing color.
389 .B \[rs]m[]
390 switches back to the previous color.
393 .BI \[rs]M x
395 .BI \[rs]M( xx
397 .BI \[rs]M[ xxx ]
398 Set background color for filled objects drawn with the
399 .BI \[rs]D' .\|.\|. '
400 commands.
401 .B \[rs]M[]
402 switches back to the previous color.
405 .BI \[rs]N' n '
406 Typeset the glyph with index
407 .I n
408 in the current font.
409 .I n
410 can be any integer.
412 Most devices only have glyphs with indices between 0 and 255.
414 If the current font does not contain a glyph with that code,
415 special fonts are
416 .I not
417 searched.
420 .B \[rs]N
421 escape sequence can be conveniently used in conjunction with the
422 .B char
423 request, for example
426 .ft CB
428 \&.char \[rs][phone] \[rs]f(ZD\[rs]N'37'
433 The index of each glyph is given in the fourth column in the font
434 description file after the
435 .B charset
436 command.
438 It is possible to include unnamed glyphs in the font description
439 file by using a name of
440 .BR \-\-\- ;
442 .B \[rs]N
443 escape sequence is the only way to use these.
446 .BI \[rs]O n
448 .BI \[rs]O[ n ]
449 Suppressing troff output.
451 The escapes
452 .BR \[rs]02 ,
453 .BR \[rs]O3 ,
454 .BR \[rs]O4 ,
456 .B \[rs]O5
457 are intended for internal use by
458 .BR \%grohtml .
462 .B \[rs]O0
463 Disable any ditroff glyphs from being emitted to the device driver,
464 provided that the escape occurs at the outer level (see
465 .B \[rs]O3
467 .BR \[rs]O4 ).
470 .B \[rs]O1
471 Enable output of glyphs, provided that the escape occurs at the outer
472 level.
474 .B \[rs]O0
476 .B \[rs]O1
477 also reset the registers
478 .BR \[rs]n[opminx] ,
479 .BR \[rs]n[opminy] ,
480 .BR \[rs]n[opmaxx] ,
482 .B \[rs]n[opmaxy]
483 to\~-1.
485 These four registers mark the top left and bottom right hand corners
486 of a box which encompasses all written glyphs.
489 .B \[rs]O2
490 Provided that the escape occurs at the outer level, enable output of
491 glyphs and also write out to stderr the page number and four registers
492 encompassing the glyphs previously written since the last call to
493 .BR \[rs]O .
496 .B \[rs]O3
497 Begin a nesting level.
499 At start-up,
500 .B troff
501 is at outer level.
503 This is really an internal mechanism for
504 .B \%grohtml
505 while producing images.
507 They are generated by running the troff source through
508 .B troff
509 to the postscript device and
510 .B ghostscript
511 to produce images in PNG format.
514 .B \[rs]O3
515 escape starts a new page if the device is not html (to reduce the
516 possibility of images crossing a page boundary).
519 .B \[rs]O4
520 End a nesting level.
523 .BI \[rs]O5[ Pfilename ]
524 This escape is
525 .B \%grohtml
526 specific.
528 Provided that this escape occurs at the outer nesting level, write
529 .I filename
530 to stderr.
532 The position of the image,
533 .IR P ,
534 must be specified and must be one of l, r, c, or i (left, right,
535 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 recognised in copy mode and turned into a single internal
671 code; it is this code that terminates
672 .IR anything .
673 Thus
677 .ne 14v+\n(.Vu
678 .ft CB
680 \&.nr x 1
681 \&.nf
682 \&.di d
683 \&\[rs]?\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\c
684 \&\[rs]nx\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]?\[rs]?
685 \&.di
686 \&.nr x 2
687 \&.di e
688 \&.d
689 \&.di
690 \&.nr x 3
691 \&.di f
692 \&.e
693 \&.di
694 \&.nr x 4
695 \&.f
701 prints\~\c
702 .BR 4 .
705 .B \[rs]/
706 This increases the width of the preceding glyph so that the
707 spacing between that glyph and the following glyph is
708 correct if the following glyph is a roman glyph.
710 .if t \{\
711 .  nop For example, if an italic f is immediately followed by a roman
712 .  nop right parenthesis, then in many fonts the top right portion of
713 .  nop the f overlaps the top left of the right parenthesis
714 .  nop producing \f[I]f\f[R])\f[R], which is ugly.
715 .  nop Inserting
716 .  B \[rs]/
717 .  nop produces
718 .  ie \n(.g \f[I]f\/\f[R])\f[R]
719 .  el       \f[I]f\|\f[R])\f[R]
720 .  nop and avoids this problem.
722 It is a good idea to use this escape sequence whenever an italic
723 glyph is immediately followed by a roman glyph without any
724 intervening space.
727 .B \[rs],
728 This modifies the spacing of the following glyph so that the
729 spacing between that glyph and the preceding glyph is
730 correct if the preceding glyph is a roman glyph.
732 .if t \{\
733 .  nop For example, inserting
734 .  B \[rs],
735 .  nop between the parenthesis and the f changes
736 .  nop \f[R](\f[I]f\f[R] to
737 .  ie \n(.g \f[R](\,\f[I]f\f[R].
738 .  el       \f[R](\^\f[I]f\f[R].
740 It is a good idea to use this escape sequence whenever a roman
741 glyph is immediately followed by an italic glyph without any
742 intervening space.
745 .B \[rs])
746 Like
747 .B \[rs]&
748 except that it behaves like a character declared with the
749 .B cflags
750 request to be transparent for the purposes of end-of-sentence
751 recognition.
754 .B \[rs]~
755 This produces an unbreakable space that stretches like a normal
756 inter-word space when a line is adjusted.
759 .B \[rs]:
760 This causes the insertion of a zero-width break point.
762 It is equal to
763 .B \[rs]%
764 within a word but without insertion of a soft hyphen character.
767 .B \[rs]#
768 Everything up to and including the next newline is ignored.
770 This is interpreted in copy mode.
772 It is like
773 .B \[rs]"
774 except that
775 .B \[rs]"
776 does not ignore the terminating newline.
779 .\" --------------------------------------------------------------------
780 .SS "New requests"
781 .\" --------------------------------------------------------------------
784 .BI .aln\  xx\ yy
785 Create an alias
786 .I xx
787 for number register object named
788 .IR yy .
789 The new name and the old name are exactly equivalent.
792 .I yy
793 is undefined, a warning of type
794 .B reg
795 is generated, and the request is ignored.
798 .BI .als\  xx\ yy
799 Create an alias
800 .I xx
801 for request, string, macro, or diversion object named
802 .IR yy .
804 The new name and the old name are exactly equivalent (it is
805 similar to a hard rather than a soft link).
808 .I yy
809 is undefined, a warning of type
810 .B mac
811 is generated, and the request is ignored.
814 .BR de ,
815 .BR am ,
816 .BR di ,
817 .BR da ,
818 .BR ds ,
820 .B as
821 requests only create a new object if the name of the macro, diversion
822 or string diversion is currently undefined or if it is defined to be a
823 request; normally they modify the value of an existing object.
826 .BI .am1\  xx\ yy
827 Similar to
828 .BR .am , 
829 but compatibility mode is switched off during execution.
831 To be more precise, a `compatibility save' token is inserted at the
832 beginning of the macro addition, and a `compatibility restore' token at
833 the end.
835 As a consequence, the requests
836 .BR am ,
837 .BR am1 ,
838 .BR de ,
840 .B de1
841 can be intermixed freely since the compatibility save/\:restore tokens
842 only affect the macro parts defined by
843 .B .am1
845 .BR .ds1 .
848 .BI .ami\  xx\ yy
849 Append to macro indirectly.
851 See the
852 .B dei
853 request below for more information.
856 .BI .ami1\  xx\ yy
857 Same as the
858 .B ami
859 request but compatibility mode is switched off during execution.
862 .BI .as1\  xx\ yy
863 Similar to
864 .BR .as , 
865 but compatibility mode is switched off during expansion.
867 To be more precise, a `compatibility save' token is inserted at the
868 beginning of the string, and a `compatibility restore' token at the end.
870 As a consequence, the requests
871 .BR as ,
872 .BR as1 ,
873 .BR ds ,
875 .B ds1
876 can be intermixed freely since the compatibility save/\:restore tokens
877 only affect the (sub)strings defined by
878 .B as1
880 .BR ds1 .
883 .BI .asciify\  xx
884 This request `unformats' the diversion
885 .I xx
886 in such a way that
887 .SM ASCII
888 and space characters (and some escape sequences) that were formatted
889 and diverted into
890 .I xx
891 are treated like ordinary input characters when
892 .I xx
893 is reread.
894 Useful for diversions in conjunction with the
895 .B .writem
896 request.
898 It can be also used for gross hacks; for example, this
902 .ne 7v+\n(.Vu
903 .ft CB
905 \&.tr @.
906 \&.di x
907 \&@nr n 1
908 \&.br
909 \&.di
910 \&.tr @@
911 \&.asciify x
912 \&.x
918 sets register\~\c
919 .B n
920 to\~1.
922 Note that glyph information (font, font size, etc.) is not preserved;
924 .B .unformat
925 instead.
928 .B .backtrace
929 Print a backtrace of the input stack on stderr.
932 .BI .blm\  xx
933 Set the blank line macro to
934 .IR xx .
935 If there is a blank line macro, it is invoked when a blank line
936 is encountered instead of the usual troff behaviour.
939 .BI .box\  xx
941 .BI .boxa\  xx
942 These requests are similar to the
943 .B di
945 .B da
946 requests with the exception that a partially filled line does not
947 become part of the diversion (i.e., the diversion always starts with a
948 new line) but restored after ending the diversion, discarding the
949 partially filled line which possibly comes from the diversion.
952 .B .break
953 Break out of a while loop.
955 See also the
956 .B while
958 .B continue
959 requests.
961 Be sure not to confuse this with the
962 .B br
963 request.
966 .B .brp
967 This is the same as
968 .BR \[rs]p .
971 .BI .cflags\  n\ c1\ c2\|.\|.\|.\&
972 Characters
973 .IR c1 ,
974 .IR c2 ,\|.\|.\|.\&
975 have properties determined by
976 .IR n ,
977 which is ORed from the following:
980 .IP 1
981 The character ends sentences (initially characters
982 .B .?!\&
983 have this property).
985 .IP 2
986 Lines can be broken before the character (initially no characters have
987 this property); a line is not broken at a character with this
988 property unless the characters on each side both have non-zero
989 hyphenation codes.
990 This can be overridden with value 64.
992 .IP 4
993 Lines can be broken after the character (initially characters
994 .B \-\[rs][hy]\[rs][em]
995 have this property); a line is not broken at a character with
996 this property unless the characters on each side both have non-zero
997 hyphenation codes.
998 This can be overridden with value 64.
1000 .IP 8
1001 The character overlaps horizontally (initially characters
1002 .B \[rs][ul]\[rs][rn]\[rs][ru]\[rs][radicalex]\[rs][sqrtex]
1003 have this property).
1005 .IP 16
1006 The character overlaps vertically (initially character
1007 .B \[rs][br]
1008 has this property).
1010 .IP 32
1011 An end-of-sentence character followed by any number of characters with
1012 this property is treated as the end of a sentence if followed by
1013 a newline or two spaces; in other words the character is transparent
1014 for the purposes of end-of-sentence recognition; this is the same as
1015 having a zero space factor in \*[tx] (initially characters
1016 .B \[dq]')]*\[rs](dg\[rs](rq
1017 have this property).
1019 .IP 64
1020 Ignore hyphenation code values of the surrounding characters.
1021 Use this in combination with values 2 and\~4 (initially no characters have
1022 this property).
1026 .BI .char\  c\ string
1027 Define glyph
1028 .I c
1029 to be
1030 .IR string .
1031 Every time glyph
1032 .I c
1033 needs to be printed,
1034 .I string
1035 is processed in a temporary environment and the result is
1036 wrapped up into a single object.
1038 Compatibility mode is turned off and the escape character is
1039 set to
1040 .B \[rs]
1041 while
1042 .I string
1043 is being processed.
1045 Any emboldening, constant spacing or track kerning is applied to
1046 this object rather than to individual glyphs in
1047 .IR string .
1050 A glyph defined by this request can be used just like a normal
1051 glyph provided by the output device.
1053 In particular other characters can be translated to it with the
1054 .B tr
1055 request; it can be made the leader character by the
1056 .B lc
1057 request; repeated patterns can be drawn with the character using the
1058 .B \[rs]l
1060 .B \[rs]L
1061 escape sequences; words containing the character can be hyphenated
1062 correctly, if the
1063 .B hcode
1064 request is used to give the character a hyphenation code.
1067 There is a special anti-recursion feature: Use of glyph within the
1068 glyph's definition is handled like normal glyphs not
1069 defined with
1070 .BR char .
1072 A glyph definition can be removed with the
1073 .B rchar
1074 request.
1077 .BI .chop\  xx
1078 Chop the last element off macro, string, or diversion
1079 .IR xx .
1080 This is useful for removing the newline from the end of diversions
1081 that are to be interpolated as strings.
1084 .BI .close\  stream
1085 Close the stream named
1086 .IR stream ;
1087 .I stream
1088 will no longer be an acceptable argument to the
1089 .B write
1090 request.
1092 See the
1093 .B open
1094 request.
1097 .BI .composite\  glyph1\ glyph2
1098 Map glyph name
1099 .I glyph1
1100 to glyph name
1101 .I glyph2
1102 if it is used in
1103 .BI \[rs][ .\|.\|. ]
1104 with more than one component.
1107 .B .continue
1108 Finish the current iteration of a while loop.
1110 See also the
1111 .B while
1113 .B break
1114 requests.
1117 .BI .color\  n
1119 .I n
1120 is non-zero or missing, enable colors (this is the default), otherwise
1121 disable them.
1124 .BI .cp\  n
1126 .I n
1127 is non-zero or missing, enable compatibility mode, otherwise disable
1130 In compatibility mode, long names are not recognised, and the
1131 incompatibilities caused by long names do not arise.
1134 .BI .defcolor\  xxx\ scheme\ color_components
1135 Define color.
1136 .I scheme
1137 can be one of the following values:
1138 .B rgb
1139 (three components),
1140 .B cym
1141 (three components),
1142 .B cmyk
1143 (four components), and
1144 .B gray
1146 .B grey
1147 (one component).
1149 Color components can be given either as a hexadecimal string or as
1150 positive decimal integers in the range 0-65535.
1152 A hexadecimal string contains all color components concatenated; it
1153 must start with either
1154 .B #
1156 .BR ## .
1157 The former specifies hex values in the range 0-255 (which are
1158 internally multiplied by\~257), the latter in the range 0-65535.
1160 Examples: #FFC0CB (pink), ##ffff0000ffff (magenta).
1162 A new scaling indicator\~\c
1163 .B f
1164 has been introduced which multiplies its value by\~65536; this makes
1165 it convenient to specify color components as fractions in the range 0
1166 to\~1.
1168 Example:
1172 .ft CB
1173 \&.defcolor darkgreen rgb 0.1f 0.5f 0.2f
1179 Note that
1180 .B f
1181 is the default scaling indicator for the
1182 .B defcolor
1183 request, thus the above statement is equivalent to
1187 .ft CB
1188 \&.defcolor darkgreen rgb 0.1 0.5 0.2
1194 The color named
1195 .B default
1196 (which is device-specific) can't be redefined.
1198 It is possible that the default color for
1199 .B \[rs]M
1201 .B \[rs]m
1202 is not the same.
1205 .BI .de1\  xx\ yy
1206 Similar to
1207 .BR .de , 
1208 but compatibility mode is switched off during execution.
1210 On entry, the current compatibility mode is saved and restored at exit.
1213 .BI .dei\  xx\ yy
1214 Define macro indirectly.
1216 The following example
1220 .ne 2v+\n(.Vu
1221 .ft CB
1223 \&.ds xx aa
1224 \&.ds yy bb
1225 \&.dei xx yy
1231 is equivalent to
1235 .ft CB
1236 \&.de aa bb
1242 .BI .dei1\  xx\ yy
1243 Similar to the
1244 .B dei
1245 request but compatibility mode is switched off during execution.
1248 .BI .device\  anything
1249 This is (almost) the same as the
1250 .B \[rs]X
1251 escape.
1252 .I anything
1253 is read in copy mode; a leading\~\c
1254 .B \[dq]
1255 is stripped.
1258 .BI .devicem\  xx
1259 This is the same as the
1260 .B \[rs]Y
1261 escape (to embed the contents of a macro into the intermediate
1262 output preceded with `x\~X').
1265 .BI .do\  xxx
1266 Interpret
1267 .I .xxx
1268 with compatibility mode disabled.
1270 For example,
1275 .ft CB
1276 \&.do fam T
1281 would have the same effect as
1284 .ft CB
1285 \&.fam T
1290 except that it would work even if compatibility mode had been enabled.
1292 Note that the previous compatibility mode is restored before any files
1293 sourced by
1294 .I xxx
1295 are interpreted.
1300 .BI .ds1\  xx\ yy
1301 Similar to
1302 .BR .ds , 
1303 but compatibility mode is switched off during expansion.
1305 To be more precise, a `compatibility save' token is inserted at the
1306 beginning of the string, and a `compatibility restore' token at the end.
1309 .B .ecs
1310 Save current escape character.
1313 .B .ecr
1314 Restore escape character saved with
1315 .BR ecs .
1316 Without a previous call to
1317 .BR ecs ,
1318 .RB ` \[rs] '
1319 will be the new escape character.
1322 .BI .evc\  xx
1323 Copy the contents of environment
1324 .I xx
1325 to the current environment.
1327 No pushing or popping of environments is done.
1330 .BI .fam\  xx
1331 Set the current font family to
1332 .IR xx .
1333 The current font family is part of the current environment.
1335 .I xx
1336 is missing, switch back to previous font family.
1338 The value at start-up is `T'.
1340 See the description of the
1341 .B sty
1342 request for more information on font families.
1345 .BI .fchar\  c\ string
1346 Define fallback glyph
1347 .I c
1348 to be
1349 .IR string .
1351 The syntax of this request is the same as the
1352 .B char
1353 request; the only difference is that a glyph defined with
1354 .B char
1355 hides the glyph with the same name in the current font, whereas a
1356 glyph defined with
1357 .B fchar
1358 is checked only if the particular glyph isn't found in the current font.
1360 This test happens before checking special fonts.
1363 .BI .fcolor\  c
1364 Set the fill color to
1365 .IR c .
1367 .I c
1368 is missing,
1369 switch to the previous fill color.
1372 .BI .fschar\  f\ c\ string
1373 Define fallback glyph
1374 .I c
1375 for font
1376 .I f
1377 to be
1378 .IR string .
1380 The syntax of this request is the same as the
1381 .B char
1382 request (with an additional argument to specify the font); a glyph
1383 defined with
1384 .B fschar
1385 is searched after the list of fonts declared with the
1386 .B fspecial
1387 request but before the list of fonts declared with
1388 .BR special .
1391 .BI .fspecial\  f\ s1\ s2\|.\|.\|.\&
1392 When the current font is
1393 .IR f ,
1394 fonts
1395 .IR s1 ,
1396 .IR s2 ,\|.\|.\|.\&
1397 are special, that is, they are searched for glyphs not in
1398 the current font.
1400 Any fonts specified in the
1401 .B special
1402 request are searched after fonts specified in the
1403 .B fspecial
1404 request.
1406 Without argument, reset the list of global special fonts to be empty.
1409 .BI .ftr\  f\ g
1410 Translate font
1411 .I f
1413 .IR g .
1414 Whenever a font named
1415 .I f
1416 is referred to in an
1417 .B \[rs]f
1418 escape sequence, in the
1419 .B F
1421 .B S
1422 conditional operators, or in the
1423 .BR ft ,
1424 .BR ul ,
1425 .BR bd ,
1426 .BR cs ,
1427 .BR tkf ,
1428 .BR special ,
1429 .BR fspecial ,
1430 .BR fp ,
1432 .BR sty
1433 requests, font
1434 .I g
1435 is used.
1437 .I g
1438 is missing, or equal to
1439 .I f
1440 then font
1441 .I f
1442 is not translated.
1445 .BI .fzoom\  f\ zoom
1446 Set zoom factor
1447 .I zoom
1448 for font\~\c
1449 .IR f .
1450 .I zoom
1451 must a non-negative integer multiple of 1/1000th.
1452 If it is missing or is equal to zero, it means the same as 1000, namely no
1453 magnification.
1454 .I f\c
1455 \~must be a real font name, not a style.
1458 .BI .gcolor\  c
1459 Set the glyph color to
1460 .IR c .
1462 .I c
1463 is missing,
1464 switch to the previous glyph color.
1467 .BI .hcode \ c1\ code1\ c2\ code2\|.\|.\|.\&
1468 Set the hyphenation code of character
1469 .I c1
1471 .I code1
1472 and that of
1473 .I c2
1475 .IR code2 .
1476 A hyphenation code must be a single input character (not a special
1477 character) other than a digit or a space.
1479 Initially each lower-case letter \%a-z has a hyphenation code, which is
1480 itself, and each upper-case letter \%A-Z has a hyphenation code which is
1481 the lower-case version of itself.
1483 See also the
1484 .B hpf
1485 request.
1488 .BI .hla\  lang
1489 Set the current hyphenation language to
1490 .IR lang .
1491 Hyphenation exceptions specified with the
1492 .B hw
1493 request and hyphenation patterns specified with the
1494 .B hpf
1495 request are both associated with the current hyphenation language.
1498 .B hla
1499 request is usually invoked by the
1500 .B troffrc
1501 file.
1504 .BI .hlm\  n
1505 Set the maximum number of consecutive hyphenated lines to\~\c
1506 .IR n .
1508 .I n
1509 is negative, there is no maximum.
1511 The default value is\~\-1.
1513 This value is associated with the current environment.
1515 Only lines output from an environment count towards the maximum
1516 associated with that environment.
1518 Hyphens resulting from
1519 .B \[rs]%
1520 are counted; explicit hyphens are not.
1523 .BI .hpf\  file
1524 Read hyphenation patterns from
1525 .IR file ;
1526 this is searched for in the same way that
1527 .IB name .tmac
1528 is searched for when the
1529 .BI \-m name
1530 option is specified.
1532 It should have the same format as (simple) \*[tx] patterns files.
1534 More specifically, the following scanning rules are implemented.
1537 .IP \[bu]
1538 A percent sign starts a comment (up to the end of the line) even if
1539 preceded by a backslash.
1541 .IP \[bu]
1542 No support for `digraphs' like
1543 .BR \[rs]$ .
1545 .IP \[bu]
1546 .BI ^^ xx
1547 .RI ( x
1548 is 0-9 or a-f) and
1549 .BI ^^ x
1550 (character code of\~\c
1551 .I x
1552 in the range 0-127) are recognized; other use of
1553 .B ^
1554 causes an error.
1556 .IP \[bu]
1557 No macro expansion.
1559 .IP \[bu]
1560 .B hpf
1561 checks for the expression
1562 .B \[rs]patterns{.\|.\|.}
1563 (possibly with whitespace before and after the braces).
1565 Everything between the braces is taken as hyphenation patterns.
1567 Consequently,
1568 .B {
1570 .B }
1571 are not allowed in patterns.
1573 .IP \[bu]
1574 Similarly,
1575 .B \[rs]hyphenation{.\|.\|.}
1576 gives a list of hyphenation exceptions.
1578 .IP \[bu]
1579 .B \[rs]endinput
1580 is recognized also.
1582 .IP \[bu]
1583 For backwards compatibility, if
1584 .B \[rs]patterns
1585 is missing, the whole file is treated as a list of hyphenation patterns
1586 (only recognizing the
1587 .BR % \~\c
1588 character as the start of a comment).
1592 Use the
1593 .B hpfcode
1594 request to map the encoding used in hyphenation patterns files to
1595 .BR groff 's
1596 input encoding.
1598 The set of hyphenation patterns is associated with the current language
1599 set by the
1600 .B hla
1601 request.
1604 .B hpf
1605 request is usually invoked by the
1606 .B troffrc
1607 file; a second call replaces the old patterns with the new ones.
1610 .BI .hpfa\  file
1611 The same as
1612 .B hpf
1613 except that the hyphenation patterns from
1614 .I file
1615 are appended to the patterns already loaded in the current language.
1618 .BI .hpfcode\  a\ b\ c\ d\ .\|.\|.
1619 After reading a hyphenation patterns file with the
1620 .B hpf
1622 .B hpfa
1623 request, convert all characters with character code\~\c
1624 .I a
1625 in the recently read patterns to character code\~\c
1626 .IR b ,
1627 character code\~\c
1628 .I c
1629 to\~\c
1630 .IR d ,
1631 etc.
1633 Initially, all character codes map to themselves.
1635 The arguments of
1636 .B hpfcode
1637 must be integers in the range 0 to\~255.
1639 Note that it is even possible to use character codes which are invalid in
1640 .B groff
1641 otherwise.
1644 .BI .hym\  n
1645 Set the
1646 .I hyphenation margin
1647 to\~\c
1648 .IR n :
1649 when the current adjustment mode is not\~\c
1650 .BR b ,
1651 the line is not hyphenated if the line is no more than
1652 .I n
1653 short.
1655 The default hyphenation margin is\~0.
1657 The default scaling indicator for this request is\~\c
1658 .IR m .
1659 The hyphenation margin is associated with the current environment.
1661 The current hyphenation margin is available in the
1662 .B \[rs]n[.hym]
1663 register.
1666 .BI .hys\  n
1667 Set the
1668 .I hyphenation space
1669 to\~\c
1670 .IR n :
1671 when the current adjustment mode is\~\c
1672 .B b
1673 don't hyphenate the line if the line can be justified by adding no
1674 more than
1675 .I n
1676 extra space to each word space.
1678 The default hyphenation space is\~0.
1680 The default scaling indicator for this request is\~\c
1681 .BR m .
1682 The hyphenation space is associated with the current environment.
1684 The current hyphenation space is available in the
1685 .B \[rs]n[.hys]
1686 register.
1689 .BI .itc\  n\ macro
1690 Variant of
1691 .B .it
1692 for which a line interrupted with
1693 .B \[rs]c
1694 counts as one input line.
1697 .BI .kern\  n
1699 .I n
1700 is non-zero or missing, enable pairwise kerning, otherwise disable it.
1703 .BI .length\  xx\ string
1704 Compute the length of
1705 .I string
1706 and return it in the number register
1707 .I xx
1708 (which is not necessarily defined before).
1711 .BI .linetabs\  n
1713 .I n
1714 is non-zero or missing, enable line-tabs mode, otherwise disable it
1715 (which is the default).
1717 In line-tabs mode, tab distances are computed relative to the
1718 (current) output line.
1720 Otherwise they are taken relative to the input line.
1722 For example, the following
1726 .ne 6v+\n(.Vu
1727 .ft CB
1729 \&.ds x a\[rs]t\[rs]c
1730 \&.ds y b\[rs]t\[rs]c
1731 \&.ds z c
1732 \&.ta 1i 3i
1733 \&\[rs]*x
1734 \&\[rs]*y
1735 \&\[rs]*z
1741 yields
1745 a         b         c
1749 In line-tabs mode, the same code gives
1753 a         b                   c
1757 Line-tabs mode is associated with the current environment; the
1758 read-only number register
1759 .B \[rs]n[.linetabs]
1760 is set to\~1 if in line-tabs mode, and 0 otherwise.
1763 .BI .mso\  file
1764 The same as the
1765 .B so
1766 request except that
1767 .I file
1768 is searched for in the same directories as macro files for the the
1769 .B \-m
1770 command line option.
1772 If the file name to be included has the form
1773 .IB name .tmac
1774 and it isn't found,
1775 .B mso
1776 tries to include
1777 .BI tmac. name
1778 instead and vice versa.
1781 .BI .nop \ anything
1782 Execute
1783 .IR anything .
1784 This is similar to `.if\ 1'.
1787 .B .nroff
1788 Make the
1789 .B n
1790 built-in condition true and the
1791 .B t
1792 built-in condition false.
1794 This can be reversed using the
1795 .B troff
1796 request.
1799 .BI .open\  stream\ filename
1800 Open
1801 .I filename
1802 for writing and associate the stream named
1803 .I stream
1804 with it.
1806 See also the
1807 .B close
1809 .B write
1810 requests.
1812 .TP 
1813 .BI .opena\  stream\ filename
1814 Like
1815 .BR open ,
1816 but if
1817 .I filename
1818 exists, append to it instead of truncating it.
1821 .BI .output\  string
1822 Emit
1823 .I string
1824 directly to the intermediate output (subject to copy-mode interpretation);
1825 this is similar to
1826 .B \[rs]!
1827 used at the top level.
1829 An initial double quote in
1830 .I string
1831 is stripped off to allow initial blanks.
1834 .B .pev
1835 Print the current environment and each defined environment state on
1836 stderr.
1839 .B .pnr
1840 Print the names and contents of all currently defined number registers
1841 on stderr.
1844 .BI .psbb \ filename
1845 Get the bounding box of a PostScript image
1846 .IR filename .
1847 This file must conform to Adobe's Document Structuring Conventions;
1848 the command looks for a
1849 .B \%%%BoundingBox
1850 comment to extract the bounding box values.
1852 After a successful call, the coordinates (in PostScript units) of the
1853 lower left and upper right corner can be found in the registers
1854 .BR \[rs]n[llx] ,
1855 .BR \[rs]n[lly] ,
1856 .BR \[rs]n[urx] ,
1858 .BR \[rs]n[ury] ,
1859 respectively.
1861 If some error has occurred, the four registers are set to zero.
1864 .BI .pso \ command
1865 This behaves like the
1866 .B so
1867 request except that input comes from the standard output of
1868 .IR command .
1871 .B .ptr
1872 Print the names and positions of all traps (not including input line
1873 traps and diversion traps) on stderr.
1875 Empty slots in the page trap list are printed as well, because they
1876 can affect the priority of subsequently planted traps.
1879 .BI .pvs \ \[+-]n
1880 Set the post-vertical line space to
1881 .IR n ;
1882 default scale indicator is\~\c
1883 .BR p .
1885 This value is added to each line after it has been output.
1887 With no argument, the post-vertical line space is set to its previous
1888 value.
1891 The total vertical line spacing consists of four components:
1892 .B .vs
1894 .B \[rs]x
1895 with a negative value which are applied before the line is output, and
1896 .B .pvs
1898 .B \[rs]x
1899 with a positive value which are applied after the line is output.
1902 .BI .rchar\  c1\ c2\|.\|.\|.\&
1903 Remove the definitions of glyphs
1904 .IR c1 ,
1905 .IR c2 ,\|.\|.\|.
1906 This undoes the effect of a
1907 .B char
1908 request.
1911 .B .return
1912 Within a macro, return immediately.
1914 If called with an argument, return twice, namely from the current macro and
1915 from the macro one level higher.
1917 No effect otherwise.
1920 .BI .rfschar\  c1\ c2\|.\|.\|.\&
1921 Remove the font-specific definitions of glyphs
1922 .IR c1 ,
1923 .IR c2 ,\|.\|.\|.
1924 This undoes the effect of a
1925 .B fschar
1926 request.
1929 .B .rj
1931 .BI .rj \~n
1932 Right justify the next
1933 .IR n \~\c
1934 input lines.
1936 Without an argument right justify the next input line.
1938 The number of lines to be right justified is available in the
1939 .B \[rs]n[.rj]
1940 register.
1942 This implicitly does
1943 .BR .ce \~0 .
1945 .B ce
1946 request implicitly does
1947 .BR .rj \~0 .
1950 .BI .rnn \ xx\ yy
1951 Rename number register
1952 .I xx
1954 .IR yy .
1957 .BI .schar\  c\ string
1958 Define global fallback glyph
1959 .I c
1960 to be
1961 .IR string .
1963 The syntax of this request is the same as the
1964 .B char
1965 request; a glyph defined with
1966 .B schar
1967 is searched after the list of fonts declared with the
1968 .B special
1969 request but before the mounted special fonts.
1972 .BI .shc\  c
1973 Set the soft hyphen character to
1974 .IR c .
1976 .I c
1977 is omitted, the soft hyphen character is set to the default
1978 .BR \[rs](hy .
1979 The soft hyphen character is the glyph which is inserted when
1980 a word is hyphenated at a line break.
1982 If the soft hyphen character does not exist in the font of the
1983 glyph immediately preceding a potential break point, then the line
1984 is not broken at that point.
1986 Neither definitions (specified with the
1987 .B char
1988 request) nor translations (specified with the
1989 .B tr
1990 request) are considered when finding the soft hyphen character.
1993 .BI .shift\  n
1994 In a macro, shift the arguments by
1995 .I n
1996 positions: argument\~\c
1997 .I i
1998 becomes argument
1999 .IR i \- n ;
2000 arguments 1 to\~\c
2001 .I n
2002 are no longer available.
2005 .I n
2006 is missing, arguments are shifted by\~1.
2008 Shifting by negative amounts is currently undefined.
2011 .BI .sizes\  s1\ s2\|.\|.\|.\|sn\  [0]
2012 This command is similar to the
2013 .B sizes
2014 command of a
2015 .B DESC
2016 file.
2018 It sets the available font sizes for the current font to
2019 .IR s1 ,
2020 .IR s2 ,\|.\|.\|.\|,\~ sn
2021 scaled points.
2023 The list of sizes can be terminated by an optional\~\c
2024 .BR 0 .
2026 Each
2027 .I si
2028 can also be a range of sizes
2029 .IR m - n .
2031 Contrary to the font file command, the list can't extend over more
2032 than a single line.
2035 .BI .special\  s1\ s2\|.\|.\|.\&
2036 Fonts
2037 .IR s1 ,
2038 .IR s2 ,
2039 are special and are searched for glyphs not in the current
2040 font.
2042 Without arguments, reset the list of special fonts to be empty.
2045 .BI .spreadwarn\  limit
2046 Make
2047 .B troff
2048 emit a warning if the additional space inserted for each space between
2049 words in an output line is larger or equal to
2050 .IR limit .
2052 A negative value is changed to zero; no argument toggles the warning on
2053 and off without changing
2054 .IR limit .
2056 The default scaling indicator is\~\c
2057 .BR m .
2059 At startup,
2060 .B spreadwarn
2061 is deactivated, and
2062 .I limit
2063 is set to 3m.
2065 For example,
2066 .B .spreadwarn\ 0.2m
2067 causes a warning if
2068 .B troff
2069 must add 0.2m or more for each interword space in a line.
2071 This request is active only if text is justified to both margins (using
2072 .BR .ad\ b ).
2075 .BI .sty\  n\ f
2076 Associate style\~\c
2077 .I f
2078 with font position\~\c
2079 .IR n .
2080 A font position can be associated either with a font or with a style.
2082 The current font is the index of a font position and so is also either
2083 a font or a style.
2085 When it is a style, the font that is actually used is the font the
2086 name of which is the concatenation of the name of the current family
2087 and the name of the current style.
2089 For example, if the current font is\~1 and font position\~1 is
2090 associated with style\~\c
2091 .B R
2092 and the current font family is\~\c
2093 .BR T ,
2094 then font
2095 .BR TR
2096 is used.
2098 If the current font is not a style, then the current family is ignored.
2100 When the requests
2101 .BR cs ,
2102 .BR bd ,
2103 .BR tkf ,
2104 .BR uf ,
2106 .B fspecial
2107 are applied to a style, then they are applied instead to the
2108 member of the current family corresponding to that style.
2110 The default family can be set with the
2111 .B \-f
2112 option.
2115 .B styles
2116 command in the
2117 .SM DESC
2118 file controls which font positions (if any) are initially associated
2119 with styles rather than fonts.
2122 .BI .substring\  xx\ n1\  [ n2 ]
2123 Replace the string named
2124 .I xx
2125 with the substring defined by the indices
2126 .I n1
2128 .IR n2 .
2129 The first character in the string has index\~0.
2132 .I n2
2133 is omitted, it is taken to be equal to the string's length.
2135 If the index value
2136 .I n1
2138 .I n2
2139 is negative, it is counted from the end of the string,
2140 going backwards:
2142 The last character has index\~-1, the character before the last
2143 character has index\~-2, etc.
2146 .BI .tkf\  f\ s1\ n1\ s2\ n2
2147 Enable track kerning for font
2148 .IR f .
2149 When the current font is
2150 .I f
2151 the width of every glyph is increased by an amount between
2152 .I n1
2154 .IR n2 ;
2155 when the current point size is less than or equal to
2156 .I s1
2157 the width is increased by
2158 .IR n1 ;
2159 when it is greater than or equal to
2160 .I s2
2161 the width is increased by
2162 .IR n2 ;
2163 when the point size is greater than or equal to
2164 .I s1
2165 and less than or equal to
2166 .I s2
2167 the increase in width is a linear function of the point size.
2170 .BI .tm1\  string
2171 Similar to the
2172 .B tm
2173 request,
2174 .I string
2175 is read in copy mode and written on the standard error, but an initial
2176 double quote in
2177 .I string
2178 is stripped off to allow initial blanks.
2181 .BI .tmc\  string
2182 Similar to
2183 .B tm1
2184 but without writing a final newline.
2187 .BI .trf\  filename
2188 Transparently output the contents of file
2189 .IR filename .
2190 Each line is output as if preceded by
2191 .BR \[rs]! ;
2192 however, the lines are not subject to copy-mode interpretation.
2194 If the file does not end with a newline, then a newline is added.
2196 For example, you can define a macro\~\c
2197 .I x
2198 containing the contents of file\~\c
2199 .IR f ,
2200 using
2204 .ne 2v+\n(.Vu
2205 .ft CB
2207 \&.di x
2208 \&.trf f
2209 \&.di
2215 Unlike with the
2216 .B cf
2217 request, the file cannot contain characters such as
2218 .SM NUL
2219 that are not valid troff input characters.
2222 .BI .trin\  abcd
2223 This is the same as the
2224 .B tr
2225 request except that the
2226 .B asciify
2227 request uses the character code (if any) before the character
2228 translation.
2230 Example:
2235 .ft CB
2236 \&.trin ax
2237 \&.di xxx
2239 \&.br
2240 \&.di
2241 \&.xxx
2242 \&.trin aa
2243 \&.asciify xxx
2244 \&.xxx
2250 The result is
2251 .BR x\ a .
2253 Using
2254 .BR tr ,
2255 the result would be
2256 .BR x\ x .
2259 .BI .trnt\  abcd
2260 This is the same as the
2261 .B tr
2262 request except that the translations do not apply to text that is
2263 transparently throughput into a diversion with
2264 .BR \[rs]! .
2265 For example,
2270 .ft CB
2271 \&.tr ab
2272 \&.di x
2273 \&\[rs]!.tm a
2274 \&.di
2275 \&.x
2281 prints\~\c
2282 .BR b ;
2284 .B trnt
2285 is used instead of
2286 .B tr
2287 it prints\~\c
2288 .BR a .
2292 .B .troff
2293 Make the
2294 .B n
2295 built-in condition false, and the
2296 .B t
2297 built-in condition true.
2299 This undoes the effect of the
2300 .B nroff
2301 request.
2304 .BI .unformat\  xx
2305 This request `unformats' the diversion
2306 .IR xx .
2307 Contrary to the
2308 .B .asciify
2309 request, which tries to convert formatted elements of the diversion
2310 back to input tokens as much as possible,
2311 .B .unformat
2312 only handles tabs and spaces between words (usually caused by
2313 spaces or newlines in the input) specially.
2315 The former are treated as if they were input tokens, and the latter
2316 are stretchable again.
2318 Note that the vertical size of lines is not preserved.
2320 Glyph information (font, font size, space width, etc.) is retained.
2322 Useful in conjunction with the
2323 .B .box
2325 .B .boxa
2326 requests.
2329 .BI .vpt\  n
2330 Enable vertical position traps if
2331 .I n
2332 is non-zero, disable them otherwise.
2334 Vertical position traps are traps set by the
2335 .B wh
2337 .B dt
2338 requests.
2340 Traps set by the
2341 .B it
2342 request are not vertical position traps.
2344 The parameter that controls whether vertical position traps are
2345 enabled is global.
2347 Initially vertical position traps are enabled.
2350 .BI .warn\  n
2351 Control warnings.
2352 .I n
2353 is the sum of the numbers associated with each warning that is to be
2354 enabled; all other warnings are disabled.
2356 The number associated with each warning is listed in
2357 .BR @g@troff (@MAN1EXT@).
2359 For example,
2360 .B .warn\~0
2361 disables all warnings, and
2362 .B .warn\~1
2363 disables all warnings except that about missing glyphs.
2366 .I n
2367 is not given, all warnings are enabled.
2370 .BI .warnscale\  si
2371 Set the scaling indicator used in warnings to
2372 .IR si .
2374 Valid values for
2375 .I si
2377 .BR u ,
2378 .BR i ,
2379 .BR c ,
2380 .BR p ,
2382 .BR P .
2384 At startup, it is set to\~\c
2385 .BR i .
2388 .BI .while \ c\ anything
2389 While condition\~\c
2390 .I c
2391 is true, accept
2392 .I anything
2393 as input;
2394 .IR c \~\c
2395 can be any condition acceptable to an
2396 .B if
2397 request;
2398 .I anything
2399 can comprise multiple lines if the first line starts with
2400 .B \[rs]{
2401 and the last line ends with
2402 .BR \[rs]} .
2403 See also the
2404 .B break
2406 .B continue
2407 requests.
2410 .BI .write\  stream\ anything
2411 Write
2412 .I anything
2413 to the stream named
2414 .IR stream .
2415 .I stream
2416 must previously have been the subject of an
2417 .B open
2418 request.
2419 .I anything
2420 is read in copy mode;
2421 a leading\~\c
2422 .B \[dq]
2423 is stripped.
2426 .BI .writec\  stream\ anything
2427 Similar to
2428 .B write
2429 but without writing a final newline.
2432 .BI .writem\  stream\ xx
2433 Write the contents of the macro or string
2434 .I xx
2435 to the stream named
2436 .IR stream .
2437 .I stream
2438 must previously have been the subject of an
2439 .B open
2440 request.
2441 .I xx
2442 is read in copy mode.
2445 .\" --------------------------------------------------------------------
2446 .SS "Extended escape sequences"
2447 .\" --------------------------------------------------------------------
2450 .BI \[rs]D' .\|.\|. '
2451 All drawing commands of groff's intermediate output are accepted.
2453 See subsection
2454 .B "Drawing Commands"
2455 below for more information.
2458 .\" --------------------------------------------------------------------
2459 .SS "Extended requests"
2460 .\" --------------------------------------------------------------------
2463 .BI .cf\  filename
2464 When used in a diversion, this embeds in the diversion an object
2465 which, when reread, will cause the contents of
2466 .I filename
2467 to be transparently copied through to the output.
2469 In UNIX troff, the contents of
2470 .I filename
2471 is immediately copied through to the output regardless of whether
2472 there is a current diversion; this behaviour is so anomalous that it
2473 must be considered a bug.
2476 .BI .de\  xx\ yy
2478 .BI .am\  xx\ yy
2480 .BI .ds\  xx\ yy
2482 .BI .as\  xx\ yy
2483 In compatibility mode, these requests behaves similar to
2484 .BR .de1 ,
2485 .BR .am1 ,
2486 .BR .ds1 ,
2488 .BR .as1 ,
2489 respectively: A `compatibility save' token is inserted at the
2490 beginning, and a `compatibility restore' token at the end, with
2491 compatibility mode switched on during execution.
2494 .BI .ev\  xx
2496 .I xx
2497 is not a number, this switches to a named environment called
2498 .IR xx .
2499 The environment should be popped with a matching
2500 .B ev
2501 request without any arguments, just as for numbered environments.
2503 There is no limit on the number of named environments; they are
2504 created the first time that they are referenced.
2507 .BI .ss\  m\ n
2508 When two arguments are given to the
2509 .B ss
2510 request, the second argument gives the
2511 .IR "sentence space size" .
2512 If the second argument is not given, the sentence space size
2513 is the same as the word space size.
2515 Like the word space size, the sentence space is in units of
2516 one twelfth of the spacewidth parameter for the current font.
2518 Initially both the word space size and the sentence
2519 space size are\~12.
2521 Contrary to UNIX troff, GNU troff handles this request in nroff mode
2522 also; a given value is then rounded down to the nearest multiple
2523 of\~12.
2525 The sentence space size is used in two circumstances.
2527 If the end of a sentence occurs at the end of a line in fill mode,
2528 then both an inter-word space and a sentence space are added; if
2529 two spaces follow the end of a sentence in the middle of a line, then
2530 the second space is a sentence space.
2532 Note that the behaviour of UNIX troff are exactly that exhibited
2533 by GNU troff if a second argument is never given to the
2534 .B ss
2535 request.
2537 In GNU troff, as in UNIX troff, you should always follow a sentence
2538 with either a newline or two spaces.
2541 .BI .ta\  n1\ n2\|.\|.\|.nn \ T\  r1\ r2\|.\|.\|.\|rn
2542 Set tabs at positions
2543 .IR n1 ,
2544 .IR n2 ,\|.\|.\|.\|,
2545 .I nn
2546 and then set tabs at
2547 .IR nn + r1 ,
2548 .IR nn + r2 ,\|.\|.\|.\|,
2549 .IR nn + rn
2550 and then at
2551 .IR nn + rn + r1 ,
2552 .IR nn + rn + r2 ,\|.\|.\|.\|,
2553 .IR nn + rn + rn ,
2554 and so on.
2555 For example,
2559 .ft CB
2560 \&.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
2584 .ft CB
2586 \&.als bp*orig bp
2587 \&.de bp
2588 \&.tm before bp
2589 \&.ie \[rs]\[rs]n[.br] .bp*orig
2590 \&.el 'bp*orig
2591 \&.tm after bp
2592 \&..
2597 Using this register outside of a macro makes no sense (it always returns
2598 zero in such cases).
2601 .B \[rs]n[.C]
2602 1\~if compatibility mode is in effect, 0\~otherwise.
2605 .B \[rs]n[.cdp]
2606 The depth of the last glyph added to the current environment.
2608 It is positive if the glyph extends below the baseline.
2611 .B \[rs]n[.ce]
2612 The number of lines remaining to be centered, as set by the
2613 .B ce
2614 request.
2617 .B \[rs]n[.cht]
2618 The height of the last glyph added to the current environment.
2620 It is positive if the glyph extends above the baseline.
2623 .B \[rs]n[.color]
2624 1\~if colors are enabled, 0\~otherwise.
2627 .B \[rs]n[.csk]
2628 The skew of the last glyph added to the current environment.
2631 .I skew
2632 of a glyph is how far to the right of the center of a glyph
2633 the center of an accent over that glyph should be placed.
2636 .B \[rs]n[.ev]
2637 The name or number of the current environment.
2639 This is a string-valued register.
2642 .B \[rs]n[.fam]
2643 The current font family.
2645 This is a string-valued register.
2648 .B \[rs]n[.fn]
2649 The current (internal) real font name.
2651 This is a string-valued register.
2653 If the current font is a style, the value of
2654 .B \[rs]n[.fn]
2655 is the proper concatenation of family and style name.
2658 .B \[rs]n[.fp]
2659 The number of the next free font position.
2662 .B \[rs]n[.g]
2663 Always\~1.
2665 Macros should use this to determine whether they are running under GNU
2666 troff.
2669 .B \[rs]n[.height]
2670 The current height of the font as set with
2671 .BR \[rs]H .
2674 .B \[rs]n[.hla]
2675 The current hyphenation language as set by the
2676 .B hla
2677 request.
2680 .B \[rs]n[.hlc]
2681 The number of immediately preceding consecutive hyphenated lines.
2684 .B \[rs]n[.hlm]
2685 The maximum allowed number of consecutive hyphenated lines, as set by
2687 .B hlm
2688 request.
2691 .B \[rs]n[.hy]
2692 The current hyphenation flags (as set by the
2693 .B hy
2694 request).
2697 .B \[rs]n[.hym]
2698 The current hyphenation margin (as set by the
2699 .B hym
2700 request).
2703 .B \[rs]n[.hys]
2704 The current hyphenation space (as set by the
2705 .B hys
2706 request).
2709 .B \[rs]n[.in]
2710 The indent that applies to the current output line.
2713 .B \[rs]n[.int]
2714 Set to a positive value if last output line is interrupted (i.e., if
2715 it contains
2716 .IR \[rs]c ).
2719 .B \[rs]n[.kern]
2720 1\~if pairwise kerning is enabled, 0\~otherwise.
2723 .B \[rs]n[.lg]
2724 The current ligature mode (as set by the
2725 .B lg
2726 request).
2729 .B \[rs]n[.linetabs]
2730 The current line-tabs mode (as set by the
2731 .B linetabs
2732 request).
2735 .B \[rs]n[.ll]
2736 The line length that applies to the current output line.
2739 .B \[rs]n[.lt]
2740 The title length as set by the
2741 .B lt
2742 request.
2745 .B \[rs]n[.m]
2746 The name of the current drawing color.
2748 This is a string-valued register.
2751 .B \[rs]n[.M]
2752 The name of the current background color.
2754 This is a string-valued register.
2757 .B \[rs]n[.ne]
2758 The amount of space that was needed in the last
2759 .B ne
2760 request that caused a trap to be sprung.
2762 Useful in conjunction with the
2763 .B \[rs]n[.trunc]
2764 register.
2767 .B \[rs]n[.ns]
2768 1\~if no-space mode is active, 0\~otherwise.
2771 .B \[rs]n[.pe]
2772 1\~during a page ejection caused by the
2773 .B bp
2774 request, 0\~otherwise.
2777 .B \[rs]n[.pn]
2778 The number of the next page, either the value set by a
2779 .B pn
2780 request, or the number of the current page plus\~1.
2783 .B \[rs]n[.ps]
2784 The current pointsize in scaled points.
2787 .B \[rs]n[.psr]
2788 The last-requested pointsize in scaled points.
2791 .B \[rs]n[.pvs]
2792 The current post-vertical line space as set with the
2793 .B pvs
2794 request.
2797 .B \[rs]n[.rj]
2798 The number of lines to be right-justified as set by the
2799 .B rj
2800 request.
2803 .B \[rs]n[.slant]
2804 The slant of the current font as set with
2805 .BR \[rs]S .
2808 .B \[rs]n[.sr]
2809 The last requested pointsize in points as a decimal fraction.
2811 This is a string-valued register.
2814 .B \[rs]n[.ss]
2816 .B \[rs]n[.sss]
2817 These give the values of the parameters set by the first and second
2818 arguments of the
2819 .B ss
2820 request.
2823 .B \[rs]n[.sty]
2824 The current font style.
2826 This is a string-valued register.
2829 .B \[rs]n[.tabs]
2830 A string representation of the current tab settings suitable for use
2831 as an argument to the
2832 .B ta
2833 request.
2836 .B \[rs]n[.trunc]
2837 The amount of vertical space truncated by the most recently sprung
2838 vertical position trap, or, if the trap was sprung by a
2839 .B ne
2840 request, minus the amount of vertical motion produced by the
2841 .B ne
2842 request.
2844 In  other  words, at the point  a  trap is  sprung,  it represents the
2845 difference of  what the vertical position  would have been but for the
2846 trap, and what the vertical position actually is.
2848 Useful in conjunction with the
2849 .B \[rs]n[.ne]
2850 register.
2853 .B \[rs]n[.U]
2854 Set to 1 if in safer mode and to 0 if in unsafe mode (as given with the
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 recognised 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 recognised 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 recognised 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
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 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
3140 .I f
3141 exists.
3143 .B f
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
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 It is now possible to have whitespace between the first and second dot
3165 (or the name of the ending macro) to end a macro definition.
3167 Example:
3170 .ne 6v+\n(.Vu
3171 .ft CB
3173 \&.if t \[rs]{\[rs]
3174 \&.  de bar
3175 \&.    nop Hello, I'm `bar'.
3176 \&.  .
3177 \&.\[rs]}
3181 .\" --------------------------------------------------------------------
3182 .SH "INTERMEDIATE OUTPUT FORMAT"
3183 .\" --------------------------------------------------------------------
3185 This section describes the format output by GNU troff.
3187 The output format used by GNU troff is very similar to that used
3188 by Unix device-independent troff.
3190 Only the differences are documented here.
3193 .\" --------------------------------------------------------------------
3194 .SS "Units"
3195 .\" --------------------------------------------------------------------
3197 The argument to the
3198 .B s
3199 command is in scaled points (units of
3200 .RI points/ n ,
3201 where
3202 .I n
3203 is the argument to the
3204 .B sizescale
3205 command  in the DESC file).
3207 The argument to the
3208 .B x\ Height
3209 command is also in scaled points.
3212 .\" --------------------------------------------------------------------
3213 .SS "Text Commands"
3214 .\" --------------------------------------------------------------------
3217 .BI N n
3218 Print glyph with index\~\c
3219 .I n
3220 (a non-negative integer) of the current font.
3223 If the
3224 .B tcommand
3225 line is present in the DESC file, troff uses the following two
3226 commands.
3229 .BI t xxx
3230 .I xxx
3231 is any sequence of characters terminated by a space or a newline (to
3232 be more precise, it is a sequence of glyphs which are accessed with
3233 the corresponding characters); the first character should be printed at
3234 the current position, the current horizontal position should be increased
3235 by the width of the first character, and so on for each character.
3237 The width of the glyph is that given in the font file,
3238 appropriately scaled for the current point size, and rounded so that
3239 it is a multiple of the horizontal resolution.
3241 Special characters cannot be printed using this command.
3244 .BI u n\ xxx
3245 This is same as the
3246 .B t
3247 command except that after printing each character, the current
3248 horizontal position is increased by the sum of the width of that
3249 character and
3250 .IR n .
3253 Note that single characters can have the eighth bit set, as can the
3254 names of fonts and special characters.
3257 The names of glyphs and fonts can be of arbitrary length; drivers
3258 should not assume that they are only two characters long.
3261 When a glyph is to be printed, that glyph is always
3262 in the current font.
3264 Unlike device-independent troff, it is not necessary for drivers to
3265 search special fonts to find a glyph.
3268 For color support, some new commands have been added:
3271 \f[B]mc \f[I]cyan magenta yellow\f[R]
3273 \f[B]md\f[R]
3275 \f[B]mg \f[I]gray\f[R]
3277 \f[B]mk \f[I]cyan magenta yellow black\f[R]
3279 \f[B]mr \f[I]red green blue\f[R]
3280 Set the color components of the current drawing color, using various
3281 color schemes.
3283 .B md
3284 resets the drawing color to the default value.
3286 The arguments are integers in the range 0 to 65536.
3290 .B x
3291 device control command has been extended.
3294 \f[B]x u \f[I]n\f[R]
3296 .I n
3297 is\~1, start underlining of spaces.
3300 .I n
3301 is\~0, stop underlining of spaces.
3303 This is needed for the
3304 .B cu
3305 request in nroff mode and is ignored otherwise.
3308 .\" --------------------------------------------------------------------
3309 .SS "Drawing Commands"
3310 .\" --------------------------------------------------------------------
3313 .B D
3314 drawing command has been extended.
3316 These extensions are not used by GNU pic if the
3317 .B \-n
3318 option is given.
3321 \f[B]Df \f[I]n\f[R]\*[ic]\[rs]n
3322 Set the shade of gray to be used for filling solid objects to
3323 .IR n ;
3324 .I n
3325 must be an integer between 0 and 1000, where 0 corresponds solid white
3326 and 1000 to solid black, and values in between correspond to
3327 intermediate shades of gray.
3329 This applies only to solid circles, solid ellipses and solid
3330 polygons.
3332 By default, a level of 1000 is used.
3334 Whatever color a solid object has, it should completely obscure
3335 everything beneath it.
3337 A value greater than 1000 or less than 0 can also be used: this means
3338 fill with the shade of gray that is currently being used for lines and
3339 text.
3341 Normally this is black, but some drivers may provide a way of
3342 changing this.
3345 The corresponding
3346 .BI \[rs]D'f .\|.\|. '
3347 command shouldn't be used since its argument is always rounded to an
3348 integer multiple of the horizontal resolution which can lead to
3349 surprising results.
3352 \f[B]DC \f[I]d\f[R]\*[ic]\[rs]n
3353 Draw a solid circle with a diameter of
3354 .I d
3355 with the leftmost point at the current position.
3358 \f[B]DE \f[I]dx dy\f[R]\*[ic]\[rs]n
3359 Draw a solid ellipse with a horizontal diameter of
3360 .I dx
3361 and a vertical diameter of
3362 .I dy
3363 with the leftmost point at the current position.
3365 delim $$
3369 \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
3370 Draw a polygon with, for $i = 1 ,..., n+1$, the
3371 .IR i -th
3372 vertex at the current position 
3374 $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$.
3376 At the moment, GNU pic only uses this command to generate triangles
3377 and rectangles.
3380 \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 Like
3383 .B Dp
3384 but draw a solid rather than outlined polygon.
3387 \f[B]Dt \f[I]n\f[R]\*[ic]\[rs]n
3388 Set the current line thickness to
3389 .I n
3390 machine units.
3392 Traditionally Unix troff drivers use a line thickness proportional to
3393 the current point size; drivers should continue to do this if no
3394 .B Dt
3395 command has been given, or if a
3396 .B Dt
3397 command has been given with a negative value of
3398 .IR n .
3399 A zero value of
3400 .I n
3401 selects the smallest available line thickness.
3404 A difficulty arises in how the current position should be changed after
3405 the execution of these commands.
3407 This is not of great importance since the code generated by GNU pic
3408 does not depend on this.
3410 Given a drawing command of the form
3412 \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]
3415 where
3416 .I c
3417 is not one of
3418 .BR c ,
3419 .BR e ,
3420 .BR l ,
3421 .BR a ,
3423 .BR ~ ,
3424 Unix troff treats each of the $x sub i$ as a horizontal quantity,
3425 and each of the $y sub i$ as a vertical quantity and assumes that
3426 the width of the drawn object is $sum from i=1 to n x sub i$,
3427 and that the height is $sum from i=1 to n y sub i$.
3429 (The assumption about the height can be seen by examining the
3430 .B st
3432 .B sb
3433 registers after using such a
3434 .B D
3435 command in a \[rs]w escape sequence).
3437 This rule also holds for all the original drawing commands with the
3438 exception of
3439 .BR De .
3440 For the sake of compatibility GNU troff also follows this rule, even
3441 though it produces an ugly result in the case of the
3442 .B Dt
3444 .BR Df ,
3445 and, to a lesser extent,
3446 .B DE
3447 commands.
3449 Thus after executing a
3450 .B D
3451 command of the form
3453 \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
3456 the current position should be increased by
3458 $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
3461 Another set of extensions is
3464 \f[B]DFc \f[I]cyan magenta yellow\f[R]\*[ic]\[rs]n
3466 \f[B]DFd\f[R]\*[ic]\[rs]n
3468 \f[B]DFg \f[I]gray\f[R]\*[ic]\[rs]n
3470 \f[B]DFk \f[I]cyan magenta yellow black\f[R]\*[ic]\[rs]n
3472 \f[B]DFr \f[I]red green blue\f[R]\*[ic]\[rs]n
3473 Set the color components of the filling color similar to the
3474 .B m
3475 commands above.
3478 The current position isn't changed by those colour commands (contrary to
3479 .BR Df ).
3482 .\" --------------------------------------------------------------------
3483 .SS "Device Control Commands"
3484 .\" --------------------------------------------------------------------
3486 There is a continuation convention which permits the argument to the
3487 .B x\ X
3488 command to contain newlines: when outputting the argument to the
3489 .B x\ X
3490 command, GNU troff follows each newline in the argument with a
3491 .B +
3492 character (as usual, it terminates the entire argument with a
3493 newline); thus if the line after the line containing the
3494 .B x\ X
3495 command starts with
3496 .BR + ,
3497 then the newline ending the line containing the
3498 .B x\ X
3499 command should be treated as part of the argument to the
3500 .B x\ X
3501 command, the
3502 .B +
3503 should be ignored, and the part of the line following the
3504 .B +
3505 should be treated like the part of the line following the
3506 .B x\ X
3507 command.
3510 The first three output commands are guaranteed to be:
3512 .BI x\ T\  device
3514 .BI x\ res\  n\ h\ v
3516 .B x init
3519 .\" --------------------------------------------------------------------
3520 .SH INCOMPATIBILITIES
3521 .\" --------------------------------------------------------------------
3523 In spite of the many extensions, groff has retained compatibility to
3524 classical troff to a large degree.
3526 For the cases where the extensions lead to collisions, a special
3527 compatibility mode with the restricted, old functionality was created
3528 for groff.
3531 .\" --------------------------------------------------------------------
3532 .SS "Groff Language"
3533 .\" --------------------------------------------------------------------
3535 .I groff
3536 provides a
3537 .B compatibility mode
3538 that allows to process roff code written for classical
3539 .B troff
3540 or for other implementations of roff in a consistent way.
3543 Compatibility mode can be turned on with the
3544 .B \-C
3545 command line option, and turned on or off with the
3546 .B .cp
3547 request.
3549 The number register
3550 .B \[rs]n(.C
3551 is\~1 if compatibility mode is on, 0\~otherwise.
3554 This became necessary because the GNU concept for long names causes
3555 some incompatibilities.
3556 .I Classical troff
3557 interprets
3559 .B .dsabcd
3562 as defining a string
3563 .B ab
3564 with contents
3565 .BR cd .
3567 .IR groff
3568 mode, this is considered as a call of a macro named
3569 .B dsabcd .
3572 Also
3573 .I classical troff
3574 interprets
3575 .B \[rs]*[
3577 .B \[rs]n[
3578 as references to a string or number register called
3579 .B [
3580 while
3581 .I groff
3582 takes this as the start of a long name.
3586 .IR "compatibility mode" ,
3587 groff interprets these things in the traditional way; so long
3588 names are not recognized.
3591 On the other hand, groff in
3592 .I GNU native mode
3593 does not allow to use the single-character escapes
3594 .B \[rs]\[rs]
3595 (backslash),
3596 .B \[rs]|
3597 (vertical bar),
3598 .B \[rs]^
3599 (caret),
3600 .B \[rs]&
3601 (ampersand),
3602 .B \[rs]{
3603 (opening brace),
3604 .B \[rs]}
3605 (closing brace),
3606 `\[rs]\ '
3607 (space),
3608 .B \[rs]'
3609 (single quote),
3610 .B \[rs]`
3611 (backquote),
3612 .B \[rs]\-
3613 (minus),
3614 .B \[rs]_
3615 (underline),
3616 .B \[rs]!
3617 (bang),
3618 .B \[rs]%
3619 (percent),
3621 .B \[rs]c
3622 (character c) in names of strings, macros, diversions, number
3623 registers, fonts or environments, whereas
3624 .I classical troff
3625 does.
3629 .B \[rs]A
3630 escape sequence can be helpful in avoiding these escape sequences in
3631 names.
3634 Fractional pointsizes cause one noteworthy incompatibility.
3637 .I classical
3638 .IR troff ,
3640 .B ps
3641 request ignores scale indicators and so
3644 .B .ps\~10u
3648 sets the pointsize to 10\~points, whereas in groff native mode the
3649 pointsize is set to 10\~scaled points.
3653 .IR groff ,
3654 there is a fundamental difference between unformatted input
3655 characters, and formatted output characters (glyphs).
3657 Everything that affects how a glyph is output is
3658 stored with the glyph; once a glyph has been
3659 constructed it is unaffected by any subsequent requests that are
3660 executed, including the
3661 .BR bd ,
3662 .BR cs ,
3663 .BR tkf ,
3664 .BR tr ,
3666 .B fp
3667 requests.
3670 Normally glyphs are constructed from input characters at
3671 the moment immediately before the glyph is added to the current
3672 output line.
3674 Macros, diversions and strings are all, in fact, the same type of
3675 object; they contain lists of input characters and glyphs
3676 in any combination.
3679 Special characters can be both; before being added to the output, they
3680 act as input entities, afterwards they denote glyphs.
3683 A glyph does not behave like an input character for the
3684 purposes of macro processing; it does not inherit any of the special
3685 properties that the input character from which it was constructed
3686 might have had.
3688 The following example makes things clearer.
3693 .ft CB
3694 \&.di x
3695 .B \[rs]\[rs]\[rs]\[rs]
3696 \&.br
3697 \&.di
3698 \&.x
3704 With
3705 .I GNU troff
3706 this is printed as
3707 .B \[rs]\[rs] .
3708 So each pair of input backslashes
3709 \&'\[rs]\[rs]'
3710 is turned into a single output backslash glyph
3711 \&'\[rs]'
3712 and the resulting output backslashes are not interpreted as escape
3713 characters when they are reread.
3716 .I Classical troff
3717 would interpret them as escape characters when they were reread and
3718 would end up printing a single backslash `\[rs]'.
3721 In GNU, the correct way to get a printable version of the backslash
3722 character `\[rs]'
3723 is the
3724 .B \[rs](rs
3725 escape sequence, but classical troff does not provide a clean feature
3726 for getting a non-syntactical backslash.
3728 A close method is the printable version of the current escape
3729 character using the
3730 \[rs]e
3731 escape sequence; this works if the current escape character is not
3732 redefined.
3734 It works in both GNU mode and compatibility mode, while dirty tricks
3735 like specifying a sequence of multiple backslashes do not work
3736 reliably; for the different handling in diversions, macro definitions,
3737 or text mode quickly leads to a confusion about the necessary number of
3738 backslashes.
3741 To store an escape sequence in a diversion that is interpreted
3742 when the diversion is reread, either the traditional
3743 .B \[rs]!
3744 transparent output facility or the
3746 .B \[rs]?
3747 escape sequence can be used.
3750 .\" --------------------------------------------------------------------
3751 .SS "Intermediate Output"
3752 .\" --------------------------------------------------------------------
3754 The groff intermediate output format is in a state of evolution.
3756 So far it has some incompatibilities, but it is intended to establish
3757 a full compatibility to the classical troff output format.
3759 Actually the following incompatibilities exist:
3761 .IP \[bu] 2m
3762 The positioning after the drawing of the polygons conflicts with the
3763 classical definition.
3765 .IP \[bu] 2m
3766 The intermediate output cannot be rescaled to other devices as
3767 classical "device-independent" troff did.
3770 .\" --------------------------------------------------------------------
3771 .SH AUTHORS
3772 .\" --------------------------------------------------------------------
3774 Copyright (C) 1989, 2001, 2002, 2003, 2004, 2006, 2007
3775 Free Software Foundation, Inc.
3778 This document is distributed under the terms of the FDL (GNU Free
3779 Documentation License) version 1.1 or later.
3781 You should have received a copy of the FDL on your system, it is also
3782 available on-line at the
3783 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
3784 GNU copyleft site
3785 .UE .
3787 This document was written by James Clark, with modifications by
3788 .MT wl@gnu.org
3789 Werner Lemberg
3792 .MT bwarken@mayn.de
3793 Bernd Warken
3794 .ME .
3797 This document is part of
3798 .IR groff ,
3799 the GNU roff distribution.
3801 Formerly, the contents of this document was kept in the manual
3802 page
3803 .BR @g@troff (@MAN1EXT@).
3804 Only the parts dealing with the language aspects of the different
3805 .I roff
3806 systems were carried over into this document.
3809 .I troff
3810 command line options and warnings are still documented in
3811 .BR @g@troff (@MAN1EXT@).
3813 .\" --------------------------------------------------------------------
3814 .SH "SEE ALSO"
3815 .\" --------------------------------------------------------------------
3818 .I groff info
3819 .IR file ,
3820 cf.\&
3821 .BR info (1)
3822 presents all groff documentation within a single document.
3825 .BR groff (@MAN1EXT@)
3826 A list of all documentation around
3827 .IR groff .
3830 .BR groff (@MAN7EXT@)
3831 A description of the
3832 .I groff
3833 language, including a short, but complete reference of all predefined
3834 requests, registers, and escapes of plain
3835 .IR groff .
3836 From the command line, this is called using
3841 man 7 groff
3846 .BR roff (@MAN7EXT@)
3847 A survey of
3848 .I roff
3849 systems, including pointers to further historical documentation.
3852 .RI [ CSTR\~#54\/ ]
3854 .I Nroff/\:Troff User's Manual
3856 .I J.\& F.\& Osanna
3857 of 1976 in the revision of
3858 .I Brian Kernighan
3859 of 1992, being the
3860 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz
3861 classical troff documentation
3862 .UE .
3864 .\" --------------------------------------------------------------------
3865 .\" Emacs variables
3866 .\" --------------------------------------------------------------------
3868 .\" Local Variables:
3869 .\" mode: nroff
3870 .\" End: