*.dvi
binary TeX DVI file.
Convert a binary tex dvi file to dtl text representation
dv2dt input-DVI-file
output-DTL-file
dv2dt converts a binary TeX DVI file to an editable text file in DTL (DVI Text Language) format. The companion dt2dv(1) utility can convert the DTL file back to a binary DVI file.
TeX DVI files contain a compact binary description of typeset pages, as a stream of operation code bytes, each immediately followed by zero or more parameter bytes. The format of DVI files is fully described in Donald E. Knuth, TeX: The Program, Addison-Wesley (1986), ISBN 0-201-13437-3, as well as in the dvitype(1) literate program source code.
For convenience, we provide a summary of DVI commands here. In the following list, operation code bytes are given as unsigned decimal values, followed by their symbolic names (not present in the DVI file), and a short description. A designation like b[+n] means that the operation code byte is followed by a parameter b which uses n bytes, and is signed. Without the plus sign, the parameter is unsigned. Signed integer parameter values are always represented in two's complement arithmetic, which is the system followed by most computers manufactured today, including all personal computers and workstations.
Set character 0 from current font.
Set character 127 from current font.
Set 1-byte unsigned character (uchar) number c.
Set 2-byte uchar number c.
Set 3-byte uchar number c.
Set 4-byte signed character (schar) number c.
Set rule, height a, width b.
Put 1-byte uchar c.
Put 2-byte uchar c.
Put 3-byte uchar c.
Put 4-byte schar c.
Put rule, height a, width b.
Do nothing.
Beginning of page. The parameters c0 ... c9 are the TeX page counters, the contents of TeX count registers \count0 ... \count9. The parameter p is the byte offset from the beginning of the DVI file of the previous bop operation code byte. The first such command in the file has p = -1.
End of page.
Push (h,v,w,x,y,z) onto stack.
Pop (h,v,w,x,y,z) from stack.
Move right b units.
Move right b units.
Move right b units.
Move right b units.
Move right w units.
Move right b units, and set w = b.
Move right b units, and set w = b.
Move right b units, and set w = b.
Move right b units, and set w = b.
Move right x units.
Move right b units, and set x = b.
Move right b units, and set x = b.
Move right b units, and set x = b.
Move right b units, and set x = b.
Move down a units.
Move down a units.
Move down a units.
Move down a units.
Move right y units.
Move right a units, and set y = a.
Move right a units, and set y = a.
Move right a units, and set y = a.
Move right a units, and set y = a.
Move right z units.
Move right a units, and set z = a.
Move right a units, and set z = a.
Move right a units, and set z = a.
Move right a units, and set z = a.
Set current font number (f) = 0.
Set f = 63.
Set f = k.
Set f = k.
Set f = k.
Set f = k.
Special string x with k bytes.
Special string x with k bytes.
Special string x with k bytes.
Special string x with (unsigned) k bytes.
Define font k. The parameters are:
Checksum for TFM file.
Scale factor, in DVI units.
Design size, in DVI units.
Length of the ``area'' or directory.
Length of the font name.
Area and font name string(s).
Define font k.
Define font k.
Define font k.
Begin preamble. The parameters are:
DVI format. Standard TeX has ID = 2, and TeX-XeT has ID = 3.
Numerator of 100 nm / DVI unit.
Denominator of 100 nm / DVI unit.
1000 * magnification.
Comment length.
Comment string.
Begin postamble. The parameters are:
Pointer to final bop.
Duplicates of values in preamble.
Height-plus-depth of tallest page, in DVI units.
Width of widest page, in DVI units.
Maximum stack depth needed to process this DVI file.
Total number of pages (bop commands) present.
End postamble. The parameters are:
Byte offset from the beginning of the DVI file to the post command that started the postamble.
DVI format ID, as in the preamble.
At least four 223 bytes.
Undefined.
Undefined.
A DTL file contains one line per command, with a limit of 1024 characters per line. Each command contains a symbolic operation name, followed by zero or more parameter values. The parameter value descriptions are not repeated here; they can be found in the previous section.
This command specifies the name of the DTL file type; it has no DVI file equivalent.
Series of set_char commands, for printable ASCII text.
Literal ASCII left parenthesis in (text).
Literal ASCII right parenthesis in (text).
Literal ASCII backslash in (text).
Literal ASCII double quote in (text).
Set_char for character with hexadecimal code XY, not in parentheses, but by itself for readability.
Set, with (1,2,3,4)-byte charcodes.
set_rule.
Put, with (1,2,3,4)-byte charcodes.
put_rule.
nop (do nothing).
bop (beginning of page).
eop (end of page).
Push.
Pop.
Right, with (1,2,3,4)-byte argument.
As in DVI.
As in DVI.
Down, with (1,2,3,4)-byte argument.
As in DVI.
As in DVI.
fnt_num (set current font to font number in 0 to 63).
fnt (set current font to (1,2,3,4)-byte font number).
xxx (special commands with (1,2,3,4)-byte string length).
fnt_def (assign a number to a named font).
Preamble.
post (begin postamble).
post_post (end postamble).
Undefined DVI command (250 to 255).
The following 2-line TeX file
Hello. \bye
when processed with the commands
tex hello.tex dv2dt hello.dvi hello.dtl
produces this DTL file:
variety sequences-6 pre 2 25400000 473628672 1000 27 ' TeX output 1995.03.02:2334' bop 1 0 0 0 0 0 0 0 0 0 -1 [ d3 -917504 ] d4 42152922 [ d4 -41497562 [ r3 1310720 fd1 0 11374260171 655360 655360 0 5 '' 'cmr10' fn0 (Hello.) ] ] d3 1572864 [ r4 15229091 (1) ] eop post 42 25400000 473628672 1000 43725786 30785863 2 1 fd1 0 11374260171 655360 655360 0 5 'cmr10' post_post 152 2 223 223 223 223
The command
dt2dv hello.dtl hello.dvi
will reconstruct the original DVI file.
*.dvi
binary TeX DVI file.
*.dtl
text representation of a TeX DVI file in DVI Text Language format.
11 releases since Debian 4.0 (Etch); the text changed 1 time.