groff: update vendor branch to v1.20.1
[dragonfly.git] / contrib / groff / man / groff_out.man
CommitLineData
92d0a6a6
JR
1'\" e
2.\" The above line should force the use of eqn as a preprocessor
3.ig
4groff_out.5
5
92d0a6a6
JR
6This file is part of groff, the GNU roff type-setting system.
7
4d3e9548
JL
8Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
9 2009
465b256c 10Free Software Foundation, Inc.
92d0a6a6
JR
11rewritten from scrach 2001 by Bernd Warken <bwarken@mayn.de>
12
13Permission is granted to copy, distribute and/or modify this document
4d3e9548 14under the terms of the GNU Free Documentation License, Version 1.3 or
92d0a6a6
JR
15any later version published by the Free Software Foundation; with the
16Invariant Sections being this .ig-section and AUTHORS, with no
17Front-Cover Texts, and with no Back-Cover Texts.
18
19A copy of the Free Documentation License is included as a file called
20FDL in the main directory of the groff source package.
21..
22.
23.\" --------------------------------------------------------------------
24.\" Setup
25.\" --------------------------------------------------------------------
26.
92d0a6a6
JR
27.\" ----------------- Document configuration
28.
29.\" Number register to decide whether the commands `{' and `}' are used
30.\" 0: disable (actual default); 1: enable
31.nr @USE_ENV_STACK 0
32.
33.ig
34Unfortunately, old versions of groff used an illogical position change
35after some D\~commands (Dp, DP, Dt). If the number register
36@STUPID_DRAWING_POSITIONING is 1 (actual default) then change position
37after these commands, otherwise the position is not changed.
38..
39.nr @STUPID_DRAWING_POSITIONING 1
40.
4d3e9548 41.\" ----------------- Semantical definitions
92d0a6a6
JR
42.
43.nr @maxcolor 65536
44.ds @backslash \[rs]\"
4d3e9548 45.ds @linebreak \fR\[la]line-break\[ra]\fP\"
92d0a6a6
JR
46.
47.\" Begin of macro definitions
92d0a6a6 48.
92d0a6a6 49.de offset
4d3e9548 50.RI ( \,\\$1\/ ,\ \,\\$2\/ )\\$3
92d0a6a6
JR
51..
52.de indexed_offset
4d3e9548 53.offset \fI\\$1\fP\d\s-3\\$2\s+3\u \fI\\$3\fP\d\s-3\\$4\s+3\u \\$5
92d0a6a6 54..
4d3e9548 55.\" format: .command <name> "<arguments>" <punctuation>
92d0a6a6 56.de command
4d3e9548 57\fB\\$1\fP\ \fI\,\\$2\/\fP\\$3
92d0a6a6 58..
4d3e9548 59.\" format: .D-command <subcommand> "<arguments>"
92d0a6a6 60.de D-command
4d3e9548 61\fBD\\$1\fP\ \fI\,\\$2\/\fP\|\*[@linebreak]
92d0a6a6 62..
4d3e9548
JL
63.
64.\" We set these as troff micromotions rather than eqn because \d and \u
65.\" can be lifted to XML subscript/superscript tags. Don't change
66.\" these to a parameterized string, man2html won't handle that.
67.ds hv1 \fIh\d\s-3\&1\s+3\u\~v\d\s-3\&1\s+3\u\fP
68.ds hv2 \fIh\d\s-3\&2\s+3\u\~v\d\s-3\&2\s+3\u\fP
69.ds hvn \fIh\d\s-3\&n\s+3\u\~v\d\s-3\&n\s+3\u\fP
70.
92d0a6a6 71.de Da-command
4d3e9548 72\fBDa\fP\ \*[hv1] \*[hv2]\|\*[@linebreak]
92d0a6a6 73..
4d3e9548
JL
74.\" graphics command .D with a variable number of arguments
75.\" format: .D-multiarg <subcommand>
92d0a6a6 76.de D-multiarg
4d3e9548 77\fBD\\$1\fP\ \*[hv1] \*[hv2] .\|.\|. \*[hvn]\|\*[@linebreak]
92d0a6a6 78..
4d3e9548 79.\" format: .x-command <subname> "<arguments>"
92d0a6a6 80.de x-command
4d3e9548 81\fBx\\$1\fP\ \fI\\$2\fP\|\*[@linebreak]
92d0a6a6
JR
82..
83.de xsub
4d3e9548
JL
84.RI "(" "\\$1" " control command)"
85.br
92d0a6a6 86..
92d0a6a6
JR
87.\" End of macro definitions
88.
89.
90.\" --------------------------------------------------------------------
91.\" Title
92.\" --------------------------------------------------------------------
93.
94.TH GROFF_OUT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
95.
96.SH NAME
97groff_out \- groff intermediate output format
98.
99.
100.\" --------------------------------------------------------------------
101.SH DESCRIPTION
102.\" --------------------------------------------------------------------
103.
465b256c
JR
104This manual page describes the
105.I intermediate output
106format of the GNU
92d0a6a6 107.BR roff (@MAN7EXT@)
465b256c
JR
108text processing system
109.BR groff (@MAN1EXT@).
92d0a6a6
JR
110.
111This output is produced by a run of the GNU
465b256c
JR
112.BR @g@troff (@MAN1EXT@)
113program.
114.
115It contains already all device-specific information, but it is not yet
116fed into a device postprocessor program.
117.
92d0a6a6
JR
118.
119.P
465b256c
JR
120As the GNU
121.I roff
122processor
92d0a6a6 123.BR groff (@MAN1EXT@)
465b256c
JR
124is a wrapper program around
125.B @g@troff
126that automatically calls a
92d0a6a6
JR
127postprocessor, this output does not show up normally.
128.
129This is why it is called
130.I intermediate
131within the
132.I groff
133.IR system .
134.
135The
136.B groff
137program provides the option
138.B -Z
465b256c
JR
139to inhibit postprocessing, such that the produced
140.I intermediate output
92d0a6a6 141is sent to standard output just like calling
465b256c 142.B @g@troff
92d0a6a6
JR
143manually.
144.
465b256c 145.
92d0a6a6
JR
146.P
147In this document, the term
465b256c
JR
148.I @g@troff output
149describes what is output by the GNU
150.B @g@troff
151program, while
92d0a6a6
JR
152.I intermediate output
153refers to the language that is accepted by the parser that prepares
154this output for the postprocessors.
155.
156This parser is smarter on whitespace and implements obsolete elements
157for compatibility, otherwise both formats are the same.
158.
465b256c
JR
159Both formats can be viewed directly with
160.BR \%gxditview (@MAN1EXT@).
161.
92d0a6a6
JR
162.
163.P
465b256c
JR
164The main purpose of the
165.I intermediate output
166concept is to facilitate the development of postprocessors by
167providing a common programming interface for all devices.
92d0a6a6
JR
168.
169It has a language of its own that is completely different from the
170.BR groff (@MAN7EXT@)
171language.
172.
173While the
174.I groff
175language is a high-level programming language for text processing, the
465b256c
JR
176.I intermediate output
177language is a kind of low-level assembler language by specifying all
178positions on the page for writing and drawing.
179.
92d0a6a6
JR
180.
181.P
465b256c
JR
182The
183.RI pre- groff
184.I roff
185versions are denoted as
186.I classical
187.IR troff .
188The
189.I intermediate output
190produced by
191.B groff
92d0a6a6
JR
192is fairly readable, while
193.I classical troff
194output was hard to understand because of strange habits that are
195still supported, but not used any longer by
196.I GNU
465b256c 197.IR @g@troff .
92d0a6a6
JR
198.
199.
200.\" --------------------------------------------------------------------
201.SH "LANGUAGE CONCEPTS"
202.\" --------------------------------------------------------------------
203.
204During the run of
465b256c
JR
205.BR @g@troff ,
206the
207.I roff
208input is cracked down to the information on what has to be printed at
209what position on the intended device.
92d0a6a6 210.
465b256c
JR
211So the language of the
212.I intermediate output
213format can be quite small.
92d0a6a6
JR
214.
215Its only elements are commands with or without arguments.
216.
4d3e9548 217In this document, the term \[lq]command\[rq] always refers to the
465b256c
JR
218.I intermediate output
219language, never to the
220.I roff
221language used for document formatting.
92d0a6a6
JR
222.
223There are commands for positioning and text writing, for drawing, and
224for device controlling.
225.
226.
227.\" --------------------------------------------------------------------
228.SS "Separation"
229.\" --------------------------------------------------------------------
230.
231.I Classical troff output
232had strange requirements on whitespace.
233.
234The
465b256c 235.B groff
92d0a6a6
JR
236output parser, however, is smart about whitespace by making it
237maximally optional.
238.
465b256c 239The whitespace characters, i.e., the
92d0a6a6
JR
240.IR tab ,
241.IR space ,
242and
243.I newline
244characters, always have a syntactical meaning.
245.
246They are never printable because spacing within the output is always
247done by positioning commands.
248.
465b256c 249.
92d0a6a6
JR
250.P
251Any sequence of
252.I space
253or
254.I tab
255characters is treated as a single
465b256c
JR
256.I syntactical
257.IR space .
92d0a6a6
JR
258.
259It separates commands and arguments, but is only required when there
260would occur a clashing between the command code and the arguments
261without the space.
262.
263Most often, this happens when variable length command names,
264arguments, argument lists, or command clusters meet.
265.
266Commands and arguments with a known, fixed length need not be
465b256c
JR
267separated by
268.I syntactical
269.IR space .
270.
92d0a6a6
JR
271.
272.P
273A line break is a syntactical element, too.
274.
275Every command argument can be followed by whitespace, a comment, or a
276newline character.
277.
278Thus a
465b256c
JR
279.I syntactical line break
280is defined to consist of optional
281.I syntactical space
282that is optionally followed by a comment, and a newline character.
283.
92d0a6a6
JR
284.
285.P
286The normal commands, those for positioning and text, consist of a
287single letter taking a fixed number of arguments.
288.
289For historical reasons, the parser allows to stack such commands on
465b256c
JR
290the same line, but fortunately, in
291.I groff intermediate
292.IR output ,
293every command with at least one argument is followed by a line break,
294thus providing excellent readability.
92d0a6a6
JR
295.
296.P
297The other commands \[em] those for drawing and device controlling \[em]
298have a more complicated structure; some recognize long command names,
299and some take a variable number of arguments.
300.
301So all
302.B D
303and
304.B x
305commands were designed to request a
306.I syntactical line break
307after their last argument.
308.
309Only one command,
310.RB ` x\ X '
311has an argument that can stretch over several lines, all other
312commands must have all of their arguments on the same line as the
4d3e9548 313command, i.e., the arguments may not be split by a line break.
92d0a6a6
JR
314.
315.P
465b256c 316Empty lines, i.e., lines containing only space and/or a comment, can
92d0a6a6
JR
317occur everywhere.
318.
319They are just ignored.
320.
321.
322.\" --------------------------------------------------------------------
323.SS "Argument Units"
324.\" --------------------------------------------------------------------
325.
326Some commands take integer arguments that are assumed to represent
327values in a measurement unit, but the letter for the corresponding
328.I scale indicator
329is not written with the output command arguments; see
330.BR groff (@MAN7EXT@)
465b256c
JR
331and the
332.I groff info file
333for more on this topic.
92d0a6a6
JR
334.
335Most commands assume the scale indicator\~\c
4d3e9548 336.BR u ,
92d0a6a6 337the basic unit of the device, some use\~\c
4d3e9548 338.BR z ,
92d0a6a6
JR
339the
340.I scaled point unit
341of the device, while others, such as the color commands expect plain
342integers.
343.
344Note that these scale indicators are relative to the chosen device.
345.
346They are defined by the parameters specified in the device's
347.I DESC
348file; see
349.BR groff_font (@MAN5EXT@).
350.
465b256c 351.
92d0a6a6
JR
352.P
353Note that single characters can have the eighth bit set, as can the
4d3e9548 354names of fonts and special characters (this is, glyphs).
92d0a6a6 355.
4d3e9548 356The names of glyphs and fonts can be of arbitrary length.
92d0a6a6 357.
4d3e9548 358A glyph that is to be printed will always be in the current font.
92d0a6a6 359.
465b256c 360.
92d0a6a6
JR
361.P
362A string argument is always terminated by the next whitespace
363character (space, tab, or newline); an embedded
364.B #
365character is regarded as part of the argument, not as the beginning of
366a comment command.
367.
368An integer argument is already terminated by the next non-digit
369character, which then is regarded as the first character of the next
370argument or command.
371.
372.
373.\" --------------------------------------------------------------------
374.SS "Document Parts"
375.\" --------------------------------------------------------------------
465b256c
JR
376A correct
377.I intermediate output
378document consists of two parts, the
379.I prologue
380and the
381.IR body .
92d0a6a6
JR
382.
383.P
384The task of the
385.I prologue
386is to set the general device parameters using three exactly specified
387commands.
388.
389The
390.I groff prologue
391is guaranteed to consist of the following three lines (in that order):
392.RS
393.P
394.B x\ T
395.I device
396.br
397.B x\ res
398.I n\ h\ v
399.br
400.B x init
401.RE
402.P
403with the arguments set as outlined in the section
404.BR "Device Control Commands" .
405.
4d3e9548 406However, the parser for the
465b256c
JR
407.I intermediate output
408format is able to swallow additional whitespace and comments as well.
409.
92d0a6a6
JR
410.
411.P
412The
413.I body
414is the main section for processing the document data.
415.
416Syntactically, it is a sequence of any commands different from the
465b256c
JR
417ones used in the
418.IR prologue .
92d0a6a6
JR
419.
420Processing is terminated as soon as the first
421.B x\ stop
465b256c
JR
422command is encountered; the last line of any
423.I groff intermediate output
92d0a6a6
JR
424always contains such a command.
425.
465b256c 426.
92d0a6a6 427.P
465b256c
JR
428Semantically, the
429.I body
430is page oriented.
92d0a6a6
JR
431.
432A new page is started by a
433.BR p \~command.
434.
435Positioning, writing, and drawing commands are always done within the
436current page, so they cannot occur before the first
437.BR p \~command.
438.
439Absolute positioning (by the
440.B H
441and
442.BR V \~commands)
443is done relative to the current page, all other positioning
444is done relative to the current location within this page.
445.
446.
447.\" --------------------------------------------------------------------
448.SH "COMMAND REFERENCE"
449.\" --------------------------------------------------------------------
450.
465b256c
JR
451This section describes all
452.I intermediate output
453commands, the classical commands as well as the
92d0a6a6
JR
454.I groff
455extensions.
456.
457.
458.\" --------------------------------------------------------------------
459.SS "Comment Command"
460.\" --------------------------------------------------------------------
461.
462.TP
4d3e9548 463.BI # anything \[la]end-of-line\[ra]
92d0a6a6
JR
464A comment.
465.
466Ignore any characters from the
467.BR # \~\c
468character up to the next newline character.
469.
470.P
465b256c
JR
471This command is the only possibility for commenting in the
472.I intermediate
473.IR output .
92d0a6a6
JR
474.
475Each comment can be preceded by arbitrary
476.I syntactical
477.IR space ;
478every command can be terminated by a comment.
479.
480.
481.\" --------------------------------------------------------------------
482.SS "Simple Commands"
483.\" --------------------------------------------------------------------
484.
485The commands in this subsection have a command code consisting of a
486single character, taking a fixed number of arguments.
487.
488Most of them are commands for positioning and text writing.
489.
490These commands are smart about whitespace.
491.
492Optionally,
493.I syntactical space
494can be inserted before, after, and between the command letter and its
495arguments.
496.
497All of these commands are stackable, i.e., they can be preceded by
498other simple commands or followed by arbitrary other commands on the
499same line.
500.
465b256c
JR
501A separating
502.I syntactical space
503is only necessary when two integer arguments would clash or if the
504preceding argument ends with a string argument.
92d0a6a6
JR
505.
506.
4d3e9548
JL
507.if \n[@USE_ENV_STACK]=1 \{\
508.TP
92d0a6a6
JR
509.command {
510Open a new environment by copying the actual device configuration data
511to the environment stack.
512.
513The current environment is setup by the device specification and
514manipulated by the setting commands.
515.
516.
4d3e9548 517.TP
92d0a6a6
JR
518.command }
519Close the actual environment (opened by a preceding
520.BR { \~command)
521and restore the previous environment from the environment
522stack as the actual device configuration data.
523.
4d3e9548 524.\} \" endif @USE_ENV_STACK
92d0a6a6
JR
525.
526.
4d3e9548
JL
527.TP
528.command C xxx \[la]white-space\[ra]
529Print a glyph (special character) named
530.IR xxx .
92d0a6a6 531.
465b256c
JR
532The trailing
533.I syntactical space
534or
535.I line break
4d3e9548 536is necessary to allow glyph names of arbitrary length.
92d0a6a6 537.
4d3e9548
JL
538The glyph is printed at the current print position; the
539glyph's size is read from the font file.
92d0a6a6
JR
540.
541The print position is not changed.
542.
543.
4d3e9548 544.TP
92d0a6a6 545.command c c
4d3e9548
JL
546Print glyph with single-letter name\~\c
547.I c
92d0a6a6 548at the current print position;
4d3e9548 549the glyph's size is read from the font file.
92d0a6a6
JR
550.
551The print position is not changed.
552.
553.
4d3e9548 554.TP
92d0a6a6
JR
555.command f n
556Set font to font number\~\c
4d3e9548 557.I n
92d0a6a6
JR
558(a non-negative integer).
559.
560.
4d3e9548 561.TP
92d0a6a6
JR
562.command H n
563Move right to the absolute vertical position\~\c
4d3e9548 564.I n
92d0a6a6 565(a non-negative integer in basic units\~\c
4d3e9548 566.BR u )
92d0a6a6
JR
567relative to left edge of current page.
568.
569.
4d3e9548 570.TP
92d0a6a6
JR
571.command h n
572Move
4d3e9548 573.I n
92d0a6a6 574(a non-negative integer) basic units\~\c
4d3e9548 575.B u
92d0a6a6
JR
576horizontally to the right.
577.
465b256c 578.I [CSTR\~#54]
92d0a6a6
JR
579allows negative values for
580.I n
581also, but
582.I groff
583doesn't use this.
584.
585.
4d3e9548
JL
586.TP
587.command m "color-scheme \fR[\fPcomponent .\|.\|.\fR]\fP"
92d0a6a6
JR
588Set the color for text (glyphs), line drawing, and the outline of
589graphic objects using different color schemes; the analoguous command
590for the filling color of graphic objects is
591.BR DF .
592.
593The color components are specified as integer arguments between 0 and
594\n[@maxcolor].
595.
596The number of color components and their meaning vary for the
597different color schemes.
598.
465b256c
JR
599These commands are generated by the
600.I groff
601escape sequence
92d0a6a6
JR
602.BR \*[@backslash]m .
603.
604No position changing.
605.
465b256c
JR
606These commands are a
607.I groff
608extension.
92d0a6a6
JR
609.
610.
611.RS
612.
4d3e9548 613.TP
92d0a6a6
JR
614.command mc "cyan magenta yellow"
615Set color using the CMY color scheme, having the 3\~color components
616cyan, magenta, and yellow.
617.
618.
4d3e9548 619.TP
92d0a6a6
JR
620.command md
621Set color to the default color value
622(black in most cases).
623.
624No component arguments.
625.
626.
4d3e9548 627.TP
92d0a6a6
JR
628.command mg "gray"
629Set color to the shade of gray given by the argument, an integer
630between 0 (black) and \n[@maxcolor] (white).
631.
632.
4d3e9548 633.TP
92d0a6a6
JR
634.command mk "cyan magenta yellow black"
635Set color using the CMYK color scheme, having the 4\~color components
636cyan, magenta, yellow, and black.
637.
4d3e9548 638.TP
92d0a6a6
JR
639.command mr "red green blue"
640Set color using the RGB color scheme, having the 3\~color components
641red, green, and blue.
642.
643.RE
644.
645.
4d3e9548 646.TP
92d0a6a6 647.command N n
4d3e9548
JL
648Print glyph with index\~\c
649.I n
92d0a6a6
JR
650(an integer, normally non-negative) of the current font.
651.
652The print position is not changed.
653.
654If
655.B \-T\~html
4d3e9548
JL
656or
657.B \-T\~xhtml
92d0a6a6
JR
658is used, negative values are emitted also to indicate an unbreakable space
659with given width.
660.
661For example,
4d3e9548
JL
662.B N\~\-193
663represents an unbreakable space which has a width of 193\|u.
92d0a6a6 664.
465b256c
JR
665This command is a
666.I groff
667extension.
92d0a6a6
JR
668.
669.
4d3e9548 670.TP
92d0a6a6
JR
671.command n b\ a
672Inform the device about a line break, but no positioning is done by
673this command.
674.
465b256c
JR
675In
676.I classical
677.IR troff ,
678the integer arguments
4d3e9548 679.I b
92d0a6a6 680and\~\c
4d3e9548 681.I a
92d0a6a6 682informed about the space before and after the current line to
465b256c
JR
683make the
684.I intermediate output
685more human readable without performing any action.
92d0a6a6 686.
465b256c
JR
687In
688.IR groff ,
689they are just ignored, but they must be provided for compatibility
690reasons.
92d0a6a6
JR
691.
692.
4d3e9548 693.TP
92d0a6a6
JR
694.command p n
695Begin a new page in the outprint.
696.
697The page number is set to\~\c
4d3e9548 698.IR n .
92d0a6a6
JR
699.
700This page is completely independent of pages formerly processed even
701if those have the same page number.
702.
703The vertical position on the outprint is automatically set to\~0.
704.
705All positioning, writing, and drawing is always done relative to a
706page, so a
707.BR p \~command
708must be issued before any of these commands.
709.
710.
4d3e9548 711.TP
92d0a6a6
JR
712.command s n
713Set point size to
4d3e9548 714.I n
92d0a6a6
JR
715scaled points
716(this is unit\~\c
4d3e9548 717.B z
92d0a6a6 718in GNU
465b256c 719.BR @g@troff ).
92d0a6a6 720.
465b256c
JR
721.I Classical troff
722used the unit
92d0a6a6
JR
723.I points
724(\c
4d3e9548 725.BR p )
92d0a6a6
JR
726instead; see section
727.BR COMPATIBILITY .
728.
729.
4d3e9548
JL
730.TP
731.command t xyz\|.\|.\|. \[la]white-space\[ra]
732.TQ
733.command t "xyz\|.\|.\|.\& dummy-arg" \[la]white-space\[ra]
734Print a word, i.e., a sequence of glyphs with single-letter names
735.IR x ,
736.IR y ,
737.IR z ,
738etc., terminated by a space character or a line break; an optional
739second integer argument is ignored (this allows the formatter to
740generate an even number of arguments).
741.
742The first glyph should be printed at the current position, the
92d0a6a6 743current horizontal position should then be increased by the width of
4d3e9548 744the first glyph, and so on for each glyph.
92d0a6a6 745.
4d3e9548 746The widths of the glyph are read from the font file, scaled for the
92d0a6a6
JR
747current point size, and rounded to a multiple of the horizontal
748resolution.
749.
4d3e9548
JL
750Special characters (glyphs with names longer than a single letter)
751cannot be printed using this command; use the
92d0a6a6 752.B C
4d3e9548 753command for those glyphs.
92d0a6a6 754.
465b256c
JR
755This command is a
756.I groff
757extension; it is only used for devices whose
92d0a6a6
JR
758.I DESC
759file contains the
760.B tcommand
761keyword; see
762.BR groff_font (@MAN5EXT@).
763.
764.
4d3e9548
JL
765.TP
766.command u "n xyz\|.\|.\|." \[la]white-space\[ra]
92d0a6a6
JR
767Print word with track kerning.
768.
769This is the same as the
770.B t
4d3e9548 771command except that after printing each glyph, the current
92d0a6a6 772horizontal position is increased by the sum of the width of that
4d3e9548
JL
773glyph and\~\c
774.I n
92d0a6a6
JR
775(an integer in
776basic units\~\c
4d3e9548 777.BR u ).
465b256c
JR
778This command is a
779.I groff
780extension; it is only used for devices whose
92d0a6a6
JR
781.I DESC
782file contains the
783.B tcommand
784keyword; see
785.BR groff_font (@MAN5EXT@).
786.
787.
4d3e9548 788.TP
92d0a6a6
JR
789.command V n
790Move down to the absolute vertical position\~\c
4d3e9548 791.I n
92d0a6a6 792(a non-negative integer in basic units\~\c
4d3e9548 793.BR u )
92d0a6a6
JR
794relative to upper edge of current page.
795.
796.
4d3e9548 797.TP
92d0a6a6
JR
798.command v n
799Move
4d3e9548 800.I n
92d0a6a6 801basic units\~\c
4d3e9548 802.B u
92d0a6a6
JR
803down
804.RI ( n
805is a non-negative integer).
806.
465b256c 807.I [CSTR\~#54]
92d0a6a6
JR
808allows negative values for
809.I n
810also, but
811.I groff
812doesn't use this.
813.
814.
4d3e9548 815.TP
92d0a6a6
JR
816.command w
817Informs about a paddable whitespace to increase readability.
818.
819The spacing itself must be performed explicitly by a move command.
820.
821.
822.\" --------------------------------------------------------------------
823.SS "Graphics Commands"
824.\" --------------------------------------------------------------------
825.
465b256c
JR
826Each graphics or drawing command in the
827.I intermediate output
828starts with the letter\~\c
92d0a6a6
JR
829.B D
830followed by one or two characters that specify a subcommand; this
831is followed by a fixed or variable number of integer arguments that
832are separated by a single space character.
833.
834A
465b256c
JR
835.B D\c
836\~command
837may not be followed by another command on the same line (apart from a
838comment), so each
839.B D\c
840\~command
841is terminated by a
842.I syntactical line
843.IR break .
844.
92d0a6a6
JR
845.
846.P
465b256c 847.B @g@troff
92d0a6a6
JR
848output follows the classical spacing rules (no space between command
849and subcommand, all arguments are preceded by a single space
850character), but the parser allows optional space between the command
851letters and makes the space before the first argument optional.
852.
853As usual, each space can be any sequence of tab and space characters.
854.
465b256c 855.
92d0a6a6
JR
856.P
857Some graphics commands can take a variable number of arguments.
858.
859In this case, they are integers representing a size measured in basic
860units\~\c
4d3e9548 861.BR u .
92d0a6a6 862.
4d3e9548
JL
863The
864.I h
865arguments
92d0a6a6
JR
866stand for horizontal distances where positive means right, negative
867left.
868.
4d3e9548
JL
869The
870.I v
871arguments
92d0a6a6
JR
872stand for vertical distances where positive means down, negative up.
873.
874All these distances are offsets relative to the current location.
875.
465b256c 876.
92d0a6a6
JR
877.P
878Unless indicated otherwise, each graphics command directly corresponds
879to a similar
880.I groff
881.B \*[@backslash]D
882escape sequence; see
883.BR groff (@MAN7EXT@).
884.
465b256c 885.
92d0a6a6 886.P
465b256c
JR
887Unknown
888.B D\c
889\~commands are assumed to be device-specific.
92d0a6a6
JR
890.
891Its arguments are parsed as strings; the whole information is then
892sent to the postprocessor.
893.
465b256c 894.
92d0a6a6
JR
895.P
896In the following command reference, the syntax element
4d3e9548 897.I \[la]line-break\[ra]
92d0a6a6
JR
898means a
899.I syntactical line break
900as defined in section
901.BR Separation .
902.
903.
4d3e9548 904.TP
92d0a6a6
JR
905.D-multiarg ~
906Draw B-spline from current position to offset
907.indexed_offset h 1 v 1 ,
908then to offset
909.indexed_offset h 2 v 2
4d3e9548 910if given, etc., up to
92d0a6a6 911.indexed_offset h n v n .
465b256c
JR
912This command takes a variable number of argument pairs; the current
913position is moved to the terminal point of the drawn curve.
92d0a6a6
JR
914.
915.
4d3e9548 916.TP
92d0a6a6
JR
917.Da-command
918Draw arc from current position to
919.indexed_offset h 1 v 1 \|+\|\c
920.indexed_offset h 2 v 2
921with center at
922.indexed_offset h 1 v 1 ;
923then move the current position to the final point of the arc.
924.
925.
4d3e9548 926.TP
92d0a6a6 927.D-command C d
4d3e9548
JL
928.TQ
929.D-command C "d dummy-arg"
92d0a6a6 930Draw a solid circle using the current fill color with diameter\~\c
4d3e9548 931.I d
92d0a6a6 932(integer in basic units\~\c
4d3e9548 933.BR u )
92d0a6a6
JR
934with leftmost point at the current position; then move the current
935position to the rightmost point of the circle.
936.
937An optional second integer argument is ignored (this allows to the
938formatter to generate an even number of arguments).
939.
465b256c
JR
940This command is a
941.I groff
942extension.
92d0a6a6
JR
943.
944.
4d3e9548 945.TP
92d0a6a6
JR
946.D-command c d
947Draw circle line with diameter\~\c
4d3e9548 948.I d
92d0a6a6 949(integer in basic units\~\c
4d3e9548 950.BR u )
92d0a6a6
JR
951with leftmost point at the current position; then move the current
952position to the rightmost point of the circle.
953.
954.
4d3e9548 955.TP
92d0a6a6
JR
956.D-command E "h v"
957Draw a solid ellipse in the current fill color with a horizontal
958diameter of\~\c
4d3e9548 959.I h
92d0a6a6 960and a vertical diameter of\~\c
4d3e9548 961.I v
92d0a6a6 962(both integers in basic units\~\c
4d3e9548 963.BR u )
92d0a6a6
JR
964with the leftmost point at the current position; then move to the
965rightmost point of the ellipse.
966.
465b256c
JR
967This command is a
968.I groff
969extension.
92d0a6a6
JR
970.
971.
4d3e9548 972.TP
92d0a6a6
JR
973.D-command e "h v"
974Draw an outlined ellipse with a horizontal diameter of\~\c
4d3e9548 975.I h
92d0a6a6 976and a vertical diameter of\~\c
4d3e9548 977.I v
92d0a6a6 978(both integers in basic units\~\c
4d3e9548 979.BR u )
92d0a6a6
JR
980with the leftmost point at current position; then move to the
981rightmost point of the ellipse.
982.
983.
4d3e9548
JL
984.TP
985.D-command F "color-scheme \fR[\fPcomponent .\|.\|.\fR]\fP"
92d0a6a6
JR
986Set fill color for solid drawing objects using different color
987schemes; the analoguous command for setting the color of text, line
988graphics, and the outline of graphic objects is
989.BR m .
990.
991The color components are specified as integer arguments between 0 and
992\n[@maxcolor].
993.
994The number of color components and their meaning vary for the
995different color schemes.
996.
465b256c
JR
997These commands are generated by the
998.I groff
999escape sequences
4d3e9548 1000.BR \*[@backslash]D'F\ .\|.\|. '
92d0a6a6
JR
1001and
1002.B \*[@backslash]M
1003(with no other corresponding graphics commands).
1004.
1005No position changing.
1006.
465b256c
JR
1007This command is a
1008.I groff
1009extension.
92d0a6a6
JR
1010.
1011.
1012.RS
1013.
4d3e9548 1014.TP
92d0a6a6
JR
1015.D-command Fc "cyan magenta yellow"
1016Set fill color for solid drawing objects using the CMY color scheme,
1017having the 3\~color components cyan, magenta, and yellow.
1018.
1019.
4d3e9548 1020.TP
92d0a6a6
JR
1021.D-command Fd
1022Set fill color for solid drawing objects to the default fill color value
1023(black in most cases).
1024.
1025No component arguments.
1026.
1027.
4d3e9548 1028.TP
92d0a6a6
JR
1029.D-command Fg "gray"
1030Set fill color for solid drawing objects to the shade of gray given by
1031the argument, an integer between 0 (black) and \n[@maxcolor] (white).
1032.
1033.
4d3e9548 1034.TP
92d0a6a6
JR
1035.D-command Fk "cyan magenta yellow black"
1036Set fill color for solid drawing objects using the CMYK color scheme,
1037having the 4\~color components cyan, magenta, yellow, and black.
1038.
4d3e9548 1039.TP
92d0a6a6
JR
1040.D-command Fr "red green blue"
1041Set fill color for solid drawing objects using the RGB color scheme,
1042having the 3\~color components red, green, and blue.
1043.
1044.RE
1045.
1046.
4d3e9548 1047.TP
92d0a6a6
JR
1048.D-command f n
1049The argument
4d3e9548 1050.I n
92d0a6a6
JR
1051must be an integer in the range -32767 to 32767.
1052.
1053.RS
1054.TP
4d3e9548 1055.RI 0\|\[<=]\| n \|\[<=]\|1000
92d0a6a6
JR
1056Set the color for filling solid drawing objects to a shade of gray,
1057where 0 corresponds to solid white, 1000 (the default) to solid black,
4d3e9548 1058and values inbetween to intermediate shades of gray; this is
92d0a6a6
JR
1059obsoleted by command
1060.BR DFg .
1061.
1062.TP
4d3e9548 1063.IR n "\|<\|0 or " n \|>\|1000
92d0a6a6
JR
1064Set the filling color to the color that is currently being used for
1065the text and the outline, see command
1066.BR m .
1067For example, the command sequence
1068.
92d0a6a6 1069.RS
4d3e9548
JL
1070.IP
1071.EX
92d0a6a6
JR
1072mg 0 0 \n[@maxcolor]
1073Df -1
4d3e9548 1074.EE
92d0a6a6 1075.RE
92d0a6a6 1076.
4d3e9548 1077.IP
92d0a6a6 1078sets all colors to blue.
465b256c 1079.
92d0a6a6
JR
1080.P
1081No position changing.
1082.
465b256c
JR
1083This command is a
1084.I groff
1085extension.
92d0a6a6
JR
1086.
1087.RE
1088.
1089.
4d3e9548 1090.TP
92d0a6a6
JR
1091.D-command l "h v"
1092Draw line from current position to offset
1093.offset h v
1094(integers in basic units\~\c
4d3e9548 1095.BR u );
92d0a6a6
JR
1096then set current position to the end of the drawn line.
1097.
1098.
4d3e9548 1099.TP
92d0a6a6
JR
1100.D-multiarg p
1101Draw a polygon line from current position to offset
4d3e9548 1102.indexed_offset h 1 v 1 ,
92d0a6a6 1103from there to offset
4d3e9548
JL
1104.indexed_offset h 2 v 2 ,
1105etc., up to offset
1106.indexed_offset h n v n ,
92d0a6a6
JR
1107and from there back to the starting position.
1108.
4d3e9548 1109.ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
92d0a6a6
JR
1110For historical reasons, the position is changed by adding the sum of
1111all arguments with odd index to the actual horizontal position and the
1112even ones to the vertical position.
1113.
1114Although this doesn't make sense it is kept for compatibility.
1115.
4d3e9548 1116.\}
92d0a6a6
JR
1117.el \{\
1118As the polygon is closed, the end of drawing is the starting point, so
1119the position doesn't change.
4d3e9548 1120.\}
92d0a6a6 1121.
465b256c
JR
1122This command is a
1123.I groff
1124extension.
92d0a6a6
JR
1125.
1126.
4d3e9548 1127.TP
92d0a6a6
JR
1128.D-multiarg P
1129The same macro as the corresponding
1130.B Dp
1131command with the same arguments, but draws a solid polygon in the
1132current fill color rather than an outlined polygon.
1133.
4d3e9548 1134.ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
92d0a6a6
JR
1135The position is changed in the same way as with
1136.BR Dp .
4d3e9548 1137.\}
92d0a6a6
JR
1138.el \
1139No position changing.
1140.
465b256c
JR
1141This command is a
1142.I groff
1143extension.
92d0a6a6
JR
1144.
1145.
4d3e9548 1146.TP
92d0a6a6
JR
1147.D-command t n
1148Set the current line thickness to\~\c
4d3e9548 1149.I n
92d0a6a6 1150(an integer in basic units\~\c
4d3e9548 1151.BR u )
92d0a6a6 1152if
4d3e9548 1153.IR n \|>\|0;
92d0a6a6 1154if
4d3e9548 1155.IR n \|=\|0
92d0a6a6 1156select the smallest available line thickness; if
4d3e9548 1157.IR n \|<\|0
92d0a6a6
JR
1158set the line thickness proportional to the point size (this is the
1159default before the first
1160.B Dt
1161command was specified).
1162.
4d3e9548 1163.ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
92d0a6a6
JR
1164For historical reasons, the horizontal position is changed by adding
1165the argument to the actual horizontal position, while the vertical
1166position is not changed.
1167.
1168Although this doesn't make sense it is kept for compatibility.
1169.
4d3e9548 1170.\}
92d0a6a6
JR
1171.el \
1172No position changing.
1173.
465b256c
JR
1174This command is a
1175.I groff
1176extension.
92d0a6a6
JR
1177.
1178.
1179.\" --------------------------------------------------------------------
1180.SS "Device Control Commands"
1181.\" --------------------------------------------------------------------
1182.
1183Each device control command starts with the letter
1184.B x
1185followed by a space character (optional or arbitrary space/\:tab in
465b256c
JR
1186.IR groff )
1187and a subcommand letter or word; each argument (if any) must be
1188preceded by a
1189.I syntactical
1190.IR space .
92d0a6a6
JR
1191.
1192All
1193.B x
1194commands are terminated by a
1195.IR "syntactical line break" ;
1196no device control command can be followed by another command on the same
1197line (except a comment).
1198.
1199.P
1200The subcommand is basically a single letter, but to increase
465b256c 1201readability, it can be written as a word, i.e., an arbitrary sequence
92d0a6a6
JR
1202of characters terminated by the next tab, space, or newline character.
1203.
1204All characters of the subcommand word but the first are simply ignored.
1205.
1206For example,
465b256c 1207.B @g@troff
92d0a6a6
JR
1208outputs the initialization command
1209.B x\ i
1210as
1211.B x\ init
1212and the resolution command
1213.B x\ r
1214as
1215.BR "x\ res" .
1216.
1217But writings like
1218.B x\ i_like_groff
1219and
1220.B x\ roff_is_groff
4d3e9548 1221are accepted as well to mean the same commands.
92d0a6a6
JR
1222.
1223.P
1224In the following, the syntax element
4d3e9548 1225.I \[la]line-break\[ra]
92d0a6a6
JR
1226means a
1227.I syntactical line break
1228as defined in section
1229.BR Separation .
1230.
4d3e9548 1231.TP
92d0a6a6
JR
1232.x-command F name
1233.xsub Filename
1234Use
4d3e9548 1235.I name
92d0a6a6
JR
1236as the intended name for the current file in error reports.
1237.
465b256c
JR
1238This is useful for remembering the original file name when
1239.B groff
1240uses an internal piping mechanism.
92d0a6a6
JR
1241.
1242The input file is not changed by this command.
1243.
465b256c
JR
1244This command is a
1245.I groff
1246extension.
92d0a6a6
JR
1247.
1248.
4d3e9548 1249.TP
92d0a6a6
JR
1250.x-command f "n\ s"
1251.xsub font
1252Mount font position\~\c
4d3e9548 1253.I n
92d0a6a6 1254(a non-negative integer) with font named\~\c
4d3e9548 1255.I s
92d0a6a6
JR
1256(a text word),
1257cf.
1258.BR groff_font (@MAN5EXT@).
1259.
1260.
4d3e9548 1261.TP
92d0a6a6
JR
1262.x-command H n
1263.xsub Height
1264Set character height to\~\c
4d3e9548 1265.I n
92d0a6a6 1266(a positive integer in scaled points\~\c
4d3e9548 1267.BR z ).
92d0a6a6 1268.
465b256c
JR
1269.I Classical troff
1270used the unit points (\c
4d3e9548 1271.BR p )
92d0a6a6
JR
1272instead; see section
1273.BR COMPATIBILITY .
1274.
1275.
4d3e9548 1276.TP
92d0a6a6
JR
1277.x-command i
1278.xsub init
1279Initialize device.
1280.
465b256c
JR
1281This is the third command of the
1282.IR prologue .
92d0a6a6
JR
1283.
1284.
4d3e9548 1285.TP
92d0a6a6
JR
1286.x-command p
1287.xsub pause
1288Parsed but ignored.
1289.
1290The classical documentation reads
1291.I pause device, can be
1292.IR restarted .
1293.
1294.
4d3e9548 1295.TP
92d0a6a6
JR
1296.x-command r "n\ h\ v"
1297.xsub resolution
1298Resolution is\~\c
4d3e9548 1299.IR n ,
92d0a6a6 1300while
4d3e9548 1301.I h
92d0a6a6 1302is the minimal horizontal motion, and
4d3e9548 1303.I v
92d0a6a6
JR
1304the minimal vertical motion possible with this device; all arguments
1305are positive integers in basic units\~\c
4d3e9548 1306.B u
92d0a6a6
JR
1307per inch.
1308.
465b256c
JR
1309This is the second command of the
1310.IR prologue .
92d0a6a6
JR
1311.
1312.
4d3e9548 1313.TP
92d0a6a6
JR
1314.x-command S n
1315.xsub Slant
1316Set slant to\~\c
4d3e9548 1317.I n
92d0a6a6 1318degrees (an integer in basic units\~\c
4d3e9548 1319.BR u ).
92d0a6a6
JR
1320.
1321.
4d3e9548 1322.TP
92d0a6a6
JR
1323.x-command s
1324.xsub stop
1325Terminates the processing of the current file; issued as the last
465b256c
JR
1326command of any
1327.I intermediate @g@troff
1328.IR output .
92d0a6a6
JR
1329.
1330.
4d3e9548 1331.TP
92d0a6a6
JR
1332.x-command t
1333.xsub trailer
1334Generate trailer information, if any.
1335.
1336In
465b256c 1337.BR groff ,
92d0a6a6
JR
1338this is actually just ignored.
1339.
1340.
4d3e9548 1341.TP
92d0a6a6
JR
1342.x-command T xxx
1343.xsub Typesetter
1344Set name of device to word
4d3e9548 1345.IR xxx ,
92d0a6a6
JR
1346a sequence of characters ended by the next whitespace character.
1347.
1348The possible device names coincide with those from the groff
4d3e9548 1349.B \-T
92d0a6a6
JR
1350option.
1351.
465b256c
JR
1352This is the first command of the
1353.IR prologue .
92d0a6a6
JR
1354.
1355.
4d3e9548 1356.TP
92d0a6a6
JR
1357.x-command u n
1358.xsub underline
1359Configure underlining of spaces.
1360.
1361If
4d3e9548 1362.I n
92d0a6a6
JR
1363is\~1, start underlining of spaces;
1364if
4d3e9548 1365.I n
92d0a6a6
JR
1366is\~0, stop underlining of spaces.
1367.
1368This is needed for the
1369.B cu
1370request in
465b256c 1371.B @g@nroff
92d0a6a6
JR
1372mode and is ignored otherwise.
1373.
465b256c
JR
1374This command is a
1375.I groff
1376extension.
92d0a6a6
JR
1377.
1378.
4d3e9548 1379.TP
92d0a6a6
JR
1380.x-command X anything
1381.xsub X-escape
1382Send string
4d3e9548 1383.I anything
92d0a6a6
JR
1384uninterpreted to the device.
1385.
1386If the line following this command starts with a
1387.B +
1388character this line is interpreted as a continuation line in the
1389following sense.
1390.
1391The
1392.B +
1393is ignored, but a newline character is sent instead to the device, the
1394rest of the line is sent uninterpreted.
1395.
1396The same applies to all following lines until the first character of a
1397line is not a
1398.B +
1399character.
1400.
1401This command is generated by the
1402.I groff
1403escape sequence
1404.BR \*[@backslash]X .
1405.
465b256c
JR
1406The line-continuing feature is a
1407.I groff
1408extension.
92d0a6a6
JR
1409.
1410.
1411.\" --------------------------------------------------------------------
1412.SS "Obsolete Command"
1413.\" --------------------------------------------------------------------
1414.
1415In
1416.I classical troff
4d3e9548 1417output, emitting a single glyph was mostly done by a very
92d0a6a6 1418strange command that combined a horizontal move and the printing of a
4d3e9548 1419glyph.
92d0a6a6
JR
1420.
1421It didn't have a command code, but is represented by a 3-character
1422argument consisting of exactly 2\~digits and a character.
1423.
1424.TP
4d3e9548 1425.I ddc
92d0a6a6 1426Move right
4d3e9548 1427.I dd
92d0a6a6 1428(exactly two decimal digits) basic units\~\c
4d3e9548
JL
1429.BR u ,
1430then print glyph with single-letter name\~\c
1431.IR c .
92d0a6a6 1432.
465b256c 1433.
92d0a6a6
JR
1434.RS
1435.P
465b256c
JR
1436In
1437.IR groff ,
1438arbitrary
1439.I syntactical space
1440around and within this command is allowed to be added.
92d0a6a6
JR
1441.
1442Only when a preceding command on the same line ends with an argument
1443of variable length a separating space is obligatory.
1444.
1445In
1446.I classical
1447.IR troff ,
1448large clusters of these and other commands were used, mostly without
1449spaces; this made such output almost unreadable.
1450.
1451.RE
1452.
465b256c 1453.
92d0a6a6
JR
1454.P
1455For modern high-resolution devices, this command does not make sense
4d3e9548 1456because the width of the glyphs can become much larger than two
92d0a6a6
JR
1457decimal digits.
1458.
465b256c
JR
1459In
1460.BR groff ,
1461this is only used for the devices
92d0a6a6
JR
1462.BR X75 ,
1463.BR X75-12 ,
1464.BR X100 ,
1465and
1466.BR X100-12 .
1467.
1468For other devices,
1469the commands
1470.B t
1471and\~\c
1472.B u
1473provide a better functionality.
1474.
1475.
1476.\" --------------------------------------------------------------------
1477.SH "POSTPROCESSING"
1478.\" --------------------------------------------------------------------
1479.
1480The
1481.I roff
1482postprocessors are programs that have the task to translate the
465b256c
JR
1483.I intermediate output
1484into actions that are sent to a device.
92d0a6a6
JR
1485.
1486A device can be some piece of hardware such as a printer, or a software
1487file format suitable for graphical or text processing.
1488.
1489The
1490.I groff
1491system provides powerful means that make the programming of such
1492postprocessors an easy task.
1493.P
465b256c
JR
1494There is a library function that parses the
1495.I intermediate output
1496and sends the information obtained to the device via methods of a
1497class with a common interface for each device.
92d0a6a6
JR
1498.
1499So a
1500.I groff
1501postprocessor must only redefine the methods of this class.
1502.
1503For details, see the reference in section
1504.BR FILES .
1505.
1506.
1507.\" --------------------------------------------------------------------
1508.SH "EXAMPLES"
1509.\" --------------------------------------------------------------------
1510.
465b256c
JR
1511This section presents the
1512.I intermediate output
1513generated from the same input for three different devices.
92d0a6a6
JR
1514.
1515The input is the sentence
1516.I hell world
465b256c
JR
1517fed into
1518.B groff
1519on the command line.
1520.
92d0a6a6 1521.
4d3e9548 1522.IP \[bu] 2m
92d0a6a6
JR
1523High-resolution device
1524.I ps
1525.
92d0a6a6 1526.
465b256c 1527.RS
92d0a6a6 1528.P
4d3e9548
JL
1529.EX
1530\fBshell>\fP echo "hell world" | groff -Z -T ps
1531.EE
92d0a6a6 1532.
465b256c 1533.
92d0a6a6
JR
1534.P
1535.nf
1536.ft CB
1537x T ps
1538x res 72000 1 1
1539x init
1540p1
1541x font 5 TR
1542f5
1543s10000
1544V12000
1545H72000
1546thell
1547wh2500
1548tw
1549H96620
1550torld
1551n12000 0
1552x trailer
1553V792000
1554x stop
1555.ft P
1556.fi
1557.RE
1558.
465b256c 1559.
92d0a6a6
JR
1560.P
1561This output can be fed into the postprocessor
1562.BR grops (@MAN1EXT@)
1563to get its representation as a PostScript file.
1564.
1565.
4d3e9548 1566.IP \[bu] 2m
92d0a6a6
JR
1567Low-resolution device
1568.I latin1
1569.
92d0a6a6 1570.
465b256c 1571.RS
92d0a6a6
JR
1572.P
1573This is similar to the high-resolution device except that the
1574positioning is done at a minor scale.
1575.
1576Some comments (lines starting with
1577.IR # )
1578were added for clarification; they were not generated by the
1579formatter.
1580.
465b256c 1581.
92d0a6a6 1582.P
4d3e9548
JL
1583.EX
1584\fBshell>\fP "hell world" | groff -Z -T latin1
1585.EE
92d0a6a6 1586.
465b256c 1587.
92d0a6a6
JR
1588.P
1589.nf
465b256c 1590.I "# prologue"
92d0a6a6
JR
1591.ft CB
1592x T latin1
1593x res 240 24 40
1594x init
465b256c 1595.I "# begin a new page"
92d0a6a6
JR
1596.ft CB
1597p1
465b256c 1598.I "# font setup"
92d0a6a6
JR
1599.ft CB
1600x font 1 R
1601f1
1602s10
465b256c 1603.I "# initial positioning on the page"
92d0a6a6
JR
1604.ft CB
1605V40
1606H0
465b256c 1607.I "# write text `hell'"
92d0a6a6
JR
1608.ft CB
1609thell
465b256c 1610.I "# inform about a space, and do it by a horizontal jump"
92d0a6a6
JR
1611.ft CB
1612wh24
465b256c 1613.I "# write text `world'"
92d0a6a6
JR
1614.ft CB
1615tworld
465b256c 1616.I "# announce line break, but do nothing because ..."
92d0a6a6
JR
1617.ft CB
1618n40 0
465b256c 1619.I "# ... the end of the document has been reached"
92d0a6a6
JR
1620.ft CB
1621x trailer
1622V2640
1623x stop
1624.ft P
1625.fi
1626.RE
1627.
465b256c 1628.
92d0a6a6
JR
1629.P
1630This output can be fed into the postprocessor
1631.BR grotty (@MAN1EXT@)
1632to get a formatted text document.
1633.
1634.
4d3e9548 1635.IP \[bu] 2m
92d0a6a6
JR
1636Classical style output
1637.
92d0a6a6 1638.
465b256c 1639.RS
92d0a6a6
JR
1640.P
1641As a computer monitor has a very low resolution compared to modern
465b256c
JR
1642printers the
1643.I intermediate output
1644for the X\~devices can use the jump-and-write command with its 2-digit
1645displacements.
1646.
92d0a6a6
JR
1647.
1648.P
4d3e9548
JL
1649.EX
1650\fBshell>\fP "hell world" | groff -Z -T X100
1651.EE
92d0a6a6 1652.
465b256c 1653.
92d0a6a6
JR
1654.P
1655.nf
1656.ft CB
1657x T X100
1658x res 100 1 1
1659x init
1660p1
1661x font 5 TR
1662f5
1663s10
1664V16
1665H100
465b256c 1666.I "# write text with old-style jump-and-write command"
92d0a6a6
JR
1667.ft CB
1668ch07e07l03lw06w11o07r05l03dh7
1669n16 0
1670x trailer
1671V1100
1672x stop
1673.ft P
1674.fi
1675.RE
1676.
465b256c 1677.
92d0a6a6
JR
1678.P
1679This output can be fed into the postprocessor
465b256c 1680.BR \%xditview (1x)
92d0a6a6 1681or
465b256c 1682.BR \%gxditview (@MAN1EXT@)
92d0a6a6
JR
1683for displaying in\~X.
1684.
465b256c 1685.
92d0a6a6
JR
1686.P
1687Due to the obsolete jump-and-write command, the text clusters in the
1688classical output are almost unreadable.
1689.
1690.
1691.\" --------------------------------------------------------------------
1692.SH "COMPATIBILITY"
1693.\" --------------------------------------------------------------------
1694.
465b256c
JR
1695The
1696.I intermediate output
1697language of the
92d0a6a6
JR
1698.I classical troff
1699was first documented in
465b256c 1700.IR [CSTR\~#97] .
92d0a6a6
JR
1701.
1702The
465b256c
JR
1703.I groff intermediate output
1704format is compatible with this specification except for the following
1705features.
1706.
1707.
4d3e9548 1708.IP \[bu] 2m
92d0a6a6
JR
1709The classical quasi device independence is not yet implemented.
1710.
465b256c 1711.
4d3e9548 1712.IP \[bu] 2m
92d0a6a6
JR
1713The old hardware was very different from what we use today.
1714.
465b256c
JR
1715So the
1716.I groff
1717devices are also fundamentally different from the ones in
1718.I classical
1719.IR troff .
92d0a6a6
JR
1720.
1721For example, the classical PostScript device was called
1722.I post
1723and had a resolution of 720 units per inch,
465b256c
JR
1724while
1725.IR groff 's
92d0a6a6
JR
1726.I ps
1727device has a resolution of 72000 units per inch.
1728.
1729Maybe, by implementing some rescaling mechanism similar to the
1730classical quasi device independence, these could be integrated into
465b256c
JR
1731modern
1732.IR groff .
1733.
92d0a6a6 1734.
4d3e9548 1735.IP \[bu] 2m
92d0a6a6
JR
1736The B-spline command
1737.B D~
465b256c
JR
1738is correctly handled by the
1739.I intermediate output
1740parser, but the drawing routines aren't implemented in some of the
1741postprocessor programs.
1742.
1743.
4d3e9548 1744.IP \[bu] 2m
92d0a6a6
JR
1745The argument of the commands
1746.B s
1747and
1748.B x H
1749has the implicit unit scaled point\~\c
4d3e9548 1750.B z
465b256c
JR
1751in
1752.IR groff ,
1753while
1754.I classical troff
1755had point (\c
4d3e9548 1756.BR p ).
92d0a6a6 1757.
465b256c
JR
1758This isn't an incompatibility, but a compatible extension, for both
1759units coincide for all devices without a
92d0a6a6 1760.I sizescale
465b256c
JR
1761parameter, including all classical and the
1762.I groff
1763text devices.
92d0a6a6 1764.
465b256c
JR
1765The few
1766.I groff
1767devices with a sizescale parameter either did not exist, had a
1768different name, or seem to have had a different resolution.
92d0a6a6
JR
1769.
1770So conflicts with classical devices are very unlikely.
1771.
465b256c 1772.
4d3e9548
JL
1773.ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1774.IP \[bu] 2m
92d0a6a6
JR
1775The position changing after the commands
1776.BR Dp ,
1777.BR DP ,
1778and
1779.B Dt
1780is illogical, but as old versions of groff used this feature it is
1781kept for compatibility reasons.
1782.\} \" @STUPID_DRAWING_POSITIONING
1783.el \{\
4d3e9548 1784.IP \[bu] 2m
92d0a6a6
JR
1785Temporarily, there existed some confusion on the positioning after the
1786.B D
465b256c
JR
1787commands that are
1788.I groff
1789extensions.
92d0a6a6
JR
1790.
1791This has been clarified by establishing the classical rule for all
1792groff drawing commands:
1793.
465b256c 1794.
92d0a6a6
JR
1795.RS
1796.P
465b256c
JR
1797.ft I
1798The position after a graphic object has been drawn is at its end;
1799for circles and ellipses, the "end" is at the right side.
1800.ft
92d0a6a6
JR
1801.RE
1802.
465b256c 1803.
92d0a6a6
JR
1804.P
1805From this, the positionings specified for the drawing commands above
1806follow quite naturally.
1807.\} \" @STUPID_DRAWING_POSITIONING
1808.
1809.P
465b256c
JR
1810The differences between
1811.I groff
1812and
1813.I classical troff
1814are documented in
92d0a6a6
JR
1815.BR groff_diff (@MAN7EXT@).
1816.
1817.
1818.\" --------------------------------------------------------------------
1819.SH "FILES"
1820.\" --------------------------------------------------------------------
1821.
1822.TP
1823.BI @FONTDIR@/dev name /DESC
1824Device description file for device
1825.IR name .
1826.
1827.TP
4d3e9548 1828.IB \[la]groff-source-dir\[ra] /src/libs/libdriver/input.cpp
465b256c
JR
1829Defines the parser and postprocessor for the
1830.I intermediate
1831.IR output .
92d0a6a6
JR
1832.
1833It is located relative to the top directory of the
1834.I groff
4d3e9548 1835source tree.
92d0a6a6
JR
1836.
1837This parser is the definitive specification of the
465b256c
JR
1838.I groff intermediate output
1839format.
92d0a6a6
JR
1840.
1841.
1842.\" --------------------------------------------------------------------
1843.SH "SEE ALSO"
1844.\" --------------------------------------------------------------------
1845.
1846A reference like
1847.BR groff (@MAN7EXT@)
1848refers to a manual page; here
465b256c 1849.B groff
92d0a6a6
JR
1850in section\~\c
1851.I @MAN7EXT@
1852of the man-page documentation system.
1853.
1854To read the example, look up section\~@MAN7EXT@ in your desktop help
1855system or call from the shell prompt
1856.
465b256c 1857.
92d0a6a6
JR
1858.RS
1859.P
4d3e9548
JL
1860.EX
1861\fBshell>\fP man @MAN7EXT@ groff
1862.EE
92d0a6a6
JR
1863.RE
1864.
465b256c 1865.
92d0a6a6
JR
1866.P
1867For more details, see
1868.BR man (1).
1869.
465b256c 1870.
92d0a6a6
JR
1871.TP
1872.BR groff (@MAN1EXT@)
1873option
1874.B -Z
1875and further readings on groff.
1876.
465b256c 1877.
92d0a6a6
JR
1878.TP
1879.BR groff (@MAN7EXT@)
1880for details of the
1881.I groff
1882language such as numerical units and escape sequences.
1883.
465b256c 1884.
92d0a6a6
JR
1885.TP
1886.BR groff_font (@MAN5EXT@)
1887for details on the device scaling parameters of the
1888.B DESC
1889file.
1890.
465b256c 1891.
92d0a6a6 1892.TP
465b256c 1893.BR @g@troff (@MAN1EXT@)
92d0a6a6
JR
1894generates the device-independent intermediate output.
1895.
465b256c 1896.
92d0a6a6
JR
1897.TP
1898.BR roff (@MAN7EXT@)
1899for historical aspects and the general structure of roff systems.
1900.
465b256c 1901.
92d0a6a6
JR
1902.TP
1903.BR groff_diff (@MAN7EXT@)
1904The differences between the intermediate output in groff and classical
1905troff.
1906.
465b256c
JR
1907.
1908.TP
1909.BR gxditview (@MAN1EXT@)
1910Viewer for the
1911.I intermediate
1912.IR output .
1913.
1914.
92d0a6a6
JR
1915.P
1916.BR \%grodvi (@MAN1EXT@),
1917.BR \%grohtml (@MAN1EXT@),
1918.BR \%grolbp (@MAN1EXT@),
1919.BR \%grolj4 (@MAN1EXT@),
1920.BR \%grops (@MAN1EXT@),
1921.BR \%grotty (@MAN1EXT@)
1922.br
1923.RS
1924the groff postprocessor programs.
1925.RE
1926.
465b256c 1927.
92d0a6a6
JR
1928.P
1929For a treatment of all aspects of the groff system within a single
1930document, see the
1931.I groff info
1932.IR file .
1933.
1934It can be read within the integrated help systems, within
1935.BR emacs (1)
1936or from the shell prompt by
1937.
1938.RS
4d3e9548
JL
1939.EX
1940\fBshell>\fP info groff
1941.EE
92d0a6a6
JR
1942.RE
1943.
465b256c 1944.
92d0a6a6
JR
1945.P
1946The
1947.I classical troff output language
1948is described in two AT&T Bell Labs CSTR documents available on-line at
4d3e9548
JL
1949.UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr.html
1950Bell Labs CSTR site
1951.UE .
92d0a6a6 1952.
465b256c 1953.
92d0a6a6
JR
1954.TP
1955.I [CSTR #97]
1956.I A Typesetter-independent TROFF
1957by
1958.I Brian Kernighan
4d3e9548
JL
1959is the original and most comprehensive documentation on the output
1960language; see
1961.UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:97.ps.gz
1962CSTR\~#97
1963.UE .
92d0a6a6 1964.
465b256c 1965.
92d0a6a6
JR
1966.TP
1967.I [CSTR\~#54]
1968The 1992 revision of the
1969.I Nroff/\:Troff User's Manual
1970by
4d3e9548 1971.I J.\& F.\& Ossanna
92d0a6a6
JR
1972and
1973.I Brian Kernighan
4d3e9548 1974isn't as comprehensive as
92d0a6a6 1975.I [CSTR\~#97]
465b256c 1976regarding the output language; see
4d3e9548
JL
1977.UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz
1978CSTR\~#54
1979.UE .
92d0a6a6
JR
1980.
1981.
1982.\" --------------------------------------------------------------------
1983.SH "AUTHORS"
1984.\" --------------------------------------------------------------------
1985.
4d3e9548
JL
1986Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
1987Free Software Foundation, Inc.
465b256c
JR
1988.
1989.
92d0a6a6
JR
1990.P
1991This document is distributed under the terms of the FDL (GNU Free
4d3e9548 1992Documentation License) version 1.3 or later.
92d0a6a6
JR
1993.
1994You should have received a copy of the FDL with this package; it is also
1995available on-line at the
4d3e9548
JL
1996.UR http://\:www.gnu.org/\:copyleft/\:fdl.html
1997GNU copyleft site
1998.UE .
92d0a6a6 1999.
465b256c 2000.
92d0a6a6
JR
2001.P
2002This document is part of
2003.IR groff ,
465b256c
JR
2004the GNU
2005.I roff
2006distribution.
92d0a6a6
JR
2007.
2008It is based on a former version \- published under the GPL \- that
2009described only parts of the
2010.I groff
2011extensions of the output language.
2012.
4d3e9548 2013It was rewritten in 2002 by Bernd Warken and is
465b256c 2014maintained by
4d3e9548
JL
2015.MT wl@gnu.org
2016Werner Lemberg
2017.ME .
92d0a6a6
JR
2018.
2019.\" --------------------------------------------------------------------
2020.\" Emacs settings
2021.\" --------------------------------------------------------------------
2022.\"
2023.\" Local Variables:
2024.\" mode: nroff
2025.\" End: