]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/dtl/README
* Enable man2ps to work without hard-coding the locations of groff or dpost.
[lyx.git] / development / Win32 / packaging / dtl / README
1 README for DTL package - Thu 9 March 1995
2 -----------------------------------------
3 Author: Geoffrey Tobin <G.Tobin@ee.latrobe.edu.au>
4 Version: 0.6.1
5 CTAN Archive-path: dviware/dtl
6 Brief Description:
7  DTL (DVI Text Language) files are equivalent to TeX's DVI files,
8  but are humanly readable, instead of binary.  Two programs are
9  provided to translate between DVI and DTL:  dv2dt, dt2dv.
10  dt2dv warns if byte addresses or string lengths recorded in a DTL
11  file are incorrect, then overrides them.  This makes DTL files
12  editable.  It also allows quoted apostrophes (\') and quoted quotes
13  (\\) in strings.  The current DTL variety, sequences-6, separates
14  font paths into directory and font, which makes them freely editable.
15  In this release, DTL line numbers are correctly calculated, and three
16  memory leaks have been fixed.
17 Keywords: dvi, TeX
18 Includes:
19  Makefile  README  dt2dv.c  dtl.h  dv2dt.c
20  man2ps  dtl.doc  dvi.doc  dt2dv.man  dv2dt.man
21  hello.tex  example.tex  tripvdu.tex  edited.txt
22
23 Motivation:
24
25  When TeX has typeset a document, it writes its handiwork to a DVI
26 file, for DVI processing software (such as viewers, printer drivers,
27 dvidvi, and dvicopy) to read.
28
29 The file  dvi.doc  lists the DVI file commands, with their opcodes
30 (byte values), nominal command names, arguments, and meanings.  For a
31 detailed description of DVI file structure, see one of these:
32 1.  Donald E. Knuth's book _TeX: The Program_;
33 2.  The file tex.web, which contains source and documentation for TeX:
34         CTAN:  systems/knuth/tex/tex.web
35 3.  The source for Knuth's dvitype program:
36         CTAN:  systems/knuth/texware/dvitype.web
37 4.  Joachim Schrod's DVI drivers standard document, the relevant part
38     of which is at
39         CTAN:  dviware/driv-standard/level-0
40
41 Sometimes human beings are interested to see exactly what TeX has
42 produced, for example when viewing or printing of the DVI file gives
43 unexpected results.  However, a DVI file is a compact binary
44 representation, so we need software to display its contents.
45
46 Binary file editors, when available, can show the DVI bytes, but not
47 their meanings, except for the portions that represent embedded text.
48 In particular, the command names are not shown, and the command
49 boundaries are not respected.
50
51 By contrast, Knuth's dvitype program is designed as an example of a
52 DVI driver.  However, dvitype is inconvenient for studying the DVI
53 file alone, for the following reasons:
54 1.  Being a DVI driver, dvitype endeavors to read the TFM font metric
55 files referenced in the DVI file.  If a TFM file is absent, dvitype
56 quits with an error message.
57 2.  When it starts, it prompts the user interactively for each of a
58 series of options.
59 3.  Even the least verbose option gives masses of information that is
60 not contained in the DVI file, coming instead from a combination of
61 the data in the DVI file and TFM files.
62 4.  It does NOT show the DVI information in a way that accurately
63 reflects the structure of the DVI file.
64 5.  Its output, if redirected to a file, produces a very large file.
65 6.  There is no automated procedure for converting the output of
66 dvitype back to a DVI file, and doing it by hand is totally
67 unreasonable.
68
69 The first disadvantage is a killer if a TFM file is absent.
70 Disadvantages two to four make dvitype very inconvenient for studying
71 a DVI file.  The fifth problem makes dvitype's output tedious,
72 disk-hungry (so one deletes it almost immediately), and unsuitable for
73 file transfer.
74
75 The sixth disadvantage of dvitype is important to those people who are
76 interested in editing DVI files.  Since the DVI files refer explicitly
77 to their own internal byte addresses, it's very easy to mess up a DVI
78 file if one were to try to edit it directly, even apart from the problem
79 of how to recognise a command.
80
81 So an exact, concise, textual representation of a DVI file is needed,
82 but dvitype does not produce one.
83
84 Resolution:
85
86  Therefore, working from Joachim Schrod's description, I designed DTL
87 and its conversion programs dv2dt (DVI -> DTL) and dt2dv (DTL -> DVI),
88 which are provided as C sources:
89
90     dtl.h
91     dv2dt.c
92     dt2dv.c
93
94 Although I was motivated by the TFM <-> PL conversion provided by
95 Knuth's tftopl and pltotf programs, I deliberately designed DTL to be
96 a much more concise and literal translation than the `property list'
97 structure exemplified by PL.  The result is that a DTL file is
98 typically three times the size of its equivalent DVI file.  The
99 document  dtl.doc  lists the correspondence between the DTL command
100 names and the (nominal) DVI command names.
101
102 A clear advantage of an exact two-way conversion is that we can check
103 (and prove) whether the converters worked truly on a given DVI file.
104 The provided plain TeX files:
105     example.tex
106     tripvdu.tex
107 can be used to test whether the compiled programs are behaving
108 sensibly.  Whereas  example.tex  is a simple document that uses a
109 variety of plain TeX commands,  tripvdu.tex  provides a kind of
110 `trip test' for DVI processor programs.  Both documents are taken,
111 with permission, from Andrew K. Trevorrow's dvitovdu (alias dvi2vdu)
112 distribution (and are also part of the dvgt viewer distribution).
113
114 The  Makefile  might have to be edited for your site, as it assumes
115 gcc  for your C compiler.  Makefile compiles dv2dt and dt2dv, then
116 runs  tex  on example.tex and tripvdu.tex, and also converts the
117 resulting DVI files to DTL files, back to DVI files (with a change
118 of name), then back again to DTL files, so that the results can be
119 compared using a textual differencing program.  (Many computer systems
120 have such a program; on unix, as assumed by Makefile, this is named
121 `diff';  ms-dos has one named `comp'.)  This should produce a
122 zero-length  .dif  file for each document, proving that the two DTL
123 files are identical.
124
125 A keen tester might also use a binary difference program on the DVI
126 files, to check that they are identical, as they need to be.  (On unix
127 systems, the `diff' program suffices for that purpose.)
128
129 Note:
130
131  In representing numeric quantities, I have mainly opted to use
132 decimal notation, as this is how most of us are trained to think.
133 However, for the checksums in the `fd' (font definition) commands, I
134 chose octal notation, as this is used for checksums in Knuth's PL
135 files, against which DVI files must be compared when a DVI driver
136 loads a font.
137
138 Caveat:
139
140 The length of DTL commands is limited by the size of the line buffer
141 in dt2dv.c.
142
143 End of README