1DV2DT(1)                    General Commands Manual                   DV2DT(1)
2
3
4

NAME

6       dv2dt - convert a binary TeX DVI file to DTL text representation
7

SYNOPSIS

9       dv2dt input-DVI-file output-DTL-file
10
11       If the filenames are omitted, then stdin and stdout are assumed.
12

DESCRIPTION

14       dv2dt  converts  a  binary TeX DVI file to an editable text file in DTL
15       (DVI Text Language) format.  The companion dt2dv(1) utility can convert
16       the DTL file back to a binary DVI file.
17

DVI COMMAND DESCRIPTION

19       TeX DVI files contain a compact binary description of typeset pages, as
20       a stream of operation code bytes, each immediately followed by zero  or
21       more  parameter  bytes.   The format of DVI files is fully described in
22       Donald  E.  Knuth,  TeX:  The  Program,  Addison-Wesley  (1986),   ISBN
23       0-201-13437-3,  as  well  as  in the dvitype(1) literate program source
24       code.
25
26       For convenience, we provide a summary of DVI  commands  here.   In  the
27       following list, operation code bytes are given as unsigned decimal val‐
28       ues, followed by their symbolic names (not present in  the  DVI  file),
29       and a short description.  A designation like b[+n] means that the oper‐
30       ation code byte is followed by a parameter b which uses n bytes, and is
31       signed.   Without  the  plus  sign,  the parameter is unsigned.  Signed
32       integer parameter values are always  represented  in  two's  complement
33       arithmetic, which is the system followed by most computers manufactured
34       today, including all personal computers and workstations.
35
36       0 set_char_0     Set character 0 from current font.
37
38       ...
39
40       127 set_char_127 Set character 127 from current font.
41
42       128 set1  c[1]   Set 1-byte unsigned character (uchar) number c.
43
44       129 set2  c[2]   Set 2-byte uchar number c.
45
46       130 set3  c[3]   Set 3-byte uchar number c.
47
48       131 set4  c[+4]  Set 4-byte signed character (schar) number c.
49
50       132 set_rule  a[+4]  b[+4]
51                        Set rule, height a, width b.
52
53       133 put1  c[1]   Put 1-byte uchar c.
54
55       134 put2  c[2]   Put 2-byte uchar c.
56
57       135 put3  c[3]   Put 3-byte uchar c.
58
59       136 put4  c[+4]  Put 4-byte schar c.
60
61       137 put_rule  a[+4]  b[+4]
62                        Put rule, height a, width b.
63
64       138 nop          Do nothing.
65
66       139 bop  c0[+4]  ...  c9[+4]  p[+4]
67                        Beginning of page.  The parameters c0  ...  c9 are the
68                        TeX page counters, the contents of TeX count registers
69                        \count0  ...  \count9.  The parameter p  is  the  byte
70                        offset  from the beginning of the DVI file of the pre‐
71                        vious bop operation code byte.  The first such command
72                        in the file has p = -1.
73
74       140 eop          End of page.
75
76       141 push         Push (h,v,w,x,y,z) onto stack.
77
78       142 pop          Pop (h,v,w,x,y,z) from stack.
79
80       143 right1  b[+1]
81                        Move right b units.
82
83       144 right2  b[+2]
84                        Move right b units.
85
86       145 right3  b[+3]
87                        Move right b units.
88
89       146 right4  b[+4]
90                        Move right b units.
91
92       147 w0           Move right w units.
93
94       148 w1  b[+1]    Move right b units, and set w = b.
95
96       149 w2  b[+2]    Move right b units, and set w = b.
97
98       150 w3  b[+3]    Move right b units, and set w = b.
99
100       151 w4  b[+4]    Move right b units, and set w = b.
101
102       152 x0           Move right x units.
103
104       153 x1  b[+1]    Move right b units, and set x = b.
105
106       154 x2  b[+2]    Move right b units, and set x = b.
107
108       155 x3  b[+3]    Move right b units, and set x = b.
109
110       156 x4  b[+4]    Move right b units, and set x = b.
111
112       157 down1  a[+1] Move down a units.
113
114       158 down2  a[+2] Move down a units.
115
116       159 down3  a[+3] Move down a units.
117
118       160 down4  a[+4] Move down a units.
119
120       161 y0           Move right y units.
121
122       162 y1  a[+1]    Move right a units, and set y = a.
123
124       163 y2  a[+2]    Move right a units, and set y = a.
125
126       164 y3  a[+3]    Move right a units, and set y = a.
127
128       165 y4  a[+4]    Move right a units, and set y = a.
129
130       166 z0           Move right z units.
131
132       167 z1  a[+1]    Move right a units, and set z = a.
133
134       168 z2  a[+2]    Move right a units, and set z = a.
135
136       169 z3  a[+3]    Move right a units, and set z = a.
137
138       170 z4  a[+4]    Move right a units, and set z = a.
139
140       171 fnt_num_0    Set current font number (f) = 0.
141
142       ...
143
144       234 fnt_num_63   Set f = 63.
145
146       235 fnt1  k[1]   Set f = k.
147
148       236 fnt2  k[2]   Set f = k.
149
150       237 fnt3  k[3]   Set f = k.
151
152       238 fnt4  k[+4]  Set f = k.
153
154       239 xxx1  k[1]  x[k]
155                        Special string x with k bytes.
156
157       240 xxx2  k[2]  x[k]
158                        Special string x with k bytes.
159
160       241 xxx3  k[3]  x[k]
161                        Special string x with k bytes.
162
163       242 xxx4  k[4]  x[k]
164                        Special string x with (unsigned) k bytes.
165
166       243 fnt_def1  k[1] c[4] s[4] d[4] a[1] l[1] n[a+l]
167                        Define font k.  The parameters are:
168
169                        c   Checksum for TFM file.
170
171                        s   Scale factor, in DVI units.
172
173                        d   Design size, in DVI units.
174
175                        a   Length of the ``area'' or directory.
176
177                        l   Length of the font name.
178
179                        n   Area and font name string(s).
180
181       244 fnt_def2  k[2] c[4] s[4] d[4] a[1] l[1] n[a+l]
182                        Define font k.
183
184       245 fnt_def3  k[3] c[4] s[4] d[4] a[1] l[1] n[a+l]
185                        Define font k.
186
187       246 fnt_def4  k[+4] c[4] s[4] d[4] a[1] l[1] n[a+l]
188                        Define font k.
189
190       247 pre  i[1]  num[4]  den[4]  mag[4]  k[1]  x[k]
191                        Begin preamble.  The parameters are:
192
193                        i     DVI  format.   Standard TeX has ID = 2, and TeX-
194                              XeT has ID = 3.
195
196                        num   Numerator of 100 nm / DVI unit.
197
198                        den   Denominator of 100 nm / DVI unit.
199
200                        mag   1000 * magnification.
201
202                        k     Comment length.
203
204                        x     Comment string.
205
206       248 post  p[4] num[4] den[4] mag[4] l[4] u[4] s[2] t[2]
207                        Begin postamble.  The parameters are:
208
209                        p     Pointer to final bop.
210
211                        num, den, mag
212                              Duplicates of values in preamble.
213
214                        l     Height-plus-depth of tallest page, in DVI units.
215
216                        u     Width of widest page, in DVI units.
217
218                        s     Maximum stack depth needed to process  this  DVI
219                              file.
220
221                        t     Total number of pages (bop commands) present.
222
223       249 post_post  q[4] i[1] 223 ... 223
224                        End postamble.  The parameters are:
225
226                        q     Byte  offset  from the beginning of the DVI file
227                              to the post command that started the postamble.
228
229                        i     DVI format ID, as in the preamble.
230
231                        223   At least four 223 bytes.
232
233       250              Undefined.
234
235       ...
236
237       255              Undefined.
238

DTL COMMAND DESCRIPTION

240       A DTL file contains one line per command, with a limit of 1024  charac‐
241       ters  per  line.  Each command contains a symbolic operation name, fol‐
242       lowed by zero or more parameter values.  The parameter  value  descrip‐
243       tions are not repeated here; they can be found in the previous section.
244
245       variety <variety-name>
246                            This  command  specifies  the name of the DTL file
247                            type; it has no DVI file equivalent.
248
249       (text)               Series of set_char commands, for  printable  ASCII
250                            text.
251
252       \(                   Literal ASCII left parenthesis in (text).
253
254       \)                   Literal ASCII right parenthesis in (text).
255
256       \\                   Literal ASCII backslash in (text).
257
258       \"                   Literal ASCII double quote in (text).
259
260       \XY                  Set_char  for  character with hexadecimal code XY,
261                            not in parentheses, but by itself for readability.
262
263       s1, s2, s2, s3       Set, with (1,2,3,4)-byte charcodes.
264
265       sr                   set_rule.
266
267       p1, p2, p2, p3       Put, with (1,2,3,4)-byte charcodes.
268
269       pr                   put_rule.
270
271       nop                  nop (do nothing).
272
273       bop                  bop (beginning of page).
274
275       eop                  eop (end of page).
276
277       [                    Push.
278
279       ]                    Pop.
280
281       r1, r2, r3, r4       Right, with (1,2,3,4)-byte argument.
282
283       w0, w1, w2, w3, w4   As in DVI.
284
285       x0, x1, x2, x3, x4   As in DVI.
286
287       d1, d2, d3, d4       Down, with (1,2,3,4)-byte argument.
288
289       y0, y1, y2, y3, y4   As in DVI.
290
291       z0, z1, z2, z3, z4   As in DVI.
292
293       fn                   fnt_num (set current font to font number in  0  to
294                            63).
295
296       f1, f2, f3, f4       fnt  (set current font to (1,2,3,4)-byte font num‐
297                            ber).
298
299       special              xxx (special commands with  (1,2,3,4)-byte  string
300                            length).
301
302       fd                   fnt_def (assign a number to a named font).
303
304       pre                  Preamble.
305
306       post                 post (begin postamble).
307
308       post_post            post_post (end postamble).
309
310       opcode               Undefined DVI command (250 to 255).
311

SAMPLE DTL FILE

313       The following 2-line TeX file
314              Hello.
315              \bye
316       when processed with the commands
317              tex hello.tex
318              dv2dt hello.dvi hello.dtl
319       produces this DTL file:
320              variety sequences-6
321              pre 2 25400000 473628672 1000 27 ' TeX output 1995.03.02:2334'
322              bop 1 0 0 0 0 0 0 0 0 0 -1
323              [
324              d3 -917504
325              ]
326              d4 42152922
327              [
328              d4 -41497562
329              [
330              r3 1310720
331              fd1 0 11374260171 655360 655360 0 5 '' 'cmr10'
332              fn0
333              (Hello.)
334              ]
335              ]
336              d3 1572864
337              [
338              r4 15229091
339              (1)
340              ]
341              eop
342              post 42 25400000 473628672 1000 43725786 30785863 2 1
343              fd1 0 11374260171 655360 655360 0 5 'cmr10'
344              post_post 152 2 223 223 223 223
345       The command
346              dt2dv hello.dtl hello.dvi
347       will reconstruct the original DVI file.
348

SEE ALSO

350       dt2dv(1), dvitype(1), tex(1).
351

FILES

353       *.dvi   binary TeX DVI file.
354
355       *.dtl   text representation of a TeX DVI file in DVI Text Language for‐
356               mat.
357

AUTHOR

359       dv2dt and dt2dv(1) were written by
360              Geoffrey Tobin
361              Department of Electronic Engineering
362              La Trobe University
363              Bundoora, Victoria 3083
364              Australia
365              Tel: +61 3 479 3736
366              FAX: +61 3 479 3025
367              Email: <G.Tobin@ee.latrobe.edu.au>
368
369       These manual pages were primarily written by
370              Nelson H. F. Beebe, Ph.D.
371              Center for Scientific Computing
372              Department of Mathematics
373              University of Utah
374              Salt Lake City, UT 84112
375              Tel: +1 801 581 5254
376              FAX: +1 801 581 4148
377              Email: <beebe@math.utah.edu>
378
379
380
381Version 0.6.0                    08 March 1995                        DV2DT(1)
Impressum