


DV2DT(1)                                                 DV2DT(1)


NNAAMMEE
       dv2dt  -  convert a binary TeX DVI file to DTL text repre-
       sentation

SSYYNNOOPPSSIISS
       ddvv22ddtt _i_n_p_u_t_-_D_V_I_-_f_i_l_e _o_u_t_p_u_t_-_D_T_L_-_f_i_l_e

       If the filenames are omitted, then _s_t_d_i_n  and  _s_t_d_o_u_t  are
       assumed.

DDEESSCCRRIIPPTTIIOONN
       ddvv22ddtt  converts  a binary TeX DVI file to an editable text
       file in DTL (_D_V_I _T_e_x_t  _L_a_n_g_u_a_g_e)  format.   The  companion
       ddtt22ddvv(1) utility can convert the DTL file back to a binary
       DVI file.

DDVVII CCOOMMMMAANNDD DDEESSCCRRIIPPTTIIOONN
       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,
       _T_e_X_:   _T_h_e   _P_r_o_g_r_a_m,    Addison-Wesley    (1986),    ISBN
       0-201-13437-3,  as well as in the ddvviittyyppee(1) literate pro-
       gram 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  sym-
       bolic  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 manufac-
       tured today, including all personal computers and worksta-
       tions.

       _0 _s_e_t___c_h_a_r___0     Set character 0 from current font.

       _._._.

       _1_2_7 _s_e_t___c_h_a_r___1_2_7 Set character 127 from current font.

       _1_2_8 _s_e_t_1  _c_[_1_]   Set  1-byte  unsigned  character  (uchar)
                        number _c.

       _1_2_9 _s_e_t_2  _c_[_2_]   Set 2-byte uchar number _c.

       _1_3_0 _s_e_t_3  _c_[_3_]   Set 3-byte uchar number _c.

       _1_3_1 _s_e_t_4  _c_[_+_4_]  Set 4-byte signed character (schar)  num-
                        ber _c.




Version 0.6.0             08 March 1995                         1





DV2DT(1)                                                 DV2DT(1)


       _1_3_2 _s_e_t___r_u_l_e  _a_[_+_4_]  _b_[_+_4_]
                        Set rule, height _a, width _b.

       _1_3_3 _p_u_t_1  _c_[_1_]   Put 1-byte uchar _c.

       _1_3_4 _p_u_t_2  _c_[_2_]   Put 2-byte uchar _c.

       _1_3_5 _p_u_t_3  _c_[_3_]   Put 3-byte uchar _c.

       _1_3_6 _p_u_t_4  _c_[_+_4_]  Put 4-byte schar _c.

       _1_3_7 _p_u_t___r_u_l_e  _a_[_+_4_]  _b_[_+_4_]
                        Put rule, height _a, width _b.

       _1_3_8 _n_o_p          Do nothing.

       _1_3_9 _b_o_p  _c_0_[_+_4_]  _._._.  _c_9_[_+_4_]  _p_[_+_4_]
                        Beginning  of  page.   The  parameters _c_0
                        _._._.  _c_9 are the TeX  page  counters,  the
                        contents  of  TeX count registers _\_c_o_u_n_t_0
                        _._._.  _\_c_o_u_n_t_9.  The  parameter  _p  is  the
                        byte offset from the beginning of the DVI
                        file of the previous _b_o_p  operation  code
                        byte.  The first such command in the file
                        has _p _= _-_1.

       _1_4_0 _e_o_p          End of page.

       _1_4_1 _p_u_s_h         Push (_h_,_v_,_w_,_x_,_y_,_z) onto stack.

       _1_4_2 _p_o_p          Pop (_h_,_v_,_w_,_x_,_y_,_z) from stack.

       _1_4_3 _r_i_g_h_t_1  _b_[_+_1_]
                        Move right _b units.

       _1_4_4 _r_i_g_h_t_2  _b_[_+_2_]
                        Move right _b units.

       _1_4_5 _r_i_g_h_t_3  _b_[_+_3_]
                        Move right _b units.

       _1_4_6 _r_i_g_h_t_4  _b_[_+_4_]
                        Move right _b units.

       _1_4_7 _w_0           Move right _w units.

       _1_4_8 _w_1  _b_[_+_1_]    Move right _b units, and set _w _= _b.

       _1_4_9 _w_2  _b_[_+_2_]    Move right _b units, and set _w _= _b.

       _1_5_0 _w_3  _b_[_+_3_]    Move right _b units, and set _w _= _b.

       _1_5_1 _w_4  _b_[_+_4_]    Move right _b units, and set _w _= _b.




Version 0.6.0             08 March 1995                         2





DV2DT(1)                                                 DV2DT(1)


       _1_5_2 _x_0           Move right _x units.

       _1_5_3 _x_1  _b_[_+_1_]    Move right _b units, and set _x _= _b.

       _1_5_4 _x_2  _b_[_+_2_]    Move right _b units, and set _x _= _b.

       _1_5_5 _x_3  _b_[_+_3_]    Move right _b units, and set _x _= _b.

       _1_5_6 _x_4  _b_[_+_4_]    Move right _b units, and set _x _= _b.

       _1_5_7 _d_o_w_n_1  _a_[_+_1_] Move down _a units.

       _1_5_8 _d_o_w_n_2  _a_[_+_2_] Move down _a units.

       _1_5_9 _d_o_w_n_3  _a_[_+_3_] Move down _a units.

       _1_6_0 _d_o_w_n_4  _a_[_+_4_] Move down _a units.

       _1_6_1 _y_0           Move right _y units.

       _1_6_2 _y_1  _a_[_+_1_]    Move right _a units, and set _y _= _a.

       _1_6_3 _y_2  _a_[_+_2_]    Move right _a units, and set _y _= _a.

       _1_6_4 _y_3  _a_[_+_3_]    Move right _a units, and set _y _= _a.

       _1_6_5 _y_4  _a_[_+_4_]    Move right _a units, and set _y _= _a.

       _1_6_6 _z_0           Move right _z units.

       _1_6_7 _z_1  _a_[_+_1_]    Move right _a units, and set _z _= _a.

       _1_6_8 _z_2  _a_[_+_2_]    Move right _a units, and set _z _= _a.

       _1_6_9 _z_3  _a_[_+_3_]    Move right _a units, and set _z _= _a.

       _1_7_0 _z_4  _a_[_+_4_]    Move right _a units, and set _z _= _a.

       _1_7_1 _f_n_t___n_u_m___0    Set current font number _(_f_) _= _0.

       _._._.

       _2_3_4 _f_n_t___n_u_m___6_3   Set _f _= _6_3.

       _2_3_5 _f_n_t_1  _k_[_1_]   Set _f _= _k.

       _2_3_6 _f_n_t_2  _k_[_2_]   Set _f _= _k.

       _2_3_7 _f_n_t_3  _k_[_3_]   Set _f _= _k.

       _2_3_8 _f_n_t_4  _k_[_+_4_]  Set _f _= _k.

       _2_3_9 _x_x_x_1  _k_[_1_]  _x_[_k_]
                        Special string _x with _k bytes.



Version 0.6.0             08 March 1995                         3





DV2DT(1)                                                 DV2DT(1)


       _2_4_0 _x_x_x_2  _k_[_2_]  _x_[_k_]
                        Special string _x with _k bytes.

       _2_4_1 _x_x_x_3  _k_[_3_]  _x_[_k_]
                        Special string _x with _k bytes.

       _2_4_2 _x_x_x_4  _k_[_4_]  _x_[_k_]
                        Special string _x with (unsigned) _k bytes.

       _2_4_3 _f_n_t___d_e_f_1  _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).

       _2_4_4 _f_n_t___d_e_f_2  _k_[_2_] _c_[_4_] _s_[_4_] _d_[_4_] _a_[_1_] _l_[_1_] _n_[_a_+_l_]
                        Define font _k.

       _2_4_5 _f_n_t___d_e_f_3  _k_[_3_] _c_[_4_] _s_[_4_] _d_[_4_] _a_[_1_] _l_[_1_] _n_[_a_+_l_]
                        Define font _k.

       _2_4_6 _f_n_t___d_e_f_4  _k_[_+_4_] _c_[_4_] _s_[_4_] _d_[_4_] _a_[_1_] _l_[_1_] _n_[_a_+_l_]
                        Define font _k.

       _2_4_7 _p_r_e  _i_[_1_]  _n_u_m_[_4_]  _d_e_n_[_4_]  _m_a_g_[_4_]  _k_[_1_]  _x_[_k_]
                        Begin preamble.  The parameters are:

                        _i     DVI format.  Standard TeX has _I_D  _=
                              _2, and TeX-XeT has _I_D _= _3.

                        _n_u_m   Numerator of 100 nm / DVI unit.

                        _d_e_n   Denominator of 100 nm / DVI unit.

                        _m_a_g   1000 * magnification.

                        _k     Comment length.

                        _x     Comment string.

       _2_4_8 _p_o_s_t  _p_[_4_] _n_u_m_[_4_] _d_e_n_[_4_] _m_a_g_[_4_] _l_[_4_] _u_[_4_] _s_[_2_] _t_[_2_]
                        Begin postamble.  The parameters are:

                        _p     Pointer to final bop.




Version 0.6.0             08 March 1995                         4





DV2DT(1)                                                 DV2DT(1)


                        _n_u_m_, _d_e_n_, _m_a_g
                              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 pro-
                              cess this DVI file.

                        _t     Total number  of  pages  (_b_o_p  com-
                              mands) present.

       _2_4_9 _p_o_s_t___p_o_s_t  _q_[_4_] _i_[_1_] _2_2_3 _._._. _2_2_3
                        End postamble.  The parameters are:

                        _q     Byte  offset  from the beginning of
                              the DVI file to  the  _p_o_s_t  command
                              that started the postamble.

                        _i     DVI  format ID, as in the preamble.

                        _2_2_3   At least four _2_2_3 bytes.

       _2_5_0              Undefined.

       _._._.

       _2_5_5              Undefined.

DDTTLL CCOOMMMMAANNDD DDEESSCCRRIIPPTTIIOONN
       A DTL file contains one line per command, with a limit  of
       1024  characters  per  line.  Each command contains a sym-
       bolic 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.

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

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




Version 0.6.0             08 March 1995                         5





DV2DT(1)                                                 DV2DT(1)


       _\_"                   Literal ASCII double quote in (text).

       _\_X_Y                  Set_char for character with hexadeci-
                            mal  code XY, not in parentheses, but
                            by itself for readability.

       _s_1_, _s_2_, _s_2_, _s_3       Set, with (1,2,3,4)-byte charcodes.

       _s_r                   _s_e_t___r_u_l_e.

       _p_1_, _p_2_, _p_2_, _p_3       Put, with (1,2,3,4)-byte charcodes.

       _p_r                   _p_u_t___r_u_l_e.

       _n_o_p                  _n_o_p (do nothing).

       _b_o_p                  _b_o_p (beginning of page).

       _e_o_p                  _e_o_p (end of page).

       _[                    Push.

       _]                    Pop.

       _r_1_, _r_2_, _r_3_, _r_4       Right, with (1,2,3,4)-byte  argument.

       _w_0_, _w_1_, _w_2_, _w_3_, _w_4   As in DVI.

       _x_0_, _x_1_, _x_2_, _x_3_, _x_4   As in DVI.

       _d_1_, _d_2_, _d_3_, _d_4       Down, with (1,2,3,4)-byte argument.

       _y_0_, _y_1_, _y_2_, _y_3_, _y_4   As in DVI.

       _z_0_, _z_1_, _z_2_, _z_3_, _z_4   As in DVI.

       _f_n                   _f_n_t___n_u_m  (set  current  font  to font
                            number in 0 to 63).

       _f_1_, _f_2_, _f_3_, _f_4       _f_n_t    (set    current    font     to
                            (1,2,3,4)-byte font number).

       _s_p_e_c_i_a_l              _x_x_x     (special     commands    with
                            (1,2,3,4)-byte string length).

       _f_d                   _f_n_t___d_e_f (assign a number to  a  named
                            font).

       _p_r_e                  Preamble.

       _p_o_s_t                 _p_o_s_t (begin postamble).

       _p_o_s_t___p_o_s_t            _p_o_s_t___p_o_s_t (end postamble).




Version 0.6.0             08 March 1995                         6





DV2DT(1)                                                 DV2DT(1)


       _o_p_c_o_d_e               Undefined DVI command (250 to 255).

SSAAMMPPLLEE DDTTLL FFIILLEE
       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.

SSEEEE AALLSSOO
       ddtt22ddvv(1), ddvviittyyppee(1), tteexx(1).

FFIILLEESS
       _*_._d_v_i   binary TeX DVI file.

       _*_._d_t_l   text  representation of a TeX DVI file in _D_V_I _T_e_x_t
               _L_a_n_g_u_a_g_e format.

AAUUTTHHOORR
       ddvv22ddtt and ddtt22ddvv(1) were written by
              Geoffrey Tobin
              Department of Electronic Engineering
              La Trobe University
              Bundoora, Victoria 3083



Version 0.6.0             08 March 1995                         7





DV2DT(1)                                                 DV2DT(1)


              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                         8


