Next: Output Language Compatibility, Previous: Command Reference, Up: GNU troff Output [Contents][Index]
troff Output ExamplesThis section presents the output
GNU
troff generates from the same input formatted for three different devices.
The input is the phrase
‘hell world’
piped to
GNU
troff on the command line.
psWe depict the standard output stream of
GNU
troff in its default build configuration
and in the absence of an explicit
-T
option.
shell> echo "hell world" | groff -Z -T ps x T ps x res 72000 1 1 x init
p1 x font 5 TR f5 s10000 V12000 H72000 thell wh2500 tw H96620 torld n12000 0
x trailer V792000 x stop
This output can be placed onto the standard input stream of
grops
to produce its representation as a PostScript file.
latin1This is similar to the high-resolution device except that the positioning is done at a minor scale. Some comments (lines starting with ‘#’) were added for clarification; they were not generated by the formatter.
shell> echo "hell world" | groff -Z -T latin1 # header x T latin1 x res 240 24 40 x init
# begin a new page p1 # font setup x font 1 R f1 s10 # initial positioning on the page V40 H0 # write text 'hell' thell # inform about space, and issue a horizontal jump wh24 # write text 'world' tworld # announce line break, but do nothing because... n40 0
# ...the end of the document has been reached x trailer V2640 x stop
This output can be placed onto the standard input stream of
grotty
to produce its representation as text file.
troff outputSince a video display has lower resolution than modern printers,
GNU
troff’s output for X11 devices can use the legacy compressed encoding.
shell> echo "hell world" | groff -Z -T X100 x T X100 x res 100 1 1 x init
p1 x font 5 TR f5 s10 V16 H100 # write text in legacy compressed encoding ch07e07l03lw06w11o07r05l03dh7 n16 0
x trailer V1100 x stop
Place the foregoing into the standard input stream of
xditview
or
gxditview
to display it in an X11 window.
The legacy compressed encoding makes the content of formatted text
in AT&T
troff output almost incomprehenible.
Next: Output Language Compatibility, Previous: Command Reference, Up: GNU troff Output [Contents][Index]