Merge branch 'topic/sync-to-go-2'
[s-roff.git] / man / l_roff-diff.7.in
blob5260b4ed9eeaf8f0c3dcde07d9e5498cbcb4032d
1 '\" e -- preprocess: eqn(1)
2 .ig
3 @ @L_ROFF@-diff.7
5 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
7 Copyright (C) 1989, 2001 - 2004, 2006 - 2008
8   Free Software Foundation, Inc.
9 written by James Clark
11 modified by Werner Lemberg <wl@gnu.org>
12             Bernd Warken <bwarken@mayn.de>
14 Permission is granted to copy, distribute and/or modify this document
15 under the terms of the GNU Free Documentation License, Version 1.1 or
16 any later version published by the Free Software Foundation; with the
17 Invariant Sections being this .ig-section and AUTHORS, with no
18 Front-Cover Texts, and with no Back-Cover Texts.
20 You should have received a copy of the Free Documentation License
21 as part of the file COPYING; also located in the main directory of the
22 source package of this program.
26 .\"
27 .\" Local definitions
28 .\"
30 .\" define a string tx for the TeX logo
31 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
32 .el   .ds tx TeX
35 .\" from old groff_out.man
36 .ie \n(.g \
37 .  ds ic \/
38 .el \
39 .  ds ic \^
42 .\"
43 .\" Title
44 .\"
46 .TH @U_ROFF@-DIFF @MAN7EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
47 .SH NAME
48 @L_ROFF@-diff \- differences between @T_ROFF@ and classical troff
51 .\"
52 .SH DESCRIPTION
53 .\"
55 This manual page describes the language differences between
56 .IR @T_ROFF@ ,
57 and the classical
58 .I roff
59 formatter of the freely available Unix\~7 of the 1970s, documented in
60 the
61 .I Troff User's Manual
63 .I Ossanna
64 and
65 .IR Kernighan .
66 This inludes the roff language as well as the intermediate output
67 format (troff output).
70 The section
71 .I SEE ALSO
72 gives pointers to both the classical
73 .I roff
74 and the
75 .I @T_ROFF@
76 documentation.
79 .\"
80 .SH "@T_ROFF@ LANGUAGE"
81 .\"
83 In this section, all additional features
84 compared to the classical Unix\~7
85 .I troff
86 are described in detail.
89 .\"
90 .SS "Long names"
91 .\"
93 The names of number registers, fonts, strings/\:macros/\:diversions,
94 special characters (glyphs), and colors can be of any length.
96 In escape sequences, additionally to the classical `\fB(\fP\fIxx\fP'
97 construction for a two-character glyph name, you can use
98 `\fB[\fP\fIxxx\fP\fB]\fP' for a name of arbitrary length.
101 .BI \[rs][ xxx ]
102 Print the special character (glyph) called
103 .IR xxx .
106 .BI \[rs][ "comp1 comp2 .\|.\|." ]
107 Print composite glyph consisting of multiple components.
109 Example: `\[rs][A\~ho]' is capital letter A with ogonek which finally maps
110 to glyph name `u0041_0328'.
113 .BR @L_ROFF@-char (@MAN7EXT@)
114 for a list of glyph name components used in composite glyph names
115 and details of how a glyph name for a composite glyph is constructed.
118 .BI \[rs]f[ xxx ]
119 Set font
120 .IR xxx .
122 Additionally,
123 .B \[rs]f[]
124 is a new syntax form equal to
125 .BR \[rs]fP ,
126 i.e., to return to the previous font.
129 .BI \[rs]*[ "xxx arg1 arg2 .\|.\|." ]
130 Interpolate string
131 .IR xxx ,
132 taking
133 .IR arg1 ,
134 .IR arg2 ,
135 .I .\|.\|.\&
136 as arguments.
139 .BI \[rs]n[ xxx ]
140 Interpolate number register
141 .IR xxx .
145 .SS "Fractional point sizes"
149 .I scaled point
150 is equal to
151 .B 1/sizescale
152 points, where
153 .B sizescale
154 is specified in the
155 .B DESC
156 file (1 by default).
158 There is a new scale indicator\~\c
159 .B z
160 that has the effect of multiplying by sizescale.
162 Requests and escape sequences in troff interpret arguments that
163 represent a point size as being in units of scaled points, but they
164 evaluate each such argument using a default scale indicator of\~\c
165 .BR z .
166 Arguments treated in this way are the argument to the
167 .B ps
168 request, the third argument to the
169 .B cs
170 request, the second and fourth arguments to the
171 .B tkf
172 request, the argument to the
173 .B \[rs]H
174 escape sequence, and those variants of the
175 .B \[rs]s
176 escape sequence that take a numeric expression as their argument.
179 For example, suppose sizescale is 1000; then a scaled point is
180 equivalent to a millipoint; the call
181 .B .ps\ 10.25
182 is equivalent to
183 .B .ps\ 10.25z
184 and so sets the point size to 10250 scaled points, which is equal to
185 10.25 points.
188 The number register
189 .B \[rs]n[.s]
190 returns the point size in points as decimal fraction.
192 There is also a new number register
193 .B \[rs]n[.ps]
194 that returns the point size in scaled points.
197 It would make no sense to use the
198 .BR z \~\c
199 scale indicator in a numeric expression whose default scale indicator
200 was neither
201 .B u
202 nor\~\c
203 .BR z ,
204 and so
205 .B troff
206 disallows this.
208 Similarly it would make no sense to use a scaling indicator other than
209 .B z
210 or\~\c
211 .B u
212 in a numeric expression whose default scale indicator was\~\c
213 .BR z ,
214 and so
215 .B troff
216 disallows this as well.
219 There is also new scale indicator\~\c
220 .B s
221 which multiplies by the number of units in a scaled point.
223 So, for example,
224 .B \[rs]n[.ps]s
225 is equal to
226 .BR 1m .
227 Be sure not to confuse the
228 .B s
230 .BR z \~\c
231 scale indicators.
235 .SS "Numeric expressions"
238 Spaces are permitted in a number expression within parentheses.
241 .B M
242 indicates a scale of 100ths of an em.
243 .B f
244 indicates a scale of 65536 units, providing fractions for color
245 definitions with the
246 .B defcolor
247 request.
249 For example, 0.5f = 32768u.
252 .IB e1 >? e2
253 The maximum of
254 .I e1
256 .IR e2 .
259 .IB e1 <? e2
260 The minimum of
261 .I e1
263 .IR e2 .
266 .BI ( c ; e )
267 Evaluate
268 .I e
269 using
270 .I c
271 as the default scaling indicator.
274 .I c
275 is missing, ignore scaling indicators in the evaluation of\~\c
276 .IR e .
280 .SS "New escape sequences"
284 .BI \[rs]A' anything '
285 This expands to
286 .B 1
287 or\~\c
288 .BR 0 ,
289 depending on whether
290 .I anything
291 is or is not acceptable as the name of a string, macro, diversion, number
292 register, environment, font, or color.
293 It returns\~\c
294 .B 0
296 .I anything
297 is empty.
299 This is useful if you want to look up user input in some sort of
300 associative table.
303 .BI \[rs]B' anything '
304 This expands to
305 .B 1
306 or\~\c
307 .BR 0 ,
308 depending on whether
309 .I anything
310 is or is not a valid numeric expression.
312 It returns\~\c
313 .B 0
315 .I anything
316 is empty.
319 .BI \[rs]C' xxx '
320 Typeset glyph named
321 .IR xxx .
322 Normally it is more convenient to use
323 .BI \[rs][ xxx ]\f[R].
325 .B \[rs]C
326 has the advantage that it is compatible with recent versions of
327 .SM UNIX
328 and is available in compatibility mode.
331 .B \[rs]E
332 This is equivalent to an escape character, but it is not interpreted in
333 copy mode.
335 For example, strings to start and end superscripting could be defined
336 like this
341 \&.ds { \[rs]v'\-.3m'\[rs]s'\[rs]En[.s]*6u/10u'
342 \&.ds } \[rs]s0\[rs]v'.3m'
347 The use of
348 .B \[rs]E
349 ensures that these definitions work even if
350 .B \[rs]*{
351 gets interpreted in copy mode (for example, by being used in a macro
352 argument).
356 .BI \[rs]F f
358 .BI \[rs]F( fm
360 .BI \[rs]F[ fam ]
361 Change font family.
363 This is the same as the
364 .B fam
365 request.
367 .B \[rs]F[]
368 switches back to the previous font (note that
369 .B \[rs]FP
370 won't work; it selects font family `P' instead).
373 .BI \[rs]m x
375 .BI \[rs]m( xx
377 .BI \[rs]m[ xxx ]
378 Set drawing color.
379 .B \[rs]m[]
380 switches back to the previous color.
383 .BI \[rs]M x
385 .BI \[rs]M( xx
387 .BI \[rs]M[ xxx ]
388 Set background color for filled objects drawn with the
389 .BI \[rs]D' .\|.\|. '
390 commands.
391 .B \[rs]M[]
392 switches back to the previous color.
395 .BI \[rs]N' n '
396 Typeset the glyph with index\~\c
397 .I n
398 in the current font.
399 .IR n \~\c
400 can be any integer.
402 Most devices only have glyphs with indices between 0 and 255.
404 If the current font does not contain a glyph with that code,
405 special fonts are
406 .I not
407 searched.
410 .B \[rs]N
411 escape sequence can be conveniently used in conjunction with the
412 .B char
413 request, for example
418 \&.char \[rs][phone] \[rs]f(ZD\[rs]N'37'
423 The index of each glyph is given in the fourth column in the font
424 description file after the
425 .B charset
426 command.
428 It is possible to include unnamed glyphs in the font description
429 file by using a name of
430 .BR \-\-\- ;
432 .B \[rs]N
433 escape sequence is the only way to use these.
436 .BI \[rs]O n
438 .BI \[rs]O[ n ]
439 Suppress troff output.
441 The escapes
442 .BR \[rs]O2 ,
443 .BR \[rs]O3 ,
444 .BR \[rs]O4 ,
446 .B \[rs]O5
447 are intended for internal use by
448 .BR \%@L_D_HTML@ .
452 .B \[rs]O0
453 Disable any ditroff glyphs from being emitted to the device driver,
454 provided that the escape occurs at the outer level (see
455 .B \[rs]O3
457 .BR \[rs]O4 ).
460 .B \[rs]O1
461 Enable output of glyphs, provided that the escape occurs at the outer
462 level.
464 .B \[rs]O0
466 .B \[rs]O1
467 also reset the registers
468 .BR \[rs]n[opminx] ,
469 .BR \[rs]n[opminy] ,
470 .BR \[rs]n[opmaxx] ,
472 .B \[rs]n[opmaxy]
473 to\~\-1.
475 These four registers mark the top left and bottom right hand corners
476 of a box which encompasses all written glyphs.
479 .B \[rs]O2
480 Provided that the escape occurs at the outer level, enable output of
481 glyphs and also write out to stderr the page number and four registers
482 encompassing the glyphs previously written since the last call to
483 .BR \[rs]O .
486 .B \[rs]O3
487 Begin a nesting level.
489 At start-up,
490 .B troff
491 is at outer level.
493 This is really an internal mechanism for
494 .B \%@L_D_HTML@
495 while producing images.
497 They are generated by running the troff source through
498 .B troff
499 to the postscript device and
500 .B ghostscript
501 to produce images in PNG format.
504 .B \[rs]O3
505 escape starts a new page if the device is not html (to reduce the
506 possibility of images crossing a page boundary).
509 .B \[rs]O4
510 End a nesting level.
513 .BI \[rs]O5[ Pfilename ]
514 This escape is
515 .B \%@L_D_HTML@
516 specific.
518 Provided that this escape occurs at the outer nesting level, write
519 .I filename
520 to stderr.
522 The position of the image,
523 .IR P ,
524 must be specified and must be one of
525 .BR l ,
526 .BR r ,
527 .BR c ,
529 .B i
530 (left, right, centered, inline).
532 .I filename
533 is associated with the production of the next inline image.
537 .BI \[rs]R' name\ \[+-]n '
538 This has the same effect as
542 .BI .nr\  name\ \[+-]n
546 .BI \[rs]s( nn
548 .BI \[rs]s\[+-]( nn
549 Set the point size to
550 .I nn
551 points;
552 .I nn
553 must be exactly two digits.
556 .BI \[rs]s[\[+-] n ]
558 .BI \[rs]s\[+-][ n ]
560 .BI \[rs]s'\[+-] n '
562 .BI \[rs]s\[+-]' n '
563 Set the point size to
564 .I n
565 scaled points;
566 .I n
567 is a numeric expression with a default scale indicator of\~\c
568 .BR z .
571 .BI \[rs]V x
573 .BI \[rs]V( xx
575 .BI \[rs]V[ xxx ]
576 Interpolate the contents of the environment variable
577 .IR xxx ,
578 as returned by
579 .BR getenv (3).
580 .B \[rs]V
581 is interpreted in copy mode.
584 .BI \[rs]Y x
586 .BI \[rs]Y( xx
588 .BI \[rs]Y[ xxx ]
589 This is approximately equivalent to
590 .BI \[rs]X'\[rs]*[ xxx ]'\f[R].
591 However the contents of the string or macro
592 .I xxx
593 are not interpreted; also it is permitted for
594 .I xxx
595 to have been defined as a macro and thus contain newlines (it is not
596 permitted for the argument to
597 .B \[rs]X
598 to contain newlines).
600 The inclusion of newlines requires an extension to the UNIX troff
601 output format, and confuses drivers that do not know about this
602 extension.
605 .BI \[rs]Z' anything '
606 Print anything and then restore the horizontal and vertical position;
607 .I anything
608 may not contain tabs or leaders.
611 .B \[rs]$0
612 The name by which the current macro was invoked.
615 .B als
616 request can make a macro have more than one name.
619 .B \[rs]$*
620 In a macro or string, the concatenation of all the arguments separated
621 by spaces.
624 .B \[rs]$@
625 In a macro or string, the concatenation of all the arguments with each
626 surrounded by double quotes, and separated by spaces.
629 .B \[rs]$^
630 In a macro, the representation of all parameters as if they were an
631 argument to the
632 .B ds
633 request.
636 .BI \[rs]$( nn
638 .BI \[rs]$[ nnn ]
639 In a macro or string, this gives the
640 .IR nn -th
642 .IR nnn -th
643 argument.
645 Macros and strings can have an unlimited number of arguments.
648 .BI \[rs]? anything \[rs]?
649 When used in a diversion, this transparently embeds
650 .I anything
651 in the diversion.
652 .I anything
653 is read in copy mode.
655 When the diversion is reread,
656 .I anything
657 is interpreted.
658 .I anything
659 may not contain newlines; use
660 .B \[rs]!\&
661 if you want to embed newlines in a diversion.
663 The escape sequence
664 .B \[rs]?\&
665 is also recognized in copy mode and turned into a single internal
666 code; it is this code that terminates
667 .IR anything .
668 Thus
673 .ne 14v+\n(.Vu
674 \&.nr x 1
675 \&.nf
676 \&.di d
677 \&\[rs]?\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\[rs]\c
678 \&\[rs]nx\[rs]\[rs]\[rs]\[rs]?\[rs]\[rs]?\[rs]?
679 \&.di
680 \&.nr x 2
681 \&.di e
682 \&.d
683 \&.di
684 \&.nr x 3
685 \&.di f
686 \&.e
687 \&.di
688 \&.nr x 4
689 \&.f
694 prints\~\c
695 .BR 4 .
698 .B \[rs]/
699 This increases the width of the preceding glyph so that the
700 spacing between that glyph and the following glyph is
701 correct if the following glyph is a roman glyph.
703 .if t \{\
704 .  nop For example, if an italic\~f is immediately followed by a roman
705 .  nop right parenthesis, then in many fonts the top right portion of
706 .  nop the\~f overlaps the top left of the right parenthesis
707 .  nop producing \f[I]f\f[R]), which is ugly.
708 .  nop Inserting
709 .  B \[rs]/
710 .  nop produces
711 .  ie \n(.g \f[I]f\/\f[R])
712 .  el       \f[I]f\|\f[R])
713 .  nop and avoids this problem.
715 It is a good idea to use this escape sequence whenever an italic
716 glyph is immediately followed by a roman glyph without any
717 intervening space.
720 .B \[rs],
721 This modifies the spacing of the following glyph so that the
722 spacing between that glyph and the preceding glyph is
723 correct if the preceding glyph is a roman glyph.
725 .if t \{\
726 .  nop For example, inserting
727 .  B \[rs],
728 .  nop between the parenthesis and the\~f changes
729 .  nop \f[R](\f[I]f\f[R] to
730 .  ie \n(.g \f[R](\,\f[I]f\f[R].
731 .  el       \f[R](\^\f[I]f\f[R].
733 It is a good idea to use this escape sequence whenever a roman
734 glyph is immediately followed by an italic glyph without any
735 intervening space.
738 .B \[rs])
739 Like
740 .B \[rs]&
741 except that it behaves like a character declared with the
742 .B cflags
743 request to be transparent for the purposes of end-of-sentence
744 recognition.
747 .B \[rs]\[ti]
748 This produces an unbreakable space that stretches like a normal
749 inter-word space when a line is adjusted.
752 .B \[rs]:
753 This causes the insertion of a zero-width break point.
755 It is equal to
756 .B \[rs]%
757 within a word but without insertion of a soft hyphen glyph.
760 .B \[rs]#
761 Everything up to and including the next newline is ignored.
763 This is interpreted in copy mode.
765 It is like
766 .B \[rs]"
767 except that
768 .B \[rs]"
769 does not ignore the terminating newline.
773 .SS "New requests"
777 .BI .aln\  xx\ yy
778 Create an alias
779 .I xx
780 for number register object named
781 .IR yy .
782 The new name and the old name are exactly equivalent.
785 .I yy
786 is undefined, a warning of type
787 .B reg
788 is generated, and the request is ignored.
791 .BI .als\  xx\ yy
792 Create an alias
793 .I xx
794 for request, string, macro, or diversion object named
795 .IR yy .
797 The new name and the old name are exactly equivalent (it is
798 similar to a hard rather than a soft link).
801 .I yy
802 is undefined, a warning of type
803 .B mac
804 is generated, and the request is ignored.
807 .BR de ,
808 .BR am ,
809 .BR di ,
810 .BR da ,
811 .BR ds ,
813 .B as
814 requests only create a new object if the name of the macro, diversion
815 or string is currently undefined or if it is defined to be a
816 request; normally they modify the value of an existing object.
819 .BI .am1\  xx\ yy
820 Similar to
821 .BR .am ,
822 but compatibility mode is switched off during execution.
824 To be more precise, a `compatibility save' token is inserted at the
825 beginning of the macro addition, and a `compatibility restore' token at
826 the end.
828 As a consequence, the requests
829 .BR am ,
830 .BR am1 ,
831 .BR de ,
833 .B de1
834 can be intermixed freely since the compatibility save/\:restore tokens
835 only affect the macro parts defined by
836 .B .am1
838 .BR .ds1 .
841 .BI .ami\  xx\ yy
842 Append to macro indirectly.
844 See the
845 .B dei
846 request below for more information.
849 .BI .ami1\  xx\ yy
850 Same as the
851 .B ami
852 request but compatibility mode is switched off during execution.
855 .BI .as1\  xx\ yy
856 Similar to
857 .BR .as ,
858 but compatibility mode is switched off during expansion.
860 To be more precise, a `compatibility save' token is inserted at the
861 beginning of the string, and a `compatibility restore' token at the end.
863 As a consequence, the requests
864 .BR as ,
865 .BR as1 ,
866 .BR ds ,
868 .B ds1
869 can be intermixed freely since the compatibility save/\:restore tokens
870 only affect the (sub)strings defined by
871 .B as1
873 .BR ds1 .
876 .BI .asciify\  xx
877 This request `unformats' the diversion
878 .I xx
879 in such a way that
880 .SM ASCII
881 and space characters (and some escape sequences) that were formatted
882 and diverted into
883 .I xx
884 are treated like ordinary input characters when
885 .I xx
886 is reread.
887 Useful for diversions in conjunction with the
888 .B writem
889 request.
891 It can be also used for gross hacks; for example, this
896 .ne 7v+\n(.Vu
897 \&.tr @.
898 \&.di x
899 \&@nr n 1
900 \&.br
901 \&.di
902 \&.tr @@
903 \&.asciify x
904 \&.x
909 sets register\~\c
910 .B n
911 to\~1.
913 Note that glyph information (font, font size, etc.) is not preserved;
915 .B .unformat
916 instead.
919 .B .backtrace
920 Print a backtrace of the input stack on stderr.
923 .BI .blm\  xx
924 Set the blank line macro to
925 .IR xx .
926 If there is a blank line macro, it is invoked when a blank line
927 is encountered instead of the usual troff behaviour.
930 .BI .box\  xx
932 .BI .boxa\  xx
933 These requests are similar to the
934 .B di
936 .B da
937 requests with the exception that a partially filled line does not
938 become part of the diversion (i.e., the diversion always starts with a
939 new line) but is restored after ending the diversion, discarding the
940 partially filled line which possibly comes from the diversion.
943 .B .break
944 Break out of a while loop.
946 See also the
947 .B while
949 .B continue
950 requests.
952 Be sure not to confuse this with the
953 .B br
954 request.
957 .B .brp
958 This is the same as
959 .BR \[rs]p .
962 .BI .cflags\  n\ c1\ c2\|.\|.\|.\&
963 Characters
964 .IR c1 ,
965 .IR c2 ,\|.\|.\|.\&
966 have properties determined by
967 .IR n ,
968 which is ORed from the following:
971 .IP 1
972 The character ends sentences (initially characters
973 .B .?!\&
974 have this property).
976 .IP 2
977 Lines can be broken before the character (initially no characters have
978 this property); a line is not broken at a character with this property
979 unless the characters on each side both have non-zero hyphenation
980 codes.
981 This can be overridden with value 64.
983 .IP 4
984 Lines can be broken after the character (initially characters
985 .B \-\[rs][hy]\[rs][em]
986 have this property); a line is not broken at a character with this
987 property unless the characters on each side both have non-zero
988 hyphenation codes.
990 This can be overridden with value 64.
992 .IP 8
993 The glyph associated with this character overlaps horizontally
994 (initially characters
995 .B \[rs][ul]\[rs][rn]\[rs][ru]\[rs][radicalex]\[rs][sqrtex]
996 have this property).
998 .IP 16
999 The glyph associated with this character overlaps vertically
1000 (initially glyph
1001 .B \[rs][br]
1002 has this property).
1004 .IP 32
1005 An end-of-sentence character followed by any number of characters with
1006 this property is treated as the end of a sentence if followed by a
1007 newline or two spaces; in other words the character is transparent for
1008 the purposes of end-of-sentence recognition; this is the same as having
1009 a zero space factor in \*[tx] (initially characters
1010 .B \[dq]')]*\[rs][dg]\[rs][rq]\[rs][cq]
1011 have this property).
1013 .IP 64
1014 Ignore hyphenation code values of the surrounding characters.
1015 Use this in combination with values 2 and\~4 (initially no characters
1016 have this property).
1020 .BI .char\  c\ string
1021 [This request can both define characters and glyphs.]
1024 Define entity\~\c
1025 .I c
1026 to be
1027 .IR string .
1029 To be more precise, define (or even override) a roff entity which
1030 can be accessed with name\~\c
1031 .I c
1032 on the input side, and which uses
1033 .I string
1034 on the output side.
1036 Every time glyph\~\c
1037 .I c
1038 needs to be printed,
1039 .I string
1040 is processed in a temporary environment and the result is
1041 wrapped up into a single object.
1043 Compatibility mode is turned off and the escape character is
1044 set to\~\c
1045 .B \[rs]
1046 while
1047 .I string
1048 is being processed.
1050 Any emboldening, constant spacing or track kerning is applied to
1051 this object rather than to individual glyphs in
1052 .IR string .
1055 A roff object defined by this request can be used just like a
1056 normal glyph provided by the output device.
1058 In particular other characters can be translated to it with the
1059 .B tr
1060 request; it can be made the leader glyph by the
1061 .B lc
1062 request; repeated patterns can be drawn with the glyph using the
1063 .B \[rs]l
1065 .B \[rs]L
1066 escape sequences; words containing\~\c
1067 .I c
1068 can be hyphenated correctly, if the
1069 .B hcode
1070 request is used to give the object a hyphenation code.
1073 There is a special anti-recursion feature: Use of glyph within the
1074 glyph's definition is handled like normal glyphs not
1075 defined with
1076 .BR char .
1078 A glyph definition can be removed with the
1079 .B rchar
1080 request.
1083 .BI .chop\  xx
1084 Chop the last element off macro, string, or diversion
1085 .IR xx .
1086 This is useful for removing the newline from the end of diversions
1087 that are to be interpolated as strings.
1090 .BI .close\  stream
1091 Close the stream named
1092 .IR stream ;
1093 .I stream
1094 will no longer be an acceptable argument to the
1095 .B write
1096 request.
1098 See the
1099 .B open
1100 request.
1103 .BI .composite\  glyph1\ glyph2
1104 Map glyph name
1105 .I glyph1
1106 to glyph name
1107 .I glyph2
1108 if it is used in
1109 .BI \[rs][ .\|.\|. ]
1110 with more than one component.
1113 .B .continue
1114 Finish the current iteration of a while loop.
1116 See also the
1117 .B while
1119 .B break
1120 requests.
1123 .BI .color\  n
1125 .I n
1126 is non-zero or missing, enable colors (this is the default), otherwise
1127 disable them.
1130 .BI .cp\  n
1132 .I n
1133 is non-zero or missing, enable compatibility mode, otherwise disable
1136 In compatibility mode, long names are not recognized, and the
1137 incompatibilities caused by long names do not arise.
1140 .BI .defcolor\  xxx\ scheme\ color_components
1141 Define color
1142 .IR xxx .
1143 .I scheme
1144 can be one of the following values:
1145 .B rgb
1146 (three components),
1147 .B cmy
1148 (three components),
1149 .B cmyk
1150 (four components), and
1151 .B gray
1153 .B grey
1154 (one component).
1156 Color components can be given either as a hexadecimal string or as
1157 positive decimal integers in the range 0-65535.
1159 A hexadecimal string contains all color components concatenated; it
1160 must start with either
1161 .B #
1163 .BR ## .
1164 The former specifies hex values in the range 0-255 (which are
1165 internally multiplied by\~257), the latter in the range 0-65535.
1167 Examples: #FFC0CB (pink), ##ffff0000ffff (magenta).
1169 A new scaling indicator\~\c
1170 .B f
1171 has been introduced which multiplies its value by\~65536; this makes
1172 it convenient to specify color components as fractions in the range 0
1173 to\~1.
1175 Example:
1180 \&.defcolor darkgreen rgb 0.1f 0.5f 0.2f
1185 Note that
1186 .B f
1187 is the default scaling indicator for the
1188 .B defcolor
1189 request, thus the above statement is equivalent to
1194 \&.defcolor darkgreen rgb 0.1 0.5 0.2
1199 The color named
1200 .B default
1201 (which is device-specific) can't be redefined.
1203 It is possible that the default color for
1204 .B \[rs]M
1206 .B \[rs]m
1207 is not the same.
1210 .BI .de1\  xx\ yy
1211 Similar to
1212 .BR .de ,
1213 but compatibility mode is switched off during execution.
1215 On entry, the current compatibility mode is saved and restored at exit.
1218 .BI .dei\  xx\ yy
1219 Define macro indirectly.
1221 The following example
1225 .ne 2v+\n(.Vu
1227 \&.ds xx aa
1228 \&.ds yy bb
1229 \&.dei xx yy
1234 is equivalent to
1239 \&.de aa bb
1244 .BI .dei1\  xx\ yy
1245 Similar to the
1246 .B dei
1247 request but compatibility mode is switched off during execution.
1250 .BI .device\  anything
1251 This is (almost) the same as the
1252 .B \[rs]X
1253 escape.
1254 .I anything
1255 is read in copy mode; a leading\~\c
1256 .B \[dq]
1257 is stripped.
1260 .BI .devicem\  xx
1261 This is the same as the
1262 .B \[rs]Y
1263 escape (to embed the contents of a macro into the intermediate
1264 output preceded with `x\~X').
1267 .BI .do\  xxx
1268 Interpret
1269 .I .xxx
1270 with compatibility mode disabled.
1272 For example,
1278 \&.do fam T
1282 would have the same effect as
1286 \&.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 character (or glyph)\~\c
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\~\c
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 character (or glyph)\~\c
1374 .I c
1375 for font\~\c
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\~\c
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\~\c
1411 .I f
1412 to\~\c
1413 .IR g .
1414 Whenever a font named\~\c
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\~\c
1434 .I g
1435 is used.
1437 .I g
1438 is missing, or equal to\~\c
1439 .I f
1440 then font\~\c
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 .IR f \~\c
1455 must be a real font name, not a style.
1458 .BI .gcolor\  c
1459 Set the glyph color to\~\c
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 to set up a default language.
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\~\c
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 .BR \[rs]patterns{ .\|.\|. }
1563 (possibly with whitespace before and after the braces).
1565 Everything between the braces is taken as hyphenation patterns.
1567 Consequently,
1568 .BR { \~\c
1569 and\~\c
1570 .B }
1571 are not allowed in patterns.
1573 .IP \[bu]
1574 Similarly,
1575 .BR \[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 roff 's
1596 input encoding.
1597 By default, everything maps to itself except letters `A' to `Z' which
1598 map to `a' to `z'.
1601 The set of hyphenation patterns is associated with the current language
1602 set by the
1603 .B hla
1604 request.
1607 .B hpf
1608 request is usually invoked by the
1609 .B troffrc
1610 file; a second call replaces the old patterns with the new ones.
1613 .BI .hpfa\  file
1614 The same as
1615 .B hpf
1616 except that the hyphenation patterns from
1617 .I file
1618 are appended to the patterns already loaded in the current language.
1621 .BI .hpfcode\  a\ b\ c\ d\ .\|.\|.
1622 After reading a hyphenation patterns file with the
1623 .B hpf
1625 .B hpfa
1626 request, convert all characters with character code\~\c
1627 .I a
1628 in the recently read patterns to character code\~\c
1629 .IR b ,
1630 character code\~\c
1631 .I c
1632 to\~\c
1633 .IR d ,
1634 etc.
1636 Initially, all character codes map to themselves.
1638 The arguments of
1639 .B hpfcode
1640 must be integers in the range 0 to\~255.
1642 Note that it is even possible to use character codes which are otherwise
1643 invalid.
1646 .BI .hym\  n
1647 Set the
1648 .I hyphenation margin
1649 to\~\c
1650 .IR n :
1651 when the current adjustment mode is not\~\c
1652 .BR b ,
1653 the line is not hyphenated if the line is no more than
1654 .I n
1655 short.
1657 The default hyphenation margin is\~0.
1659 The default scaling indicator for this request is\~\c
1660 .BR m .
1661 The hyphenation margin is associated with the current environment.
1663 The current hyphenation margin is available in the
1664 .B \[rs]n[.hym]
1665 register.
1668 .BI .hys\  n
1669 Set the
1670 .I hyphenation space
1671 to\~\c
1672 .IR n :
1673 When the current adjustment mode is\~\c
1674 .B b
1675 don't hyphenate the line if the line can be justified by adding no
1676 more than
1677 .I n
1678 extra space to each word space.
1680 The default hyphenation space is\~0.
1682 The default scaling indicator for this request is\~\c
1683 .BR m .
1684 The hyphenation space is associated with the current environment.
1686 The current hyphenation space is available in the
1687 .B \[rs]n[.hys]
1688 register.
1691 .BI .itc\  n\ macro
1692 Variant of
1693 .B .it
1694 for which a line interrupted with
1695 .B \[rs]c
1696 counts as one input line.
1699 .BI .kern\  n
1701 .I n
1702 is non-zero or missing, enable pairwise kerning, otherwise disable it.
1705 .BI .length\  xx\ string
1706 Compute the length of
1707 .I string
1708 and return it in the number register
1709 .I xx
1710 (which is not necessarily defined before).
1713 .BI .linetabs\  n
1715 .I n
1716 is non-zero or missing, enable line-tabs mode, otherwise disable it
1717 (which is the default).
1719 In line-tabs mode, tab distances are computed relative to the
1720 (current) output line.
1722 Otherwise they are taken relative to the input line.
1724 For example, the following
1728 .ne 6v+\n(.Vu
1730 \&.ds x a\[rs]t\[rs]c
1731 \&.ds y b\[rs]t\[rs]c
1732 \&.ds z c
1733 \&.ta 1i 3i
1734 \&\[rs]*x
1735 \&\[rs]*y
1736 \&\[rs]*z
1741 yields
1746 a         b         c
1751 In line-tabs mode, the same code gives
1756 a         b                   c
1761 Line-tabs mode is associated with the current environment; the
1762 read-only number register
1763 .B \[rs]n[.linetabs]
1764 is set to\~1 if in line-tabs mode, and 0 otherwise.
1767 .BI .mso\  file
1768 The same as the
1769 .B so
1770 request except that
1771 .I file
1772 is searched for in the same directories as macro files for the the
1773 .B \-m
1774 command line option.
1776 If the file name to be included has the form
1777 .IB name .tmac
1778 and it isn't found,
1779 .B mso
1780 tries to include
1781 .BI tmac. name
1782 instead and vice versa.
1785 .BI .nop \ anything
1786 Execute
1787 .IR anything .
1788 This is similar to `.if\ 1'.
1791 .B .nroff
1792 Make the
1793 .B n
1794 built-in condition true and the
1795 .B t
1796 built-in condition false.
1798 This can be reversed using the
1799 .B troff
1800 request.
1803 .BI .open\  stream\ filename
1804 Open
1805 .I filename
1806 for writing and associate the stream named
1807 .I stream
1808 with it.
1810 See also the
1811 .B close
1813 .B write
1814 requests.
1817 .BI .opena\  stream\ filename
1818 Like
1819 .BR open ,
1820 but if
1821 .I filename
1822 exists, append to it instead of truncating it.
1825 .BI .output\  string
1826 Emit
1827 .I string
1828 directly to the intermediate output (subject to copy-mode interpretation);
1829 this is similar to
1830 .B \[rs]!\&
1831 used at the top level.
1833 An initial double quote in
1834 .I string
1835 is stripped off to allow initial blanks.
1838 .B .pev
1839 Print the current environment and each defined environment state on
1840 stderr.
1843 .B .pnr
1844 Print the names and contents of all currently defined number registers
1845 on stderr.
1848 .BI .psbb \ filename
1849 Get the bounding box of a PostScript image
1850 .IR filename .
1851 This file must conform to Adobe's Document Structuring Conventions;
1852 the command looks for a
1853 .B \%%%BoundingBox
1854 comment to extract the bounding box values.
1856 After a successful call, the coordinates (in PostScript units) of the
1857 lower left and upper right corner can be found in the registers
1858 .BR \[rs]n[llx] ,
1859 .BR \[rs]n[lly] ,
1860 .BR \[rs]n[urx] ,
1862 .BR \[rs]n[ury] ,
1863 respectively.
1865 If some error has occurred, the four registers are set to zero.
1868 .BI .pso \ command
1869 This behaves like the
1870 .B so
1871 request except that input comes from the standard output of
1872 .IR command .
1875 .B .ptr
1876 Print the names and positions of all traps (not including input line
1877 traps and diversion traps) on stderr.
1879 Empty slots in the page trap list are printed as well, because they
1880 can affect the priority of subsequently planted traps.
1883 .BI .pvs \ \[+-]n
1884 Set the post-vertical line space to\~\c
1885 .IR n ;
1886 default scale indicator is\~\c
1887 .BR p .
1889 This value is added to each line after it has been output.
1891 With no argument, the post-vertical line space is set to its previous
1892 value.
1895 The total vertical line spacing consists of four components:
1896 .B .vs
1898 .B \[rs]x
1899 with a negative value which are applied before the line is output, and
1900 .B .pvs
1902 .B \[rs]x
1903 with a positive value which are applied after the line is output.
1906 .BI .rchar\  c1\ c2\|.\|.\|.\&
1907 Remove the definitions of glyphs
1908 .IR c1 ,
1909 .IR c2 ,\|.\|.\|.
1910 This undoes the effect of a
1911 .B char
1912 request.
1915 .B .return
1916 Within a macro, return immediately.
1918 If called with an argument, return twice, namely from the current macro and
1919 from the macro one level higher.
1921 No effect otherwise.
1924 .BI .rfschar\  c1\ c2\|.\|.\|.\&
1925 Remove the font-specific definitions of glyphs
1926 .IR c1 ,
1927 .IR c2 ,\|.\|.\|.
1928 This undoes the effect of a
1929 .B fschar
1930 request.
1933 .B .rj
1935 .BI .rj \~n
1936 Right justify the next
1937 .IR n \~\c
1938 input lines.
1940 Without an argument right justify the next input line.
1942 The number of lines to be right justified is available in the
1943 .B \[rs]n[.rj]
1944 register.
1946 This implicitly does
1947 .BR .ce\~0 .
1949 .B ce
1950 request implicitly does
1951 .BR .rj\~0 .
1954 .BI .rnn \ xx\ yy
1955 Rename number register
1956 .I xx
1958 .IR yy .
1961 .BI .schar\  c\ string
1962 Define global fallback character (or glyph)\~\c
1963 .I c
1964 to be
1965 .IR string .
1967 The syntax of this request is the same as the
1968 .B char
1969 request; a glyph defined with
1970 .B schar
1971 is searched after the list of fonts declared with the
1972 .B special
1973 request but before the mounted special fonts.
1976 .BI .shc\  c
1977 Set the soft hyphen character to\~\c
1978 .IR c .
1980 .I c
1981 is omitted, the soft hyphen character is set to the default
1982 .BR \[rs][hy] .
1983 The soft hyphen character is the glyph which is inserted when
1984 a word is hyphenated at a line break.
1986 If the soft hyphen character does not exist in the font of the
1987 glyph immediately preceding a potential break point, then the line
1988 is not broken at that point.
1990 Neither definitions (specified with the
1991 .B char
1992 request) nor translations (specified with the
1993 .B tr
1994 request) are considered when finding the soft hyphen character.
1997 .BI .shift\  n
1998 In a macro, shift the arguments by
1999 .I n
2000 positions: argument\~\c
2001 .I i
2002 becomes argument
2003 .IR i \|\-\| n ;
2004 arguments 1 to\~\c
2005 .I n
2006 are no longer available.
2009 .I n
2010 is missing, arguments are shifted by\~1.
2012 Shifting by negative amounts is currently undefined.
2015 .BI .sizes\  s1\ s2\|.\|.\|.\|sn\  [0]
2016 This command is similar to the
2017 .B sizes
2018 command of a
2019 .B DESC
2020 file.
2022 It sets the available font sizes for the current font to
2023 .IR s1 ,
2024 .IR s2 ,\|.\|.\|.\|,\~ sn
2025 scaled points.
2027 The list of sizes can be terminated by an optional\~\c
2028 .BR 0 .
2030 Each
2031 .I si
2032 can also be a range of sizes
2033 .IR m - n .
2035 Contrary to the font file command, the list can't extend over more
2036 than a single line.
2039 .BI .special\  s1\ s2\|.\|.\|.\&
2040 Fonts
2041 .IR s1 ,
2042 .IR s2 ,\|.\|.\|.\&
2043 are special and are searched for glyphs not in the current
2044 font.
2046 Without arguments, reset the list of special fonts to be empty.
2049 .BI .spreadwarn\  limit
2050 Make
2051 .B troff
2052 emit a warning if the additional space inserted for each space between
2053 words in an output line is larger or equal to
2054 .IR limit .
2056 A negative value is changed to zero; no argument toggles the warning on
2057 and off without changing
2058 .IR limit .
2060 The default scaling indicator is\~\c
2061 .BR m .
2063 At startup,
2064 .B spreadwarn
2065 is deactivated, and
2066 .I limit
2067 is set to 3m.
2069 For example,
2070 .B .spreadwarn\ 0.2m
2071 causes a warning if
2072 .B troff
2073 must add 0.2m or more for each interword space in a line.
2075 This request is active only if text is justified to both margins (using
2076 .BR .ad\ b ).
2079 .BI .sty\  n\ f
2080 Associate style\~\c
2081 .I f
2082 with font position\~\c
2083 .IR n .
2084 A font position can be associated either with a font or with a style.
2086 The current font is the index of a font position and so is also either
2087 a font or a style.
2089 When it is a style, the font that is actually used is the font the
2090 name of which is the concatenation of the name of the current family
2091 and the name of the current style.
2093 For example, if the current font is\~1 and font position\~1 is
2094 associated with style\~\c
2095 .B R
2096 and the current font family is\~\c
2097 .BR T ,
2098 then font
2099 .BR TR
2100 is used.
2102 If the current font is not a style, then the current family is ignored.
2104 When the requests
2105 .BR cs ,
2106 .BR bd ,
2107 .BR tkf ,
2108 .BR uf ,
2110 .B fspecial
2111 are applied to a style, then they are applied instead to the
2112 member of the current family corresponding to that style.
2114 The default family can be set with the
2115 .B \-f
2116 command line option.
2119 .B styles
2120 command in the
2121 .SM DESC
2122 file controls which font positions (if any) are initially associated
2123 with styles rather than fonts.
2126 .BI .substring\  xx\ n1\  [ n2 ]
2127 Replace the string named
2128 .I xx
2129 with the substring defined by the indices
2130 .I n1
2132 .IR n2 .
2133 The first character in the string has index\~0.
2136 .I n2
2137 is omitted, it is taken to be equal to the string's length.
2139 If the index value
2140 .I n1
2142 .I n2
2143 is negative, it is counted from the end of the string,
2144 going backwards:
2146 The last character has index\~\-1, the character before the last
2147 character has index\~\-2, etc.
2150 .BI .tkf\  f\ s1\ n1\ s2\ n2
2151 Enable track kerning for font\~\c
2152 .IR f .
2153 When the current font is\~\c
2154 .I f
2155 the width of every glyph is increased by an amount between
2156 .I n1
2158 .IR n2 ;
2159 when the current point size is less than or equal to
2160 .I s1
2161 the width is increased by
2162 .IR n1 ;
2163 when it is greater than or equal to
2164 .I s2
2165 the width is increased by
2166 .IR n2 ;
2167 when the point size is greater than or equal to
2168 .I s1
2169 and less than or equal to
2170 .I s2
2171 the increase in width is a linear function of the point size.
2174 .BI .tm1\  string
2175 Similar to the
2176 .B tm
2177 request,
2178 .I string
2179 is read in copy mode and written on the standard error, but an initial
2180 double quote in
2181 .I string
2182 is stripped off to allow initial blanks.
2185 .BI .tmc\  string
2186 Similar to
2187 .B tm1
2188 but without writing a final newline.
2191 .BI .trf\  filename
2192 Transparently output the contents of file
2193 .IR filename .
2194 Each line is output as if preceded by
2195 .BR \[rs]! ;
2196 however, the lines are not subject to copy-mode interpretation.
2198 If the file does not end with a newline, then a newline is added.
2200 For example, you can define a macro\~\c
2201 .I x
2202 containing the contents of file\~\c
2203 .IR f ,
2204 using
2208 .ne 2v+\n(.Vu
2210 \&.di x
2211 \&.trf f
2212 \&.di
2217 Unlike with the
2218 .B cf
2219 request, the file cannot contain characters such as
2220 .SM NUL
2221 that are not valid troff input characters.
2224 .BI .trin\  abcd
2225 This is the same as the
2226 .B tr
2227 request except that the
2228 .B asciify
2229 request uses the character code (if any) before the character
2230 translation.
2232 Example:
2237 \&.trin ax
2238 \&.di xxx
2240 \&.br
2241 \&.di
2242 \&.xxx
2243 \&.trin aa
2244 \&.asciify xxx
2245 \&.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 \&.tr ab
2271 \&.di x
2272 \&\[rs]!.tm a
2273 \&.di
2274 \&.x
2279 prints\~\c
2280 .BR b ;
2282 .B trnt
2283 is used instead of
2284 .B tr
2285 it prints\~\c
2286 .BR a .
2290 .B .troff
2291 Make the
2292 .B n
2293 built-in condition false, and the
2294 .B t
2295 built-in condition true.
2297 This undoes the effect of the
2298 .B nroff
2299 request.
2302 .BI .unformat\  xx
2303 This request `unformats' the diversion
2304 .IR xx .
2305 Contrary to the
2306 .B asciify
2307 request, which tries to convert formatted elements of the diversion
2308 back to input tokens as much as possible,
2309 .B .unformat
2310 only handles tabs and spaces between words (usually caused by
2311 spaces or newlines in the input) specially.
2313 The former are treated as if they were input tokens, and the latter
2314 are stretchable again.
2316 Note that the vertical size of lines is not preserved.
2318 Glyph information (font, font size, space width, etc.) is retained.
2320 Useful in conjunction with the
2321 .B box
2323 .B boxa
2324 requests.
2327 .BI .vpt\  n
2328 Enable vertical position traps if
2329 .I n
2330 is non-zero, disable them otherwise.
2332 Vertical position traps are traps set by the
2333 .B wh
2335 .B dt
2336 requests.
2338 Traps set by the
2339 .B it
2340 request are not vertical position traps.
2342 The parameter that controls whether vertical position traps are
2343 enabled is global.
2345 Initially vertical position traps are enabled.
2348 .BI .warn\  n
2349 Control warnings.
2350 .IR n \~\c
2351 is the sum of the numbers associated with each warning that is to be
2352 enabled; all other warnings are disabled.
2354 The number associated with each warning is listed in
2355 .BR @L_TROFF@ (@MAN1EXT@).
2357 For example,
2358 .B .warn\~0
2359 disables all warnings, and
2360 .B .warn\~1
2361 disables all warnings except that about missing glyphs.
2364 .I n
2365 is not given, all warnings are enabled.
2368 .BI .warnscale\  si
2369 Set the scaling indicator used in warnings to
2370 .IR si .
2372 Valid values for
2373 .I si
2375 .BR u ,
2376 .BR i ,
2377 .BR c ,
2378 .BR p ,
2379 and\~\c
2380 .BR P .
2382 At startup, it is set to\~\c
2383 .BR i .
2386 .BI .while \ c\ anything
2387 While condition\~\c
2388 .I c
2389 is true, accept
2390 .I anything
2391 as input;
2392 .IR c \~\c
2393 can be any condition acceptable to an
2394 .B if
2395 request;
2396 .I anything
2397 can comprise multiple lines if the first line starts with
2398 .B \[rs]{
2399 and the last line ends with
2400 .BR \[rs]} .
2401 See also the
2402 .B break
2404 .B continue
2405 requests.
2408 .BI .write\  stream\ anything
2409 Write
2410 .I anything
2411 to the stream named
2412 .IR stream .
2413 .I stream
2414 must previously have been the subject of an
2415 .B open
2416 request.
2417 .I anything
2418 is read in copy mode;
2419 a leading\~\c
2420 .B \[dq]
2421 is stripped.
2424 .BI .writec\  stream\ anything
2425 Similar to
2426 .B write
2427 but without writing a final newline.
2430 .BI .writem\  stream\ xx
2431 Write the contents of the macro or string
2432 .I xx
2433 to the stream named
2434 .IR stream .
2435 .I stream
2436 must previously have been the subject of an
2437 .B open
2438 request.
2439 .I xx
2440 is read in copy mode.
2444 .SS "Extended escape sequences"
2448 .BR \[rs]D' .\|.\|. '
2449 All drawing commands of @L_ROFF@'s intermediate output are accepted.
2451 See subsection
2452 .B "Drawing Commands"
2453 below for more information.
2457 .SS "Extended requests"
2461 .BI .cf\  filename
2462 When used in a diversion, this embeds in the diversion an object
2463 which, when reread, will cause the contents of
2464 .I filename
2465 to be transparently copied through to the output.
2467 In UNIX troff, the contents of
2468 .I filename
2469 is immediately copied through to the output regardless of whether
2470 there is a current diversion; this behaviour is so anomalous that it
2471 must be considered a bug.
2474 .BI .de\  xx\ yy
2476 .BI .am\  xx\ yy
2478 .BI .ds\  xx\ yy
2480 .BI .as\  xx\ yy
2481 In compatibility mode, these requests behaves similar to
2482 .BR .de1 ,
2483 .BR .am1 ,
2484 .BR .ds1 ,
2486 .BR .as1 ,
2487 respectively: A `compatibility save' token is inserted at the
2488 beginning, and a `compatibility restore' token at the end, with
2489 compatibility mode switched on during execution.
2492 .BI .ev\  xx
2494 .I xx
2495 is not a number, this switches to a named environment called
2496 .IR xx .
2497 The environment should be popped with a matching
2498 .B ev
2499 request without any arguments, just as for numbered environments.
2501 There is no limit on the number of named environments; they are
2502 created the first time that they are referenced.
2505 .BI .ss\  m\ n
2506 When two arguments are given to the
2507 .B ss
2508 request, the second argument gives the
2509 .IR "sentence space size" .
2510 If the second argument is not given, the sentence space size
2511 is the same as the word space size.
2513 Like the word space size, the sentence space is in units of
2514 one twelfth of the spacewidth parameter for the current font.
2516 Initially both the word space size and the sentence
2517 space size are\~12.
2519 Contrary to UNIX troff, @L_TROFF@ handles this request in nroff mode
2520 also; a given value is then rounded down to the nearest multiple
2521 of\~12.
2523 The sentence space size is used in two circumstances.
2525 If the end of a sentence occurs at the end of a line in fill mode,
2526 then both an inter-word space and a sentence space are added; if
2527 two spaces follow the end of a sentence in the middle of a line, then
2528 the second space is a sentence space.
2530 Note that the behaviour of UNIX troff are exactly that exhibited
2531 by @L_TROFF@ if a second argument is never given to the
2532 .B ss
2533 request.
2535 In @L_TROFF@, as in UNIX troff, you should always follow a sentence
2536 with either a newline or two spaces.
2539 .BI .ta\  n1\ n2\|.\|.\|.nn \ T\  r1\ r2\|.\|.\|.\|rn
2540 Set tabs at positions
2541 .IR n1 ,
2542 .IR n2 ,\|.\|.\|.\|,
2543 .I nn
2544 and then set tabs at
2545 .IR nn \|+\| r1 ,
2546 .IR nn \|+\| r2 ,\|.\|.\|.\|,
2547 .IR nn \|+\| rn
2548 and then at
2549 .IR nn \|+\| rn \|+\| r1 ,
2550 .IR nn \|+\| rn \|+\| r2 ,\|.\|.\|.\|,
2551 .IR nn \|+\| rn \|+\| rn ,
2552 and so on.
2553 For example,
2558 \&.ta T .5i
2562 sets tabs every half an inch.
2567 .SS "New number registers"
2570 The following read-only registers are available:
2573 .B \[rs]n[.br]
2574 Within a macro call, it is set to\~1 if the macro is called with the
2575 `normal' control character (`.' by default), and set to\~0 otherwise.
2576 This allows to reliably modify requests.
2580 .ne 6v+\n(.Vu
2582 \&.als bp*orig bp
2583 \&.de bp
2584 \&.tm before bp
2585 \&.ie \[rs]\[rs]n[.br] .bp*orig
2586 \&.el 'bp*orig
2587 \&.tm after bp
2588 \&..
2593 Using this register outside of a macro makes no sense (it always returns
2594 zero in such cases).
2597 .B \[rs]n[.C]
2598 1\~if compatibility mode is in effect, 0\~otherwise.
2601 .B \[rs]n[.cdp]
2602 The depth of the last glyph added to the current environment.
2604 It is positive if the glyph extends below the baseline.
2607 .B \[rs]n[.ce]
2608 The number of lines remaining to be centered, as set by the
2609 .B ce
2610 request.
2613 .B \[rs]n[.cht]
2614 The height of the last glyph added to the current environment.
2616 It is positive if the glyph extends above the baseline.
2619 .B \[rs]n[.color]
2620 1\~if colors are enabled, 0\~otherwise.
2623 .B \[rs]n[.csk]
2624 The skew of the last glyph added to the current environment.
2627 .I skew
2628 of a glyph is how far to the right of the center of a glyph
2629 the center of an accent over that glyph should be placed.
2632 .B \[rs]n[.ev]
2633 The name or number of the current environment.
2635 This is a string-valued register.
2638 .B \[rs]n[.fam]
2639 The current font family.
2641 This is a string-valued register.
2644 .B \[rs]n[.fn]
2645 The current (internal) real font name.
2647 This is a string-valued register.
2649 If the current font is a style, the value of
2650 .B \[rs]n[.fn]
2651 is the proper concatenation of family and style name.
2654 .B \[rs]n[.fp]
2655 The number of the next free font position.
2658 .B \[rs]n[.g]
2659 Always\~1.
2661 Macros should use this to determine whether they are running under
2662 @L_TROFF@.
2665 .B \[rs]n[.height]
2666 The current height of the font as set with
2667 .BR \[rs]H .
2670 .B \[rs]n[.hla]
2671 The current hyphenation language as set by the
2672 .B hla
2673 request.
2676 .B \[rs]n[.hlc]
2677 The number of immediately preceding consecutive hyphenated lines.
2680 .B \[rs]n[.hlm]
2681 The maximum allowed number of consecutive hyphenated lines, as set by
2683 .B hlm
2684 request.
2687 .B \[rs]n[.hy]
2688 The current hyphenation flags (as set by the
2689 .B hy
2690 request).
2693 .B \[rs]n[.hym]
2694 The current hyphenation margin (as set by the
2695 .B hym
2696 request).
2699 .B \[rs]n[.hys]
2700 The current hyphenation space (as set by the
2701 .B hys
2702 request).
2705 .B \[rs]n[.in]
2706 The indentation that applies to the current output line.
2709 .B \[rs]n[.int]
2710 Set to a positive value if last output line is interrupted (i.e., if
2711 it contains
2712 .BR \[rs]c ).
2715 .B \[rs]n[.kern]
2716 1\~if pairwise kerning is enabled, 0\~otherwise.
2719 .B \[rs]n[.lg]
2720 The current ligature mode (as set by the
2721 .B lg
2722 request).
2725 .B \[rs]n[.linetabs]
2726 The current line-tabs mode (as set by the
2727 .B linetabs
2728 request).
2731 .B \[rs]n[.ll]
2732 The line length that applies to the current output line.
2735 .B \[rs]n[.lt]
2736 The title length as set by the
2737 .B lt
2738 request.
2741 .B \[rs]n[.m]
2742 The name of the current drawing color.
2744 This is a string-valued register.
2747 .B \[rs]n[.M]
2748 The name of the current background color.
2750 This is a string-valued register.
2753 .B \[rs]n[.ne]
2754 The amount of space that was needed in the last
2755 .B ne
2756 request that caused a trap to be sprung.
2758 Useful in conjunction with the
2759 .B \[rs]n[.trunc]
2760 register.
2763 .B \[rs]n[.ns]
2764 1\~if no-space mode is active, 0\~otherwise.
2767 .B \[rs]n[.P]
2768 1\~if the current page is in the output list set with
2769 .BR \-o .
2772 .B \[rs]n[.pe]
2773 1\~during a page ejection caused by the
2774 .B bp
2775 request, 0\~otherwise.
2778 .B \[rs]n[.pn]
2779 The number of the next page, either the value set by a
2780 .B pn
2781 request, or the number of the current page plus\~1.
2784 .B \[rs]n[.ps]
2785 The current point size in scaled points.
2788 .B \[rs]n[.psr]
2789 The last-requested point size in scaled points.
2792 .B \[rs]n[.pvs]
2793 The current post-vertical line space as set with the
2794 .B pvs
2795 request.
2798 .B \[rs]n[.rj]
2799 The number of lines to be right-justified as set by the
2800 .B rj
2801 request.
2804 .B \[rs]n[.slant]
2805 The slant of the current font as set with
2806 .BR \[rs]S .
2809 .B \[rs]n[.sr]
2810 The last requested point size in points as a decimal fraction.
2812 This is a string-valued register.
2815 .B \[rs]n[.ss]
2817 .B \[rs]n[.sss]
2818 These give the values of the parameters set by the first and second
2819 arguments of the
2820 .B ss
2821 request.
2824 .B \[rs]n[.sty]
2825 The current font style.
2827 This is a string-valued register.
2830 .B \[rs]n[.tabs]
2831 A string representation of the current tab settings suitable for use
2832 as an argument to the
2833 .B ta
2834 request.
2837 .B \[rs]n[.trunc]
2838 The amount of vertical space truncated by the most recently sprung
2839 vertical position trap, or, if the trap was sprung by a
2840 .B ne
2841 request, minus the amount of vertical motion produced by the
2842 .B ne
2843 request.
2845 In  other  words, at the point  a  trap is  sprung,  it represents the
2846 difference of  what the vertical position  would have been but for the
2847 trap, and what the vertical position actually is.
2849 Useful in conjunction with the
2850 .B \[rs]n[.ne]
2851 register.
2854 .B \[rs]n[.U]
2855 Set to\~1 if in safer mode and to\~0 if in unsafe mode (as given with
2857 .B \-U
2858 command line option).
2861 .B \[rs]n[.vpt]
2862 1\~if vertical position traps are enabled, 0\~otherwise.
2865 .B \[rs]n[.warn]
2866 The sum of the numbers associated with each of the currently enabled
2867 warnings.
2869 The number associated with each warning is listed in
2870 .BR @L_TROFF@ (@MAN1EXT@).
2873 .B \[rs]n[.x]
2874 The major version number.
2876 For example, if the version number is 1.03, then
2877 .B \[rs]n[.x]
2878 contains\~1.
2881 .B \[rs]n[.y]
2882 The minor version number.
2884 For example, if the version number is 1.03, then
2885 .B \[rs]n[.y]
2886 contains\~03.
2889 .B \[rs]n[.Y]
2890 The revision number of @T_ROFF@.
2893 .B \[rs]n[.zoom]
2894 The zoom value of the current font, in multiples of 1/1000th.
2895 Zero if no magnification.
2898 .B \[rs]n[llx]
2900 .B \[rs]n[lly]
2902 .B \[rs]n[urx]
2904 .B \[rs]n[ury]
2905 These four registers are set by the
2906 .B psbb
2907 request and contain the bounding box values (in PostScript units) of a
2908 given PostScript image.
2911 The following read/\:write registers are set by the
2912 .B \[rs]w
2913 escape sequence:
2916 .B \[rs]n[rst]
2918 .B \[rs]n[rsb]
2919 Like the
2920 .B st
2922 .B sb
2923 registers, but take account of the heights and depths of glyphs.
2926 .B \[rs]n[ssc]
2927 The amount of horizontal space (possibly negative) that should be
2928 added to the last glyph before a subscript.
2931 .B \[rs]n[skw]
2932 How far to right of the center of the last glyph in the
2933 .B \[rs]w
2934 argument, the center of an accent from a roman font should be placed
2935 over that glyph.
2938 Other available read/write number registers are:
2941 .B \[rs]n[c.]
2942 The current input line number.
2943 .B \[rs]n[.c]
2944 is a read-only alias to this register.
2947 .B \[rs]n[hours]
2948 The number of hours past midnight.
2950 Initialized at start-up.
2953 .B \[rs]n[hp]
2954 The current horizontal position at input line.
2957 .B \[rs]n[minutes]
2958 The number of minutes after the hour.
2960 Initialized at start-up.
2963 .B \[rs]n[seconds]
2964 The number of seconds after the minute.
2966 Initialized at start-up.
2969 .B \[rs]n[systat]
2970 The return value of the system() function executed by the last
2971 .B sy
2972 request.
2975 .B \[rs]n[slimit]
2976 If greater than\~0, the maximum number of objects on the input stack.
2978 If less than or equal to\~0, there is no limit on the number of
2979 objects on the input stack.
2981 With no limit, recursion can continue until virtual memory is
2982 exhausted.
2985 .B \[rs]n[year]
2986 The current year.
2988 Note that the traditional
2989 .B troff
2990 number register
2991 .B \[rs]n[yr]
2992 is the current year minus 1900.
2996 .SS Miscellaneous
2999 .B @L_TROFF@
3000 predefines a single (read/write) string-based register,
3001 .BR \[rs]*[.T] ,
3002 which contains the argument given to the
3003 .B \-T
3004 command line option, namely the current output device (for example,
3005 .I latin1
3007 .IR ascii ).
3008 Note that this is not the same as the (read-only) number register
3009 .B \[rs]n[.T]
3010 which is defined to be\~1 if
3011 .B troff
3012 is called with the
3013 .B \-T
3014 command line option, and zero otherwise.
3016 This behaviour is different to UNIX troff.
3019 Fonts not listed in the
3020 .SM DESC
3021 file are automatically mounted on the next available font position
3022 when they are referenced.
3024 If a font is to be mounted explicitly with the
3025 .B fp
3026 request on an unused font position, it should be mounted on the first
3027 unused font position, which can be found in the
3028 .B \[rs]n[.fp]
3029 register; although
3030 .B troff
3031 does not enforce this strictly, it does not allow a font to be mounted
3032 at a position whose number is much greater than that of any currently
3033 used position.
3036 Interpolating a string does not hide existing macro arguments.
3038 Thus in a macro, a more efficient way of doing
3041 .BI . xx\  \[rs]\[rs]$@
3046 .BI \[rs]\[rs]*[ xx ]\[rs]\[rs]
3049 If the font description file contains pairwise kerning information,
3050 glyphs from that font are kerned.
3052 Kerning between two glyphs can be inhibited by placing a
3053 .B \[rs]&
3054 between them.
3057 In a string comparison in a condition, characters that appear at
3058 different input levels to the first delimiter character are not
3059 recognized as the second or third delimiters.
3061 This applies also to the
3062 .B tl
3063 request.
3065 In a
3066 .B \[rs]w
3067 escape sequence, a character that appears at a different input level
3068 to the starting delimiter character is not recognized as the
3069 closing delimiter character.
3071 The same is true for
3072 .BR \[rs]A ,
3073 .BR \[rs]b ,
3074 .BR \[rs]B ,
3075 .BR \[rs]C ,
3076 .BR \[rs]l ,
3077 .BR \[rs]L ,
3078 .BR \[rs]o ,
3079 .BR \[rs]X ,
3081 .BR \[rs]Z .
3083 When decoding a macro or string argument that is delimited by double
3084 quotes, a character that appears at a different input level to the starting
3085 delimiter character is not recognized as the closing delimiter
3086 character.
3088 The implementation of
3089 .B \[rs]$@
3090 ensures that the double quotes surrounding an argument appear at the
3091 same input level, which is different to the input level of the
3092 argument itself.
3094 In a long escape name
3095 .B ]
3096 is not recognized as a closing delimiter except when it occurs at
3097 the same input level as the opening\~\c
3098 .BR [ .
3100 In compatibility mode, no attention is paid to the input-level.
3103 There are some new types of condition:
3106 .BI .if\ r xxx
3107 True if there is a number register named
3108 .IR xxx .
3111 .BI .if\ d xxx
3112 True if there is a string, macro, diversion, or request named
3113 .IR xxx .
3116 .BI .if\ m xxx
3117 True if there is a color named
3118 .IR xxx .
3121 .BI .if\ c ch
3122 True if there is a character (or glyph)
3123 .IR ch
3124 available;
3125 .I ch
3126 is either an
3127 .SM ASCII
3128 character or a glyph (special character)
3129 .BI \[rs]N' xxx '\f[R],
3130 .BI \[rs]( xx
3132 .BI \[rs][ xxx ]\f[R];
3133 the condition is also true if
3134 .I ch
3135 has been defined by the
3136 .B char
3137 request.
3140 .BI .if\ F f
3141 True if font\~\c
3142 .I f
3143 exists.
3145 .BR f \~\c
3146 is handled as if it was opened with the
3147 .B ft
3148 request (this is, font translation and styles are applied), without
3149 actually mounting it.
3152 .BI .if\ S s
3153 True if style\~\c
3154 .I s
3155 has been registered.
3157 Font translation is applied.
3161 .B tr
3162 request can now map characters onto
3163 .BR \[rs]\[ti] .
3166 The space width emitted by the
3167 .B \[rs]|
3169 .B \[rs]^
3170 escape sequences can be controlled on a per-font basis.
3171 If there is a glyph named
3172 .B \[rs]|
3174 .BR \[rs]^ ,
3175 respectively (note the leading backslash), defined in the current font file,
3176 use this glyph's width instead of the default value.
3179 It is now possible to have whitespace between the first and second dot
3180 (or the name of the ending macro) to end a macro definition.
3182 Example:
3185 .ne 6v+\n(.Vu
3187 \&.if t \[rs]{\[rs]
3188 \&.  de bar
3189 \&.    nop Hello, I'm `bar'.
3190 \&.  .
3191 \&.\[rs]}
3196 .SH "INTERMEDIATE OUTPUT FORMAT"
3199 This section describes the format output by @L_TROFF@.
3201 The output format used by @L_TROFF@ is very similar to that used
3202 by Unix device-independent troff.
3204 Only the differences are documented here.
3208 .SS "Units"
3211 The argument to the
3212 .BR s \~\c
3213 command is in scaled points (units of
3214 .RI points/ n ,
3215 where
3216 .I n
3217 is the argument to the
3218 .B sizescale
3219 command  in the DESC file).
3221 The argument to the
3222 .B x\ Height
3223 command is also in scaled points.
3227 .SS "Text Commands"
3231 .BI N n
3232 Print glyph with index\~\c
3233 .I n
3234 (a non-negative integer) of the current font.
3237 If the
3238 .B tcommand
3239 line is present in the DESC file, troff uses the following two
3240 commands.
3243 .BI t xxx
3244 .I xxx
3245 is any sequence of characters terminated by a space or a newline (to
3246 be more precise, it is a sequence of glyphs which are accessed with
3247 the corresponding characters); the first character should be printed at
3248 the current position, the current horizontal position should be increased
3249 by the width of the first character, and so on for each character.
3251 The width of the glyph is that given in the font file,
3252 appropriately scaled for the current point size, and rounded so that
3253 it is a multiple of the horizontal resolution.
3255 Special characters cannot be printed using this command.
3258 .BI u n\ xxx
3259 This is same as the
3260 .BR t \~\c
3261 command except that after printing each character, the current
3262 horizontal position is increased by the sum of the width of that
3263 character and\~\c
3264 .IR n .
3267 Note that single characters can have the eighth bit set, as can the
3268 names of fonts and special characters.
3271 The names of glyphs and fonts can be of arbitrary length; drivers
3272 should not assume that they are only two characters long.
3275 When a glyph is to be printed, that glyph is always
3276 in the current font.
3278 Unlike device-independent troff, it is not necessary for drivers to
3279 search special fonts to find a glyph.
3282 For color support, some new commands have been added:
3285 \f[B]mc \f[I]cyan magenta yellow\f[R]
3287 \f[B]md\f[R]
3289 \f[B]mg \f[I]gray\f[R]
3291 \f[B]mk \f[I]cyan magenta yellow black\f[R]
3293 \f[B]mr \f[I]red green blue\f[R]
3294 Set the color components of the current drawing color, using various
3295 color schemes.
3297 .B md
3298 resets the drawing color to the default value.
3300 The arguments are integers in the range 0 to 65536.
3304 .BR x \~\c
3305 device control command has been extended.
3308 \f[B]x u \f[I]n\f[R]
3310 .I n
3311 is\~1, start underlining of spaces.
3314 .I n
3315 is\~0, stop underlining of spaces.
3317 This is needed for the
3318 .B cu
3319 request in nroff mode and is ignored otherwise.
3323 .SS "Drawing Commands"
3327 .B D
3328 drawing command has been extended.
3330 These extensions are not used by @L_P_PIC@ if the
3331 .B \-n
3332 option is given.
3335 \f[B]Df \f[I]n\f[R]\*[ic]\[rs]n
3336 Set the shade of gray to be used for filling solid objects to
3337 .IR n ;
3338 .I n
3339 must be an integer between 0 and 1000, where 0 corresponds solid white
3340 and 1000 to solid black, and values in between correspond to
3341 intermediate shades of gray.
3343 This applies only to solid circles, solid ellipses and solid
3344 polygons.
3346 By default, a level of 1000 is used.
3348 Whatever color a solid object has, it should completely obscure
3349 everything beneath it.
3351 A value greater than 1000 or less than\~0 can also be used: this means
3352 fill with the shade of gray that is currently being used for lines and
3353 text.
3355 Normally this is black, but some drivers may provide a way of
3356 changing this.
3359 The corresponding
3360 .BI \[rs]D'f .\|.\|. '
3361 command shouldn't be used since its argument is always rounded to an
3362 integer multiple of the horizontal resolution which can lead to
3363 surprising results.
3366 \f[B]DC \f[I]d\f[R]\*[ic]\[rs]n
3367 Draw a solid circle with a diameter of
3368 .I d
3369 with the leftmost point at the current position.
3372 \f[B]DE \f[I]dx dy\f[R]\*[ic]\[rs]n
3373 Draw a solid ellipse with a horizontal diameter of
3374 .I dx
3375 and a vertical diameter of
3376 .I dy
3377 with the leftmost point at the current position.
3379 delim $$
3380 asda
3384 \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
3385 Draw a polygon with, for $i = 1 ,..., n+1$, the
3386 .IR i -th
3387 vertex at the current position
3389 $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$.
3391 At the moment, @L_P_PIC@ only uses this command to generate triangles
3392 and rectangles.
3395 \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
3397 Like
3398 .B Dp
3399 but draw a solid rather than outlined polygon.
3402 \f[B]Dt \f[I]n\f[R]\*[ic]\[rs]n
3403 Set the current line thickness to
3404 .IR n \~\c
3405 machine units.
3407 Traditionally Unix troff drivers use a line thickness proportional to
3408 the current point size; drivers should continue to do this if no
3409 .B Dt
3410 command has been given, or if a
3411 .B Dt
3412 command has been given with a negative value of\~\c
3413 .IR n .
3414 A zero value of\~\c
3415 .I n
3416 selects the smallest available line thickness.
3419 A difficulty arises in how the current position should be changed after
3420 the execution of these commands.
3422 This is not of great importance since the code generated by @L_P_PIC@
3423 does not depend on this.
3425 Given a drawing command of the form
3427 \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]
3430 where
3431 .I c
3432 is not one of
3433 .BR c ,
3434 .BR e ,
3435 .BR l ,
3436 .BR a ,
3437 or\~\c
3438 .BR \[ti] ,
3439 Unix troff treats each of the $x sub i$ as a horizontal quantity,
3440 and each of the $y sub i$ as a vertical quantity and assumes that
3441 the width of the drawn object is $sum from i=1 to n x sub i$,
3442 and that the height is $sum from i=1 to n y sub i$.
3444 (The assumption about the height can be seen by examining the
3445 .B st
3447 .B sb
3448 registers after using such a
3449 .BR D \~\c
3450 command in a
3451 .B \[rs]w
3452 escape sequence).
3454 This rule also holds for all the original drawing commands with the
3455 exception of
3456 .BR De .
3457 For the sake of compatibility @L_TROFF@ also follows this rule, even
3458 though it produces an ugly result in the case of the
3459 .B Dt
3461 .BR Df ,
3462 and, to a lesser extent,
3463 .B DE
3464 commands.
3466 Thus after executing a
3467 .BR D \~\c
3468 command of the form
3470 \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
3473 the current position should be increased by
3475 $( sum from i=1 to n x sub i , sum from i=1 to n y sub i )$.
3478 Another set of extensions is
3481 \f[B]DFc \f[I]cyan magenta yellow\f[R]\*[ic]\[rs]n
3483 \f[B]DFd\f[R]\*[ic]\[rs]n
3485 \f[B]DFg \f[I]gray\f[R]\*[ic]\[rs]n
3487 \f[B]DFk \f[I]cyan magenta yellow black\f[R]\*[ic]\[rs]n
3489 \f[B]DFr \f[I]red green blue\f[R]\*[ic]\[rs]n
3490 Set the color components of the filling color similar to the
3491 .BR m \~\c
3492 commands above.
3495 The current position isn't changed by those colour commands (contrary to
3496 .BR Df ).
3500 .SS "Device Control Commands"
3503 There is a continuation convention which permits the argument to the
3504 .B x\ X
3505 command to contain newlines: when outputting the argument to the
3506 .B x\ X
3507 command, @L_TROFF@ follows each newline in the argument with a
3508 .B +
3509 character (as usual, it terminates the entire argument with a
3510 newline); thus if the line after the line containing the
3511 .B x\ X
3512 command starts with
3513 .BR + ,
3514 then the newline ending the line containing the
3515 .B x\ X
3516 command should be treated as part of the argument to the
3517 .B x\ X
3518 command, the
3519 .B +
3520 should be ignored, and the part of the line following the
3521 .B +
3522 should be treated like the part of the line following the
3523 .B x\ X
3524 command.
3527 The first three output commands are guaranteed to be:
3529 .BI x\ T\  device
3531 .BI x\ res\  n\ h\ v
3533 .B x init
3537 .SH INCOMPATIBILITIES
3540 In spite of the many extensions, @T_ROFF@ has retained compatibility to
3541 classical troff to a large degree.
3543 For the cases where the extensions lead to collisions, a special
3544 compatibility mode with the restricted, old functionality was created
3545 for @T_ROFF@.
3549 .SS "Roff Language"
3552 .I @T_ROFF@
3553 provides a
3554 .B compatibility mode
3555 that allows to process roff code written for classical
3556 .B troff
3557 or for other implementations of roff in a consistent way.
3560 Compatibility mode can be turned on with the
3561 .B \-C
3562 command line option, and turned on or off with the
3563 .B .cp
3564 request.
3566 The number register
3567 .B \[rs]n(.C
3568 is\~1 if compatibility mode is on, 0\~otherwise.
3571 This became necessary because the concept for long names causes
3572 some incompatibilities.
3573 .I Classical troff
3574 interprets
3576 .B .dsabcd
3579 as defining a string
3580 .B ab
3581 with contents
3582 .BR cd .
3584 .IR @T_ROFF@
3585 mode, this is considered as a call of a macro named
3586 .BR dsabcd .
3589 Also
3590 .I classical troff
3591 interprets
3592 .B \[rs]*[
3594 .B \[rs]n[
3595 as references to a string or number register called\~\c
3596 .B [
3597 whereas
3598 .I @T_ROFF@
3599 takes this as the start of a long name.
3603 .IR "compatibility mode" ,
3604 these things are interpreted in the traditional way, so long
3605 names are not recognized.
3608 On the other hand, in
3609 .I native mode
3610 the single-character escapes
3611 .B \[rs]\[rs]
3612 (backslash),
3613 .B \[rs]|
3614 (vertical bar),
3615 .B \[rs]^
3616 (caret),
3617 .B \[rs]&
3618 (ampersand),
3619 .B \[rs]{
3620 (opening brace),
3621 .B \[rs]}
3622 (closing brace),
3623 .RB ` \[rs]\  '
3624 (space),
3625 .B \[rs]'
3626 (single quote),
3627 .B \[rs]`
3628 (backquote),
3629 .B \[rs]\-
3630 (minus),
3631 .B \[rs]_
3632 (underline),
3633 .B \[rs]!\&
3634 (bang),
3635 .B \[rs]%
3636 (percent),
3638 .B \[rs]c
3639 (character\~c)
3640 are not allowed in names of strings, macros, diversions, number
3641 registers, fonts or environments, whereas
3642 .I classical troff
3643 does.
3647 .B \[rs]A
3648 escape sequence can be helpful in avoiding these escape sequences in
3649 names.
3652 Fractional point sizes cause one noteworthy incompatibility.
3655 .I classical
3656 .IR troff ,
3658 .B ps
3659 request ignores scale indicators and so
3662 .B .ps\~10u
3666 sets the point size to 10\~points, whereas in native mode the
3667 point size is set to 10\~scaled points.
3671 .IR @T_ROFF@ ,
3672 there is a fundamental difference between unformatted input
3673 characters, and formatted output characters (glyphs).
3675 Everything that affects how a glyph is output is
3676 stored with the glyph; once a glyph has been
3677 constructed it is unaffected by any subsequent requests that are
3678 executed, including the
3679 .BR bd ,
3680 .BR cs ,
3681 .BR tkf ,
3682 .BR tr ,
3684 .B fp
3685 requests.
3688 Normally glyphs are constructed from input characters at
3689 the moment immediately before the glyph is added to the current
3690 output line.
3692 Macros, diversions and strings are all, in fact, the same type of
3693 object; they contain lists of input characters and glyphs
3694 in any combination.
3697 Special characters can be both; before being added to the output, they
3698 act as input entities, afterwards they denote glyphs.
3701 A glyph does not behave like an input character for the
3702 purposes of macro processing; it does not inherit any of the special
3703 properties that the input character from which it was constructed
3704 might have had.
3706 The following example makes things clearer.
3711 \&.di x
3712 \[rs]\[rs]\[rs]\[rs]
3713 \&.br
3714 \&.di
3715 \&.x
3720 With
3721 .I @L_TROFF@
3722 this is printed as
3723 .BR \[rs]\[rs] .
3724 So each pair of input backslashes
3725 \&`\[rs]\[rs]'
3726 is turned into a single output backslash glyph
3727 \&`\[rs]'
3728 and the resulting output backslashes are not interpreted as escape
3729 characters when they are reread.
3732 .I Classical troff
3733 would interpret them as escape characters when they were reread and
3734 would end up printing a single backslash `\[rs]'.
3737 The correct way to get a printable version of the backslash
3738 character `\[rs]' is the
3739 .B \[rs](rs
3740 escape sequence, but classical troff does not provide a clean feature
3741 for getting a non-syntactical backslash.
3743 A close method is the printable version of the current escape
3744 character using the
3745 .B \[rs]e
3746 escape sequence; this works if the current escape character is not
3747 redefined.
3749 It works in both modes (including compatibility mode), while dirty tricks
3750 like specifying a sequence of multiple backslashes do not work
3751 reliably; for the different handling in diversions, macro definitions,
3752 or text mode quickly leads to a confusion about the necessary number of
3753 backslashes.
3756 To store an escape sequence in a diversion that is interpreted
3757 when the diversion is reread, either the traditional
3758 .B \[rs]!\&
3759 transparent output facility or the
3761 .B \[rs]?\&
3762 escape sequence can be used.
3766 .SS "Intermediate Output"
3769 The @T_ROFF@ intermediate output format is in a state of evolution.
3771 So far it has some incompatibilities, but it is intended to establish
3772 a full compatibility to the classical troff output format.
3774 Actually the following incompatibilities exist:
3776 .IP \[bu] 2m
3777 The positioning after the drawing of the polygons conflicts with the
3778 classical definition.
3780 .IP \[bu] 2m
3781 The intermediate output cannot be rescaled to other devices as
3782 classical `device-independent' troff did.
3786 .SH AUTHORS
3789 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
3791 Copyright (C) 1989, 2001 - 2004, 2006 - 2008
3792 Free Software Foundation, Inc.
3795 This document is distributed under the terms of the FDL (GNU Free
3796 Documentation License) version 1.1 or later.
3798 You should have received a copy of the FDL on your system, it is also
3799 available on-line at the
3800 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
3801 GNU copyleft site
3802 .UE .
3804 This document was written by James Clark, with modifications by
3805 .MT wl@gnu.org
3806 Werner Lemberg
3809 .MT bwarken@mayn.de
3810 Bernd Warken
3811 .ME .
3815 .SH "SEE ALSO"
3818 .BR @L_ROFF@ (@MAN1EXT@)
3819 Lists all the available documentation.
3822 .BR @L_ROFF@ (@MAN7EXT@)
3823 A description of the
3824 .I @T_ROFF@
3825 language, including a short, but complete reference of all predefined
3826 requests, registers and escapes.
3829 .BR @L_ROFF@-history (@MAN7EXT@)
3830 A survey of
3831 .I roff
3832 systems, including pointers to further historical documentation.
3835 .RI [ CSTR\~#54\/ ]
3837 .I Nroff/\:Troff User's Manual
3839 .I J.\& F.\& Ossanna
3840 of 1976 in the revision of
3841 .I Brian Kernighan
3842 of 1992, being the
3843 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz
3844 classical troff documentation
3845 .UE .
3847 .\" s-ts-mode