summaryrefslogtreecommitdiffstats
path: root/doc/groff.html.node/Intermediate-Output-Examples.html
blob: 0947e86381ed2db1acea30e026854e46c60e883d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.0.3, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- This manual documents GNU troff version 1.23.0.

Copyright � 1994-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled "GNU Free
Documentation License". -->
<title>Intermediate Output Examples (The GNU Troff Manual)</title>

<meta name="description" content="Intermediate Output Examples (The GNU Troff Manual)">
<meta name="keywords" content="Intermediate Output Examples (The GNU Troff Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Request-Index.html" rel="index" title="Request Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="gtroff-Output.html" rel="up" title="gtroff Output">
<link href="Output-Language-Compatibility.html" rel="next" title="Output Language Compatibility">
<link href="Command-Reference.html" rel="prev" title="Command Reference">
<style type="text/css">
<!--
div.example {margin-left: 3.2em}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="Intermediate-Output-Examples">
<div class="nav-panel">
<p>
Next: <a href="Output-Language-Compatibility.html" accesskey="n" rel="next">Output Language Compatibility</a>, Previous: <a href="Command-Reference.html" accesskey="p" rel="prev">Command Reference</a>, Up: <a href="gtroff-Output.html" accesskey="u" rel="up"><code class="code">gtroff</code> Output</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Request-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Intermediate-Output-Examples-1">6.1.3 Intermediate Output Examples</h4>

<p>This section presents the intermediate output generated from the same
input for three different devices.  The input is the sentence &lsquo;<samp class="samp">hell
world</samp>&rsquo; fed into <code class="code">gtroff</code> on the command line.
</p>
<dl class="table">
<dt>High-resolution device <code class="code">ps</code></dt>
<dd>
<p>This is the standard output of <code class="code">gtroff</code> if no <samp class="option">-T</samp> option is
given.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">shell&gt; echo &quot;hell world&quot; | groff -Z -T ps

x T ps
x res 72000 1 1
x init
</pre></div><pre class="example-preformatted">p1
x font 5 TR
f5
s10000
V12000
H72000
thell
wh2500
tw
H96620
torld
n12000 0
</pre><div class="group"><pre class="example-preformatted">x trailer
V792000
x stop
</pre></div></div>

<p>This output can be fed into <code class="code">grops</code> to get its representation as a
PostScript file.
</p>
</dd>
<dt>Low-resolution device <code class="code">latin1</code></dt>
<dd>
<p>This is similar to the high-resolution device except that the
positioning is done at a minor scale.  Some comments (lines starting
with &lsquo;<samp class="samp">#</samp>&rsquo;) were added for clarification; they were not generated by
the formatter.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">shell&gt; echo &quot;hell world&quot; | groff -Z -T latin1

# prologue
x T latin1
x res 240 24 40
x init
</pre></div><pre class="example-preformatted"># 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
</pre><div class="group"><pre class="example-preformatted"># ...the end of the document has been reached
x trailer
V2640
x stop
</pre></div></div>

<p>This output can be fed into <code class="code">grotty</code> to get a formatted text
document.
</p>
</dd>
<dt><abbr class="acronym">AT&amp;T</abbr> <code class="code">troff</code> output</dt>
<dd><p>Since a computer monitor has a much lower resolution than modern
printers, the intermediate output for X11 devices can use the
jump-and-write command with its 2-digit displacements.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">shell&gt; echo &quot;hell world&quot; | groff -Z -T X100

x T X100
x res 100 1 1
x init
</pre></div><pre class="example-preformatted">p1
x font 5 TR
f5
s10
V16
H100
# write text with jump-and-write commands
ch07e07l03lw06w11o07r05l03dh7
n16 0
</pre><div class="group"><pre class="example-preformatted">x trailer
V1100
x stop
</pre></div></div>

<p>This output can be fed into <code class="code">xditview</code> or <code class="code">gxditview</code> for
displaying in&nbsp;X.
</p>
<p>Due to the obsolete jump-and-write command, the text clusters in the
<abbr class="acronym">AT&amp;T</abbr> <code class="code">troff</code> output are almost unreadable.
</p></dd>
</dl>


</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Output-Language-Compatibility.html">Output Language Compatibility</a>, Previous: <a href="Command-Reference.html">Command Reference</a>, Up: <a href="gtroff-Output.html"><code class="code">gtroff</code> Output</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Request-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>