# dv2dt(1) - man - phpMan

[DV2DT(1)](https://www.chedong.com/phpMan.php/man/DV2DT/1/markdown)                               General Commands Manual                              [DV2DT(1)](https://www.chedong.com/phpMan.php/man/DV2DT/1/markdown)



## NAME
       dv2dt - convert a binary TeX DVI file to DTL text representation

## SYNOPSIS
       **dv2dt** _input-DVI-file_ _output-DTL-file_

       If the filenames are omitted, then _stdin_ and _stdout_ are assumed.

## DESCRIPTION
       **dv2dt** converts a binary TeX DVI file to an editable text file in DTL (_DVI_ _Text_ _Language_) for‐
       mat.  The companion [**dt2dv**(1)](https://www.chedong.com/phpMan.php/man/dt2dv/1/markdown) utility can convert the DTL file back to a binary DVI file.

## DVI COMMAND DESCRIPTION
       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)](https://www.chedong.com/phpMan.php/man/dvitype/1/markdown) 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 repre‐
       sented in two's complement arithmetic, which is the system followed by most  computers  manu‐
       factured today, including all personal computers and workstations.

       _0_ _set_char_0_     Set character 0 from current font.

       _..._

       _127_ _set_char_127_ Set character 127 from current font.

       _128_ _set1_  _c[1]_   Set 1-byte unsigned character (uchar) number _c_.

       _129_ _set2_  _c[2]_   Set 2-byte uchar number _c_.

       _130_ _set3_  _c[3]_   Set 3-byte uchar number _c_.

       _131_ _set4_  _c[+4]_  Set 4-byte signed character (schar) number _c_.

       _132_ _set_rule_  _a[+4]_  _b[+4]_
                        Set rule, height _a_, width _b_.

       _133_ _put1_  _c[1]_   Put 1-byte uchar _c_.

       _134_ _put2_  _c[2]_   Put 2-byte uchar _c_.

       _135_ _put3_  _c[3]_   Put 3-byte uchar _c_.

       _136_ _put4_  _c[+4]_  Put 4-byte schar _c_.

       _137_ _put_rule_  _a[+4]_  _b[+4]_
                        Put rule, height _a_, width _b_.

       _138_ _nop_          Do nothing.

       _139_ _bop_  _c0[+4]_  _..._  _c9[+4]_  _p[+4]_
                        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_.

       _140_ _eop_          End of page.

       _141_ _push_         Push (_h,v,w,x,y,z_) onto stack.

       _142_ _pop_          Pop (_h,v,w,x,y,z_) from stack.

       _143_ _right1_  _b[+1]_
                        Move right _b_ units.

       _144_ _right2_  _b[+2]_
                        Move right _b_ units.

       _145_ _right3_  _b[+3]_
                        Move right _b_ units.

       _146_ _right4_  _b[+4]_
                        Move right _b_ units.

       _147_ _w0_           Move right _w_ units.

       _148_ _w1_  _b[+1]_    Move right _b_ units, and set _w_ _=_ _b_.

       _149_ _w2_  _b[+2]_    Move right _b_ units, and set _w_ _=_ _b_.

       _150_ _w3_  _b[+3]_    Move right _b_ units, and set _w_ _=_ _b_.

       _151_ _w4_  _b[+4]_    Move right _b_ units, and set _w_ _=_ _b_.

       _152_ _x0_           Move right _x_ units.

       _153_ _x1_  _b[+1]_    Move right _b_ units, and set _x_ _=_ _b_.

       _154_ _x2_  _b[+2]_    Move right _b_ units, and set _x_ _=_ _b_.

       _155_ _x3_  _b[+3]_    Move right _b_ units, and set _x_ _=_ _b_.

       _156_ _x4_  _b[+4]_    Move right _b_ units, and set _x_ _=_ _b_.

       _157_ _down1_  _a[+1]_ Move down _a_ units.

       _158_ _down2_  _a[+2]_ Move down _a_ units.

       _159_ _down3_  _a[+3]_ Move down _a_ units.

       _160_ _down4_  _a[+4]_ Move down _a_ units.

       _161_ _y0_           Move right _y_ units.

       _162_ _y1_  _a[+1]_    Move right _a_ units, and set _y_ _=_ _a_.

       _163_ _y2_  _a[+2]_    Move right _a_ units, and set _y_ _=_ _a_.

       _164_ _y3_  _a[+3]_    Move right _a_ units, and set _y_ _=_ _a_.

       _165_ _y4_  _a[+4]_    Move right _a_ units, and set _y_ _=_ _a_.

       _166_ _z0_           Move right _z_ units.

       _167_ _z1_  _a[+1]_    Move right _a_ units, and set _z_ _=_ _a_.

       _168_ _z2_  _a[+2]_    Move right _a_ units, and set _z_ _=_ _a_.

       _169_ _z3_  _a[+3]_    Move right _a_ units, and set _z_ _=_ _a_.

       _170_ _z4_  _a[+4]_    Move right _a_ units, and set _z_ _=_ _a_.

       _171_ _fnt_num_0_    Set current font number _(f)_ _=_ _0_.

       _..._

       _234_ _fnt_num_63_   Set _f_ _=_ _63_.

       _235_ _fnt1_  _k[1]_   Set _f_ _=_ _k_.

       _236_ _fnt2_  _k[2]_   Set _f_ _=_ _k_.

       _237_ _fnt3_  _k[3]_   Set _f_ _=_ _k_.

       _238_ _fnt4_  _k[+4]_  Set _f_ _=_ _k_.

       _239_ _xxx1_  _k[1]_  _x[k]_
                        Special string _x_ with _k_ bytes.

       _240_ _xxx2_  _k[2]_  _x[k]_
                        Special string _x_ with _k_ bytes.

       _241_ _xxx3_  _k[3]_  _x[k]_
                        Special string _x_ with _k_ bytes.

       _242_ _xxx4_  _k[4]_  _x[k]_
                        Special string _x_ with (unsigned) _k_ bytes.

       _243_ _fnt_def1_  _k[1]_ _c[4]_ _s[4]_ _d[4]_ _a[1]_ _l[1]_ _n[a+l]_
                        Define font _k_.  The parameters are:

                        _c_   Checksum for TFM file.

                        _s_   Scale factor, in DVI units.

                        _d_   Design size, in DVI units.

                        _a_   Length of the ``area'' or directory.

                        _l_   Length of the font name.

                        _n_   Area and font name string(s).

       _244_ _fnt_def2_  _k[2]_ _c[4]_ _s[4]_ _d[4]_ _a[1]_ _l[1]_ _n[a+l]_
                        Define font _k_.

       _245_ _fnt_def3_  _k[3]_ _c[4]_ _s[4]_ _d[4]_ _a[1]_ _l[1]_ _n[a+l]_
                        Define font _k_.

       _246_ _fnt_def4_  _k[+4]_ _c[4]_ _s[4]_ _d[4]_ _a[1]_ _l[1]_ _n[a+l]_
                        Define font _k_.

       _247_ _pre_  _i[1]_  _num[4]_  _den[4]_  _mag[4]_  _k[1]_  _x[k]_
                        Begin preamble.  The parameters are:

                        _i_     DVI format.  Standard TeX has _ID_ _=_ _2_, and TeX-XeT has _ID_ _=_ _3_.

                        _num_   Numerator of 100 nm / DVI unit.

                        _den_   Denominator of 100 nm / DVI unit.

                        _mag_   1000 * magnification.

                        _k_     Comment length.

                        _x_     Comment string.

       _248_ _post_  _p[4]_ _num[4]_ _den[4]_ _mag[4]_ _l[4]_ _u[4]_ _s[2]_ _t[2]_
                        Begin postamble.  The parameters are:

                        _p_     Pointer to final bop.

                        _num,_ _den,_ _mag_
                              Duplicates of values in preamble.

                        _l_     Height-plus-depth of tallest page, in DVI units.

                        _u_     Width of widest page, in DVI units.

                        _s_     Maximum stack depth needed to process this DVI file.

                        _t_     Total number of pages (_bop_ commands) present.

       _249_ _post_post_  _q[4]_ _i[1]_ _223_ _..._ _223_
                        End postamble.  The parameters are:

                        _q_     Byte offset from the beginning of the DVI file  to  the  _post_  command
                              that started the postamble.

                        _i_     DVI format ID, as in the preamble.

                        _223_   At least four _223_ bytes.

       _250_              Undefined.

       _..._

       _255_              Undefined.

## DTL COMMAND DESCRIPTION
       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 sec‐
       tion.

       variety <variety-name>
                            This command specifies the name of the DTL file type; it has no DVI file
                            equivalent.

       _(text)_               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).

       _\XY_                  Set_char for character with hexadecimal code XY, not in parentheses, but
                            by itself for readability.

       _s1,_ _s2,_ _s2,_ _s3_       Set, with (1,2,3,4)-byte charcodes.

       _sr_                   _set_rule_.

       _p1,_ _p2,_ _p2,_ _p3_       Put, with (1,2,3,4)-byte charcodes.

       _pr_                   _put_rule_.

       _nop_                  _nop_ (do nothing).

       _bop_                  _bop_ (beginning of page).

       _eop_                  _eop_ (end of page).

       _[_                    Push.

       _]_                    Pop.

       _r1,_ _r2,_ _r3,_ _r4_       Right, with (1,2,3,4)-byte argument.

       _w0,_ _w1,_ _w2,_ _w3,_ _w4_   As in DVI.

       _x0,_ _x1,_ _x2,_ _x3,_ _x4_   As in DVI.

       _d1,_ _d2,_ _d3,_ _d4_       Down, with (1,2,3,4)-byte argument.

       _y0,_ _y1,_ _y2,_ _y3,_ _y4_   As in DVI.

       _z0,_ _z1,_ _z2,_ _z3,_ _z4_   As in DVI.

       _fn_                   _fnt_num_ (set current font to font number in 0 to 63).

       _f1,_ _f2,_ _f3,_ _f4_       _fnt_ (set current font to (1,2,3,4)-byte font number).

       _special_              _xxx_ (special commands with (1,2,3,4)-byte string length).

       _fd_                   _fnt_def_ (assign a number to a named font).

       _pre_                  Preamble.

       _post_                 _post_ (begin postamble).

       _post_post_            _post_post_ (end postamble).

       _opcode_               Undefined DVI command (250 to 255).

## SAMPLE DTL FILE
       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.

## SEE ALSO
       [**dt2dv**(1)](https://www.chedong.com/phpMan.php/man/dt2dv/1/markdown), [**dvitype**(1)](https://www.chedong.com/phpMan.php/man/dvitype/1/markdown), [**tex**(1)](https://www.chedong.com/phpMan.php/man/tex/1/markdown).

## FILES
       _*.dvi_   binary TeX DVI file.

       _*.dtl_   text representation of a TeX DVI file in _DVI_ _Text_ _Language_ format.

## AUTHOR
       **dv2dt** and [**dt2dv**(1)](https://www.chedong.com/phpMan.php/man/dt2dv/1/markdown) were written by
              Geoffrey Tobin
              Department of Electronic Engineering
              La Trobe University
              Bundoora, Victoria 3083
              Australia
              Tel: +61 3 479 3736
              FAX: +61 3 479 3025
              Email: <<G.Tobin@ee.latrobe.edu.au>>

       These manual pages were primarily written by
              Nelson H. F. Beebe, Ph.D.
              Center for Scientific Computing
              Department of Mathematics
              University of Utah
              Salt Lake City, UT 84112
              Tel: +1 801 581 5254
              FAX: +1 801 581 4148
              Email: <<beebe@math.utah.edu>>



Version 0.6.0                               08 March 1995                                   [DV2DT(1)](https://www.chedong.com/phpMan.php/man/DV2DT/1/markdown)
