Sync-to-go: tmac..
[s-roff.git] / man / l_roff_out.5.in
blobcf4c0a9ecb79370c57beb7aa822045aed36dfdf6
1 '\" e -- preprocess: eqn(1)
2 .ig
3 @ @L_ROFF@_out.5
5 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
7 Copyright (C) 1989, 2001 - 2008
8 Free Software Foundation, Inc.
9 rewritten from scrach 2001 by Bernd Warken <bwarken@mayn.de>
11 Permission is granted to copy, distribute and/or modify this document
12 under the terms of the GNU Free Documentation License, Version 1.1 or
13 any later version published by the Free Software Foundation; with the
14 Invariant Sections being this .ig-section and AUTHORS, with no
15 Front-Cover Texts, and with no Back-Cover Texts.
17 You should have received a copy of the Free Documentation License
18 as part of the file COPYING; also located in the main directory of the
19 source package of this program.
22 .\" ----------------- Document configuration
24 .\" Number register to decide whether the commands `{' and `}' are used
25 .\" 0: disable (actual default); 1: enable
26 .nr @USE_ENV_STACK 0
28 .ig
29 Unfortunately, old versions of groff used an illogical position change
30 after some D\~commands (Dp, DP, Dt).  If the number register
31 @STUPID_DRAWING_POSITIONING is 1 (actual default) then change position
32 after these commands, otherwise the position is not changed.
34 .nr @STUPID_DRAWING_POSITIONING 1
36 .\" ----------------- Semantical definitions
38 .nr @maxcolor 65536
39 .ds @backslash \[rs]\"
40 .ds @linebreak \fR\[la]line-break\[ra]\fP\"
42 .\" Begin of macro definitions
44 .de offset
45 .RI ( \,\\$1\/ ,\  \,\\$2\/ )\\$3
47 .de indexed_offset
48 .offset \fI\\$1\fP\d\s-3\\$2\s+3\u \fI\\$3\fP\d\s-3\\$4\s+3\u \\$5
50 .\" format: .command <name> "<arguments>" <punctuation>
51 .de command
52 \fB\\$1\fP\ \fI\,\\$2\/\fP\\$3
54 .\" format: .D-command <subcommand> "<arguments>"
55 .de D-command
56 \fBD\\$1\fP\ \fI\,\\$2\/\fP\|\*[@linebreak]
59 .\" We set these as troff micromotions rather than eqn because \d and \u
60 .\" can be lifted to XML subscript/superscript tags.  Don't change
61 .\" these to a parameterized string, man2html won't handle that.
62 .ds hv1 \fIh\d\s-3\&1\s+3\u\~v\d\s-3\&1\s+3\u\fP
63 .ds hv2 \fIh\d\s-3\&2\s+3\u\~v\d\s-3\&2\s+3\u\fP
64 .ds hvn \fIh\d\s-3\&n\s+3\u\~v\d\s-3\&n\s+3\u\fP
66 .de Da-command
67 \fBDa\fP\ \*[hv1] \*[hv2]\|\*[@linebreak]
69 .\" graphics command .D with a variable number of arguments
70 .\" format: .D-multiarg <subcommand>
71 .de D-multiarg
72 \fBD\\$1\fP\ \*[hv1] \*[hv2] .\|.\|. \*[hvn]\|\*[@linebreak]
74 .\" format: .x-command <subname> "<arguments>"
75 .de x-command
76 \fBx\\$1\fP\ \fI\\$2\fP\|\*[@linebreak]
78 .de xsub
79 .RI "(" "\\$1" " control command)"
80 .br
82 .\" End of macro definitions
85 .\"
86 .\" Title
87 .\"
89 .TH @U_ROFF@_OUT @MAN5EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
91 .SH NAME
92 @L_ROFF@_out \- @T_ROFF@ intermediate output format
95 .\"
96 .SH DESCRIPTION
97 .\"
99 This manual page describes the
100 .I intermediate output
101 format of the
102 .BR @L_ROFF@ (@MAN7EXT@)
103 text processing system
104 .BR @L_ROFF@ (@MAN1EXT@),
105 as produced by a run of the
106 .BR @L_TROFF@ (@MAN1EXT@)
107 program.
109 It contains already all device-specific information, but it is not yet
110 fed into a device postprocessor program.
111 Because of this it is called intermediate.
114 .B @L_ROFF@
115 program provides the option
116 .B -Z
117 to inhibit postprocessing, such that the produced
118 .I intermediate output
119 is sent to standard output just like calling
120 .B @L_TROFF@
121 manually.
125 In this document, the term
126 .I @L_TROFF@ output
127 describes what is output by the
128 .B @L_TROFF@
129 program, whereas
130 .I intermediate output
131 refers to the language that is accepted by the parser that prepares
132 this output for the postprocessors.
134 This parser is smarter on whitespace and implements obsolete elements
135 for compatibility, otherwise both formats are the same.
139 The main purpose of the
140 .I intermediate output
141 concept is to facilitate the development of postprocessors by
142 providing a common programming interface for all devices.
144 It has a language of its own that is completely different from the
145 .BR @L_ROFF@ (@MAN7EXT@)
146 language.
148 While the
149 .I @T_ROFF@
150 language is a high-level programming language for text processing, the
151 .I intermediate output
152 language is a kind of low-level assembler language by specifying all
153 positions on the page for writing and drawing.
158 .RI pre- groff
159 .I roff
160 versions are denoted as
161 .I classical
162 .IR troff .
164 .I intermediate output
165 produced by
166 .I classical troff
167 output was hard to understand because of strange habits.
171 .SH "LANGUAGE CONCEPTS"
174 During the run of
175 .BR @L_TROFF@ ,
177 .I roff
178 input is cracked down to the information on what has to be printed at
179 what position on the intended device.
181 So the language of the
182 .I intermediate output
183 format can be quite small.
185 Its only elements are commands with or without arguments.
187 In this document, the term \[lq]command\[rq] always refers to the
188 .I intermediate output
189 language, never to the
190 .I roff
191 language used for document formatting.
193 There are commands for positioning and text writing, for drawing, and
194 for device controlling.
198 .SS "Separation"
201 .I Classical troff output
202 had strange requirements on whitespace.
205 .B @T_ROFF@
206 output parser, however, is smart about whitespace by making it
207 maximally optional.
209 The whitespace characters, i.e., the
210 .IR tab ,
211 .IR space ,
213 .I newline
214 characters, always have a syntactical meaning.
216 They are never printable because spacing within the output is always
217 done by positioning commands.
221 Any sequence of
222 .I space
224 .I tab
225 characters is treated as a single
226 .I syntactical
227 .IR space .
229 It separates commands and arguments, but is only required when there
230 would occur a clashing between the command code and the arguments
231 without the space.
233 Most often, this happens when variable length command names,
234 arguments, argument lists, or command clusters meet.
236 Commands and arguments with a known, fixed length need not be
237 separated by
238 .I syntactical
239 .IR space .
243 A line break is a syntactical element, too.
245 Every command argument can be followed by whitespace, a comment, or a
246 newline character.
248 Thus a
249 .I syntactical line break
250 is defined to consist of optional
251 .I syntactical space
252 that is optionally followed by a comment, and a newline character.
256 The normal commands, those for positioning and text, consist of a
257 single letter taking a fixed number of arguments.
259 For historical reasons, the parser allows to stack such commands on
260 the same line, but fortunately, in
261 .I @T_ROFF@ intermediate
262 .IR output ,
263 every command with at least one argument is followed by a line break,
264 thus providing excellent readability.
267 The other commands \[em] those for drawing and device controlling \[em]
268 have a more complicated structure; some recognize long command names,
269 and some take a variable number of arguments.
271 So all
272 .B D
274 .B x
275 commands were designed to request a
276 .I syntactical line break
277 after their last argument.
279 Only one command,
280 .RB ` x\ X '
281 has an argument that can stretch over several lines, all other
282 commands must have all of their arguments on the same line as the
283 command, i.e., the arguments may not be split by a line break.
286 Empty lines, i.e., lines containing only space and/or a comment, can
287 occur everywhere.
289 They are just ignored.
293 .SS "Argument Units"
296 Some commands take integer arguments that are assumed to represent
297 values in a measurement unit, but the letter for the corresponding
298 .I scale indicator
299 is not written with the output command arguments; see
300 .BR @L_ROFF@ (@MAN7EXT@)
301 for more on this topic.
303 Most commands assume the scale indicator\~\c
304 .BR u ,
305 the basic unit of the device, some use\~\c
306 .BR z ,
308 .I scaled point unit
309 of the device, while others, such as the color commands expect plain
310 integers.
312 Note that these scale indicators are relative to the chosen device.
314 They are defined by the parameters specified in the device's
315 .I DESC
316 file; see
317 .BR @L_ROFF@_font (@MAN5EXT@).
321 Note that single characters can have the eighth bit set, as can the
322 names of fonts and special characters (this is, glyphs).
324 The names of glyphs and fonts can be of arbitrary length.
326 A glyph that is to be printed will always be in the current font.
330 A string argument is always terminated by the next whitespace
331 character (space, tab, or newline); an embedded
332 .B #
333 character is regarded as part of the argument, not as the beginning of
334 a comment command.
336 An integer argument is already terminated by the next non-digit
337 character, which then is regarded as the first character of the next
338 argument or command.
342 .SS "Document Parts"
344 A correct
345 .I intermediate output
346 document consists of two parts, the
347 .I prologue
348 and the
349 .IR body .
352 The task of the
353 .I prologue
354 is to set the general device parameters using three exactly specified
355 commands.
358 .I @T_ROFF@ prologue
359 is guaranteed to consist of the following three lines (in that order):
362 .B x\ T
363 .I device
365 .B x\ res
366 .I n\ h\ v
368 .B x init
371 with the arguments set as outlined in the section
372 .BR "Device Control Commands" .
374 However, the parser for the
375 .I intermediate output
376 format is able to swallow additional whitespace and comments as well.
381 .I body
382 is the main section for processing the document data.
384 Syntactically, it is a sequence of any commands different from the
385 ones used in the
386 .IR prologue .
388 Processing is terminated as soon as the first
389 .B x\ stop
390 command is encountered; the last line of any
391 .I @T_ROFF@ intermediate output
392 always contains such a command.
396 Semantically, the
397 .I body
398 is page oriented.
400 A new page is started by a
401 .BR p \~command.
403 Positioning, writing, and drawing commands are always done within the
404 current page, so they cannot occur before the first
405 .BR p \~command.
407 Absolute positioning (by the
408 .B H
410 .BR V \~commands)
411 is done relative to the current page, all other positioning
412 is done relative to the current location within this page.
416 .SH "COMMAND REFERENCE"
419 This section describes all
420 .I intermediate output
421 commands, the classical commands as well as the
422 .I @T_ROFF@
423 extensions.
427 .SS "Comment Command"
431 .BI # anything \[la]end-of-line\[ra]
432 A comment.
434 Ignore any characters from the
435 .BR # \~\c
436 character up to the next newline character.
439 This command is the only possibility for commenting in the
440 .I intermediate
441 .IR output .
443 Each comment can be preceded by arbitrary
444 .I syntactical
445 .IR space ;
446 every command can be terminated by a comment.
450 .SS "Simple Commands"
453 The commands in this subsection have a command code consisting of a
454 single character, taking a fixed number of arguments.
456 Most of them are commands for positioning and text writing.
458 These commands are smart about whitespace.
460 Optionally,
461 .I syntactical space
462 can be inserted before, after, and between the command letter and its
463 arguments.
465 All of these commands are stackable, i.e., they can be preceded by
466 other simple commands or followed by arbitrary other commands on the
467 same line.
469 A separating
470 .I syntactical space
471 is only necessary when two integer arguments would clash or if the
472 preceding argument ends with a string argument.
475 .if \n[@USE_ENV_STACK]=1 \{\
477 .command {
478 Open a new environment by copying the actual device configuration data
479 to the environment stack.
481 The current environment is setup by the device specification and
482 manipulated by the setting commands.
486 .command }
487 Close the actual environment (opened by a preceding
488 .BR { \~command)
489 and restore the previous environment from the environment
490 stack as the actual device configuration data.
492 .\}              \" endif @USE_ENV_STACK
496 .command C xxx \[la]white-space\[ra]
497 Print a glyph (special character) named
498 .IR xxx .
500 The trailing
501 .I syntactical space
503 .I line break
504 is necessary to allow glyph names of arbitrary length.
506 The glyph is printed at the current print position; the
507 glyph's size is read from the font file.
509 The print position is not changed.
513 .command c c
514 Print glyph with single-letter name\~\c
515 .I c
516 at the current print position;
517 the glyph's size is read from the font file.
519 The print position is not changed.
523 .command f n
524 Set font to font number\~\c
525 .I n
526 (a non-negative integer).
530 .command H n
531 Move right to the absolute vertical position\~\c
532 .I n
533 (a non-negative integer in basic units\~\c
534 .BR u )
535 relative to left edge of current page.
539 .command h n
540 Move
541 .I n
542 (a non-negative integer) basic units\~\c
543 .B u
544 horizontally to the right.
546 .I [CSTR\~#54]
547 allows negative values for
548 .I n
549 also, but
550 .I @T_ROFF@
551 doesn't use this.
555 .command m "color-scheme \fR[\fPcomponent .\|.\|.\fR]\fP"
556 Set the color for text (glyphs), line drawing, and the outline of
557 graphic objects using different color schemes; the analoguous command
558 for the filling color of graphic objects is
559 .BR DF .
561 The color components are specified as integer arguments between 0 and
562 \n[@maxcolor].
564 The number of color components and their meaning vary for the
565 different color schemes.
567 These commands are generated by the escape sequence
568 .BR \*[@backslash]m .
570 No position changing.
572 These commands are a
573 .I @T_ROFF@
574 extension.
580 .command mc "cyan magenta yellow"
581 Set color using the CMY color scheme, having the 3\~color components
582 cyan, magenta, and yellow.
586 .command md
587 Set color to the default color value
588 (black in most cases).
590 No component arguments.
594 .command mg "gray"
595 Set color to the shade of gray given by the argument, an integer
596 between 0 (black) and \n[@maxcolor] (white).
600 .command mk "cyan magenta yellow black"
601 Set color using the CMYK color scheme, having the 4\~color components
602 cyan, magenta, yellow, and black.
605 .command mr "red green blue"
606 Set color using the RGB color scheme, having the 3\~color components
607 red, green, and blue.
613 .command N n
614 Print glyph with index\~\c
615 .I n
616 (an integer, normally non-negative) of the current font.
618 The print position is not changed.
621 .B \-T\~html
623 .B \-T\~xhtml
624 is used, negative values are emitted also to indicate an unbreakable space
625 with given width.
627 For example,
628 .B N\~\-193
629 represents an unbreakable space which has a width of 193\|u.
631 This command is a
632 .I @T_ROFF@
633 extension.
637 .command n b\ a
638 Inform the device about a line break, but no positioning is done by
639 this command.
642 .I classical
643 .IR troff ,
644 the integer arguments
645 .I b
646 and\~\c
647 .I a
648 informed about the space before and after the current line to
649 make the
650 .I intermediate output
651 more human readable without performing any action.
654 .IR @T_ROFF@
655 they are just ignored, but they must be provided for compatibility
656 reasons.
660 .command p n
661 Begin a new page in the outprint.
663 The page number is set to\~\c
664 .IR n .
666 This page is completely independent of pages formerly processed even
667 if those have the same page number.
669 The vertical position on the outprint is automatically set to\~0.
671 All positioning, writing, and drawing is always done relative to a
672 page, so a
673 .BR p \~command
674 must be issued before any of these commands.
678 .command s n
679 Set point size to
680 .I n
681 scaled points
682 (this is unit\~\c
683 .B z
685 .BR @L_TROFF@ ).
687 .I Classical troff
688 used the unit
689 .I points
691 .BR p )
692 instead; see section
693 .BR COMPATIBILITY .
697 .command t xyz\|.\|.\|. \[la]white-space\[ra]
699 .command t "xyz\|.\|.\|.\& dummy-arg" \[la]white-space\[ra]
700 Print a word, i.e., a sequence of glyphs with single-letter names
701 .IR x ,
702 .IR y ,
703 .IR z ,
704 etc., terminated by a space character or a line break; an optional
705 second integer argument is ignored (this allows the formatter to
706 generate an even number of arguments).
708 The first glyph should be printed at the current position, the
709 current horizontal position should then be increased by the width of
710 the first glyph, and so on for each glyph.
712 The widths of the glyph are read from the font file, scaled for the
713 current point size, and rounded to a multiple of the horizontal
714 resolution.
716 Special characters (glyphs with names longer than a single letter)
717 cannot be printed using this command; use the
718 .B C
719 command for those glyphs.
721 This command is a
722 .I @T_ROFF@
723 extension; it is only used for devices whose
724 .I DESC
725 file contains the
726 .B tcommand
727 keyword; see
728 .BR @L_ROFF@_font (@MAN5EXT@).
732 .command u "n xyz\|.\|.\|." \[la]white-space\[ra]
733 Print word with track kerning.
735 This is the same as the
736 .B t
737 command except that after printing each glyph, the current
738 horizontal position is increased by the sum of the width of that
739 glyph and\~\c
740 .I n
741 (an integer in
742 basic units\~\c
743 .BR u ).
744 This command is a
745 .I @T_ROFF@
746 extension; it is only used for devices whose
747 .I DESC
748 file contains the
749 .B tcommand
750 keyword; see
751 .BR @L_ROFF@_font (@MAN5EXT@).
755 .command V n
756 Move down to the absolute vertical position\~\c
757 .I n
758 (a non-negative integer in basic units\~\c
759 .BR u )
760 relative to upper edge of current page.
764 .command v n
765 Move
766 .I n
767 basic units\~\c
768 .B u
769 down
770 .RI ( n
771 is a non-negative integer).
773 .I [CSTR\~#54]
774 allows negative values for
775 .I n
776 also, but
777 .I @T_ROFF@
778 doesn't use this.
782 .command w
783 Informs about a paddable whitespace to increase readability.
785 The spacing itself must be performed explicitly by a move command.
789 .SS "Graphics Commands"
792 Each graphics or drawing command in the
793 .I intermediate output
794 starts with the letter\~\c
795 .B D
796 followed by one or two characters that specify a subcommand; this
797 is followed by a fixed or variable number of integer arguments that
798 are separated by a single space character.
801 .B D\c
802 \~command
803 may not be followed by another command on the same line (apart from a
804 comment), so each
805 .B D\c
806 \~command
807 is terminated by a
808 .I syntactical line
809 .IR break .
813 .B @L_TROFF@
814 output follows the classical spacing rules (no space between command
815 and subcommand, all arguments are preceded by a single space
816 character), but the parser allows optional space between the command
817 letters and makes the space before the first argument optional.
819 As usual, each space can be any sequence of tab and space characters.
823 Some graphics commands can take a variable number of arguments.
825 In this case, they are integers representing a size measured in basic
826 units\~\c
827 .BR u .
830 .I h
831 arguments
832 stand for horizontal distances where positive means right, negative
833 left.
836 .I v
837 arguments
838 stand for vertical distances where positive means down, negative up.
840 All these distances are offsets relative to the current location.
844 Unless indicated otherwise, each graphics command directly corresponds
845 to a similar
846 .B \*[@backslash]D
847 escape sequence; see
848 .BR @L_ROFF@ (@MAN7EXT@).
852 Unknown
853 .B D\c
854 \~commands are assumed to be device-specific.
856 Its arguments are parsed as strings; the whole information is then
857 sent to the postprocessor.
861 In the following command reference, the syntax element
862 .I \[la]line-break\[ra]
863 means a
864 .I syntactical line break
865 as defined in section
866 .BR Separation .
870 .D-multiarg ~
871 Draw B-spline from current position to offset
872 .indexed_offset h 1 v 1 ,
873 then to offset
874 .indexed_offset h 2 v 2
875 if given, etc., up to
876 .indexed_offset h n v n .
877 This command takes a variable number of argument pairs; the current
878 position is moved to the terminal point of the drawn curve.
882 .Da-command
883 Draw arc from current position to
884 .indexed_offset h 1 v 1 \|+\|\c
885 .indexed_offset h 2 v 2
886 with center at
887 .indexed_offset h 1 v 1 ;
888 then move the current position to the final point of the arc.
892 .D-command C d
894 .D-command C "d dummy-arg"
895 Draw a solid circle using the current fill color with diameter\~\c
896 .I d
897 (integer in basic units\~\c
898 .BR u )
899 with leftmost point at the current position; then move the current
900 position to the rightmost point of the circle.
902 An optional second integer argument is ignored (this allows to the
903 formatter to generate an even number of arguments).
905 This command is a
906 .I @T_ROFF@
907 extension.
911 .D-command c d
912 Draw circle line with diameter\~\c
913 .I d
914 (integer in basic units\~\c
915 .BR u )
916 with leftmost point at the current position; then move the current
917 position to the rightmost point of the circle.
921 .D-command E "h v"
922 Draw a solid ellipse in the current fill color with a horizontal
923 diameter of\~\c
924 .I h
925 and a vertical diameter of\~\c
926 .I v
927 (both integers in basic units\~\c
928 .BR u )
929 with the leftmost point at the current position; then move to the
930 rightmost point of the ellipse.
932 This command is a
933 .I @T_ROFF@
934 extension.
938 .D-command e "h v"
939 Draw an outlined ellipse with a horizontal diameter of\~\c
940 .I h
941 and a vertical diameter of\~\c
942 .I v
943 (both integers in basic units\~\c
944 .BR u )
945 with the leftmost point at current position; then move to the
946 rightmost point of the ellipse.
950 .D-command F "color-scheme \fR[\fPcomponent .\|.\|.\fR]\fP"
951 Set fill color for solid drawing objects using different color
952 schemes; the analoguous command for setting the color of text, line
953 graphics, and the outline of graphic objects is
954 .BR m .
956 The color components are specified as integer arguments between 0 and
957 \n[@maxcolor].
959 The number of color components and their meaning vary for the
960 different color schemes.
962 These commands are generated by the
963 escape sequences
964 .BR \*[@backslash]D'F\  .\|.\|. '
966 .B \*[@backslash]M
967 (with no other corresponding graphics commands).
969 No position changing.
971 This command is a
972 .I @T_ROFF@
973 extension.
979 .D-command Fc "cyan magenta yellow"
980 Set fill color for solid drawing objects using the CMY color scheme,
981 having the 3\~color components cyan, magenta, and yellow.
985 .D-command Fd
986 Set fill color for solid drawing objects to the default fill color value
987 (black in most cases).
989 No component arguments.
993 .D-command Fg "gray"
994 Set fill color for solid drawing objects to the shade of gray given by
995 the argument, an integer between 0 (black) and \n[@maxcolor] (white).
999 .D-command Fk "cyan magenta yellow black"
1000 Set fill color for solid drawing objects using the CMYK color scheme,
1001 having the 4\~color components cyan, magenta, yellow, and black.
1004 .D-command Fr "red green blue"
1005 Set fill color for solid drawing objects using the RGB color scheme,
1006 having the 3\~color components red, green, and blue.
1012 .D-command f n
1013 The argument
1014 .I n
1015 must be an integer in the range -32767 to 32767.
1019 .RI 0\|\[<=]\| n \|\[<=]\|1000
1020 Set the color for filling solid drawing objects to a shade of gray,
1021 where 0 corresponds to solid white, 1000 (the default) to solid black,
1022 and values inbetween to intermediate shades of gray; this is
1023 obsoleted by command
1024 .BR DFg .
1027 .IR n "\|<\|0 or " n \|>\|1000
1028 Set the filling color to the color that is currently being used for
1029 the text and the outline, see command
1030 .BR m .
1031 For example, the command sequence
1036 mg 0 0 \n[@maxcolor]
1037 Df -1
1042 sets all colors to blue.
1045 No position changing.
1047 This command is a
1048 .I @T_ROFF@
1049 extension.
1055 .D-command l "h v"
1056 Draw line from current position to offset
1057 .offset h v
1058 (integers in basic units\~\c
1059 .BR u );
1060 then set current position to the end of the drawn line.
1064 .D-multiarg p
1065 Draw a polygon line from current position to offset
1066 .indexed_offset h 1 v 1 ,
1067 from there to offset
1068 .indexed_offset h 2 v 2 ,
1069 etc., up to offset
1070 .indexed_offset h n v n ,
1071 and from there back to the starting position.
1073 .ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1074 For historical reasons, the position is changed by adding the sum of
1075 all arguments with odd index to the actual horizontal position and the
1076 even ones to the vertical position.
1078 Although this doesn't make sense it is kept for compatibility.
1081 .el \{\
1082 As the polygon is closed, the end of drawing is the starting point, so
1083 the position doesn't change.
1086 This command is a
1087 .I @T_ROFF@
1088 extension.
1092 .D-multiarg P
1093 The same macro as the corresponding
1094 .B Dp
1095 command with the same arguments, but draws a solid polygon in the
1096 current fill color rather than an outlined polygon.
1098 .ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1099 The position is changed in the same way as with
1100 .BR Dp .
1102 .el \
1103 No position changing.
1105 This command is a
1106 .I @T_ROFF@
1107 extension.
1111 .D-command t n
1112 Set the current line thickness to\~\c
1113 .I n
1114 (an integer in basic units\~\c
1115 .BR u )
1117 .IR n \|>\|0;
1119 .IR n \|=\|0
1120 select the smallest available line thickness; if
1121 .IR n \|<\|0
1122 set the line thickness proportional to the point size (this is the
1123 default before the first
1124 .B Dt
1125 command was specified).
1127 .ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1128 For historical reasons, the horizontal position is changed by adding
1129 the argument to the actual horizontal position, while the vertical
1130 position is not changed.
1132 Although this doesn't make sense it is kept for compatibility.
1135 .el \
1136 No position changing.
1138 This command is a
1139 .I @T_ROFF@
1140 extension.
1144 .SS "Device Control Commands"
1147 Each device control command starts with the letter
1148 .B x
1149 followed by a space character (optional or arbitrary space/\:tab in
1150 .IR @T_ROFF@ )
1151 and a subcommand letter or word; each argument (if any) must be
1152 preceded by a
1153 .I syntactical
1154 .IR space .
1157 .B x
1158 commands are terminated by a
1159 .IR "syntactical line break" ;
1160 no device control command can be followed by another command on the same
1161 line (except a comment).
1164 The subcommand is basically a single letter, but to increase
1165 readability, it can be written as a word, i.e., an arbitrary sequence
1166 of characters terminated by the next tab, space, or newline character.
1168 All characters of the subcommand word but the first are simply ignored.
1170 For example,
1171 .B @L_TROFF@
1172 outputs the initialization command
1173 .B x\ i
1175 .B x\ init
1176 and the resolution command
1177 .B x\ r
1179 .BR "x\ res" .
1181 But writings like
1182 .B x\ i_like_roff
1183 are accepted as well to mean the same commands.
1186 In the following, the syntax element
1187 .I \[la]line-break\[ra]
1188 means a
1189 .I syntactical line break
1190 as defined in section
1191 .BR Separation .
1194 .x-command F name
1195 .xsub Filename
1197 .I name
1198 as the intended name for the current file in error reports.
1200 This is useful for remembering the original file name when
1201 an internal piping mechanism is used.
1202 The input file is not changed by this command.
1204 This command is a
1205 .I @T_ROFF@
1206 extension.
1210 .x-command f "n\ s"
1211 .xsub font
1212 Mount font position\~\c
1213 .I n
1214 (a non-negative integer) with font named\~\c
1215 .I s
1216 (a text word),
1218 .BR @L_ROFF@_font (@MAN5EXT@).
1222 .x-command H n
1223 .xsub Height
1224 Set character height to\~\c
1225 .I n
1226 (a positive integer in scaled points\~\c
1227 .BR z ).
1229 .I Classical troff
1230 used the unit points (\c
1231 .BR p )
1232 instead; see section
1233 .BR COMPATIBILITY .
1237 .x-command i
1238 .xsub init
1239 Initialize device.
1241 This is the third command of the
1242 .IR prologue .
1246 .x-command p
1247 .xsub pause
1248 Parsed but ignored.
1250 The classical documentation reads
1251 .I pause device, can be
1252 .IR restarted .
1256 .x-command r "n\ h\ v"
1257 .xsub resolution
1258 Resolution is\~\c
1259 .IR n ,
1260 while
1261 .I h
1262 is the minimal horizontal motion, and
1263 .I v
1264 the minimal vertical motion possible with this device; all arguments
1265 are positive integers in basic units\~\c
1266 .B u
1267 per inch.
1269 This is the second command of the
1270 .IR prologue .
1274 .x-command S n
1275 .xsub Slant
1276 Set slant to\~\c
1277 .I n
1278 degrees (an integer in basic units\~\c
1279 .BR u ).
1283 .x-command s
1284 .xsub stop
1285 Terminates the processing of the current file; issued as the last
1286 command of any
1287 .I intermediate @L_TROFF@
1288 .IR output .
1292 .x-command t
1293 .xsub trailer
1294 Generate trailer information, if any.
1297 .BR @T_ROFF@ ,
1298 this is actually just ignored.
1302 .x-command T xxx
1303 .xsub Typesetter
1304 Set name of device to word
1305 .IR xxx ,
1306 a sequence of characters ended by the next whitespace character.
1308 The possible device names coincide with those from the @L_ROFF@
1309 .B \-T
1310 option.
1312 This is the first command of the
1313 .IR prologue .
1317 .x-command u n
1318 .xsub underline
1319 Configure underlining of spaces.
1322 .I n
1323 is\~1, start underlining of spaces;
1325 .I n
1326 is\~0, stop underlining of spaces.
1328 This is needed for the
1329 .B cu
1330 request in
1331 .B @L_NROFF@
1332 mode and is ignored otherwise.
1334 This command is a
1335 .I @T_ROFF@
1336 extension.
1340 .x-command X anything
1341 .xsub X-escape
1342 Send string
1343 .I anything
1344 uninterpreted to the device.
1346 If the line following this command starts with a
1347 .B +
1348 character this line is interpreted as a continuation line in the
1349 following sense.
1352 .B +
1353 is ignored, but a newline character is sent instead to the device, the
1354 rest of the line is sent uninterpreted.
1356 The same applies to all following lines until the first character of a
1357 line is not a
1358 .B +
1359 character.
1361 This command is generated by the escape sequence
1362 .BR \*[@backslash]X .
1364 The line-continuing feature is a
1365 .I @T_ROFF@
1366 extension.
1370 .SS "Obsolete Command"
1374 .I classical troff
1375 output, emitting a single glyph was mostly done by a very
1376 strange command that combined a horizontal move and the printing of a
1377 glyph.
1379 It didn't have a command code, but is represented by a 3-character
1380 argument consisting of exactly 2\~digits and a character.
1383 .I ddc
1384 Move right
1385 .I dd
1386 (exactly two decimal digits) basic units\~\c
1387 .BR u ,
1388 then print glyph with single-letter name\~\c
1389 .IR c .
1395 .IR @T_ROFF@ ,
1396 arbitrary
1397 .I syntactical space
1398 around and within this command is allowed to be added.
1400 Only when a preceding command on the same line ends with an argument
1401 of variable length a separating space is obligatory.
1404 .I classical
1405 .IR troff ,
1406 large clusters of these and other commands were used, mostly without
1407 spaces; this made such output almost unreadable.
1413 For modern high-resolution devices, this command does not make sense
1414 because the width of the glyphs can become much larger than two
1415 decimal digits.
1416 The commands
1417 .B t
1418 and\~\c
1419 .B u
1420 provide a better functionality.
1424 .SH "POSTPROCESSING"
1428 .I roff
1429 postprocessors are programs that have the task to translate the
1430 .I intermediate output
1431 into actions that are sent to a device.
1433 A device can be some piece of hardware such as a printer, or a software
1434 file format suitable for graphical or text processing.
1437 .I @T_ROFF@
1438 system provides powerful means that make the programming of such
1439 postprocessors an easy task.
1441 There is a library function that parses the
1442 .I intermediate output
1443 and sends the information obtained to the device via methods of a
1444 class with a common interface for each device.
1446 So a postprocessor must only redefine the methods of this class.
1448 For details, see the reference in section
1449 .BR FILES .
1453 .SH "EXAMPLES"
1456 This section presents the
1457 .I intermediate output
1458 generated from the same input for three different devices.
1460 The input is the sentence
1461 .I hell world
1462 fed into
1463 .B @L_ROFF@
1464 on the command line.
1467 .IP \[bu] 2m
1468 High-resolution device
1469 .I ps
1475 \fBshell>\fP echo "hell world" | @L_ROFF@ -Z -T ps
1481 .ft CB
1482 x T ps
1483 x res 72000 1 1
1484 x init
1486 x font 5 TR
1488 s10000
1489 V12000
1490 H72000
1491 thell
1492 wh2500
1494 H96620
1495 torld
1496 n12000 0
1497 x trailer
1498 V792000
1499 x stop
1500 .ft P
1506 This output can be fed into the postprocessor
1507 .BR @L_D_PS@ (@MAN1EXT@)
1508 to get its representation as a PostScript file.
1511 .IP \[bu] 2m
1512 Low-resolution device
1513 .I latin1
1518 This is similar to the high-resolution device except that the
1519 positioning is done at a minor scale.
1521 Some comments (lines starting with
1522 .IR # )
1523 were added for clarification; they were not generated by the
1524 formatter.
1529 \fBshell>\fP "hell world" | @L_ROFF@ -Z -T latin1
1535 .I "# prologue"
1536 .ft CB
1537 x T latin1
1538 x res 240 24 40
1539 x init
1540 .I "# begin a new page"
1541 .ft CB
1543 .I "# font setup"
1544 .ft CB
1545 x font 1 R
1548 .I "# initial positioning on the page"
1549 .ft CB
1552 .I "# write text `hell'"
1553 .ft CB
1554 thell
1555 .I "# inform about a space, and do it by a horizontal jump"
1556 .ft CB
1557 wh24
1558 .I "# write text `world'"
1559 .ft CB
1560 tworld
1561 .I "# announce line break, but do nothing because ..."
1562 .ft CB
1563 n40 0
1564 .I "# ... the end of the document has been reached"
1565 .ft CB
1566 x trailer
1567 V2640
1568 x stop
1569 .ft P
1575 This output can be fed into the postprocessor
1576 .BR @L_D_TTY@ (@MAN1EXT@)
1577 to get a formatted text document.
1582 Due to the obsolete jump-and-write command, the text clusters in the
1583 classical output are almost unreadable.
1587 .SH "COMPATIBILITY"
1591 .I intermediate output
1592 language of the
1593 .I classical troff
1594 was first documented in
1595 .IR [CSTR\~#97] .
1598 .I @T_ROFF@ intermediate output
1599 format is compatible with this specification except for the following
1600 features.
1603 .IP \[bu] 2m
1604 The classical quasi device independence is not yet implemented.
1607 .IP \[bu] 2m
1608 The old hardware was very different from what we use today.
1610 So the
1611 .I @T_ROFF@
1612 devices are also fundamentally different from the ones in
1613 .I classical
1614 .IR troff .
1616 For example, the classical PostScript device was called
1617 .I post
1618 and had a resolution of 720 units per inch,
1619 whereas
1620 .IR @T_ROFF@ 's
1621 .I ps
1622 device has a resolution of 72000 units per inch.
1624 Maybe, by implementing some rescaling mechanism similar to the
1625 classical quasi device independence, these could be integrated into
1626 modern
1627 .IR @T_ROFF@ .
1630 .IP \[bu] 2m
1631 The B-spline command
1632 .B D~
1633 is correctly handled by the
1634 .I intermediate output
1635 parser, but the drawing routines aren't implemented in some of the
1636 postprocessor programs.
1639 .IP \[bu] 2m
1640 The argument of the commands
1641 .B s
1643 .B x H
1644 has the implicit unit scaled point\~\c
1645 .B z
1647 .IR @T_ROFF@ ,
1648 while
1649 .I classical troff
1650 had point (\c
1651 .BR p ).
1653 This isn't an incompatibility, but a compatible extension, for both
1654 units coincide for all devices without a
1655 .I sizescale
1656 parameter, including all classical and the
1657 .I @T_ROFF@
1658 text devices.
1660 The few
1661 .I @T_ROFF@
1662 devices with a sizescale parameter either did not exist, had a
1663 different name, or seem to have had a different resolution.
1665 So conflicts with classical devices are very unlikely.
1668 .ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1669 .IP \[bu] 2m
1670 The position changing after the commands
1671 .BR Dp ,
1672 .BR DP ,
1674 .B Dt
1675 is illogical, but as old versions of GNU troff used this feature it is
1676 kept for compatibility reasons.
1677 .\}             \" @STUPID_DRAWING_POSITIONING
1678 .el \{\
1679 .IP \[bu] 2m
1680 Temporarily, there existed some confusion on the positioning after the
1681 .B D
1682 commands that are
1683 .I @T_ROFF@
1684 extensions.
1686 This has been clarified by establishing the classical rule for all
1687 @T_ROFF@ drawing commands:
1692 .ft I
1693 The position after a graphic object has been drawn is at its end;
1694 for circles and ellipses, the "end" is at the right side.
1700 From this, the positionings specified for the drawing commands above
1701 follow quite naturally.
1702 .\}             \" @STUPID_DRAWING_POSITIONING
1705 The differences between
1706 .I @T_ROFF@
1708 .I classical troff
1709 are documented in
1710 .BR @L_ROFF@_diff (@MAN7EXT@).
1714 .SH "FILES"
1718 .BI @FONTDIR@/dev name /DESC
1719 Device description file for device
1720 .IR name .
1723 .IB \[la]@T_ROFF@-source-dir\[ra] /src/libs/driver/input.cpp
1724 Defines the parser and postprocessor for the
1725 .I intermediate
1726 .IR output .
1728 It is located relative to the top directory of the
1729 .I @T_ROFF@
1730 source tree.
1732 This parser is the definitive specification of the
1733 .I @T_ROFF@ intermediate output
1734 format.
1738 .SH "SEE ALSO"
1741 A reference like
1742 .BR @L_ROFF@ (@MAN7EXT@)
1743 refers to a manual page; here
1744 .B @L_ROFF@
1745 in section\~\c
1746 .I @MAN7EXT@
1747 of the man-page documentation system.
1749 To read the example, look up section\~@MAN7EXT@ in your desktop help
1750 system or call from the shell prompt
1755 \fBshell>\fP man @MAN7EXT@ @L_ROFF@
1761 For more details, see
1762 .BR man (1).
1766 .BR @L_ROFF@ (@MAN1EXT@)
1767 option
1768 .B -Z
1769 and further readings.
1773 .BR @L_ROFF@ (@MAN7EXT@)
1774 for details of the language such as numerical units and escape sequences.
1778 .BR @L_ROFF@_font (@MAN5EXT@)
1779 for details on the device scaling parameters of the
1780 .B DESC
1781 file.
1785 .BR @L_TROFF@ (@MAN1EXT@)
1786 generates the device-independent intermediate output.
1790 .BR roff (@MAN7EXT@)
1791 for historical aspects and the general structure of roff systems.
1795 .BR @L_ROFF@_diff (@MAN7EXT@)
1796 The differences between the intermediate output in groff and classical
1797 troff.
1800 .BR \%@L_D_DVI@ (@MAN1EXT@),
1801 .BR \%@L_D_HTML@ (@MAN1EXT@),
1802 .BR \%@L_D_PS@ (@MAN1EXT@),
1803 .BR \%@L_D_TTY@ (@MAN1EXT@)
1806 the @T_ROFF@ postprocessor programs.
1812 .I classical troff output language
1813 is described in two AT&T Bell Labs CSTR documents available on-line at
1814 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr.html
1815 Bell Labs CSTR site
1816 .UE .
1820 .I [CSTR #97]
1821 .I A Typesetter-independent TROFF
1823 .I Brian Kernighan
1824 is the original and most comprehensive documentation on the output
1825 language; see
1826 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:97.ps.gz
1827 CSTR\~#97
1828 .UE .
1832 .I [CSTR\~#54]
1833 The 1992 revision of the
1834 .I Nroff/\:Troff User's Manual
1836 .I J.\& F.\& Ossanna
1838 .I Brian Kernighan
1839 isn't as comprehensive as
1840 .I [CSTR\~#97]
1841 regarding the output language; see
1842 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz
1843 CSTR\~#54
1844 .UE .
1848 .SH "AUTHORS"
1851 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
1853 Copyright (C) 1989, 2001 - 2008
1854 Free Software Foundation, Inc.
1857 This document is distributed under the terms of the FDL (GNU Free
1858 Documentation License) version 1.1 or later.
1860 You should have received a copy of the FDL with this package; it is also
1861 available on-line at the
1862 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
1863 GNU copyleft site
1864 .UE .
1868 This document was rewritten in 2002 by Bernd Warken.
1870 .\" s-ts-mode