


DV2DT(1)                                                 DV2DT(1)


NNAAMMEE
       dv2dt  -  convert a binary TeX DVI file to DTL text repre-
       sentation

SSYYNNOOPPSSIISS
       ddvv22ddtt _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.

DDEESSCCRRIIPPTTIIOONN
       ddvv22ddtt  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
       ddtt22ddvv(1) utility can convert the DTL file back to a binary
       DVI file.

DDVVII CCOOMMMMAANNDD DDEESSCCRRIIPPTTIIOONN
       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 ddvviittyyppee(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.

DDTTLL CCOOMMMMAANNDD DDEESSCCRRIIPPTTIIOONN
       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).

SSAAMMPPLLEE DDTTLL FFIILLEE
       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.

SSEEEE AALLSSOO
       ddtt22ddvv(1), ddvviittyyppee(1), tteexx(1).

FFIILLEESS
       _*_._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.

AAUUTTHHOORR
       ddvv22ddtt and ddtt22ddvv(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


