DVI file format |
DVI ( DeVice Independent ) is the output .
DVI is not a document encryption format, and TeX markup may be at least partially reverse-engineer from DVI files, although this process is unlikely to produce high-level constructs identical to those present in the original markup, especially if the original markup used high-level TeX extensions (e.g. LaTeX).
DVI differs from PostScript and PDF in that it does not support any form of font embedding. (Both PostScript and PDF formats can either embed their fonts inside the documents, or reference external ones.) For a DVI file to be printed or even properly previewed, the fonts it references must be already installed. Also, unlike PostScript, DVI is not a full, Turing-complete programming language, though it does use a limited sort of machine language.
=Specification=
The DVI format was designed to be compact and easily machine-readable. Toward this end, a DVI file is a sequence of commands which form a machine language , in Knuth s words. Each command begins with an eight-bit opcode, followed by zero or more bytes of parameters. For example, an opcode from the group 0x00 through 0x7F (decimal 127), set_char_ i , typesets a single character and moves the implicit cursor right by that character s width. In contrast, opcode 0xF7 (decimal 247), pre (the preamble, which must be the first opcode in the DVI file), takes at least fourteen bytes of parameters, plus an optional comment of up to 255 bytes.
In a broader sense, a DVI file consists of a preamble, one or more pages, and a postamble. Six state variables are maintained as a tuple of signed, 32-bit integers: (h,v,w,x,y,z). h and v are the current horizontal and vertical offsets from the upper-left corner (increasing v moves down the page), w and x hold horizontal space values, y and z , vertical. These variables can be pushed or popped from the stack.
Fonts are loaded from TeX font metric files. The fonts themselves are not embedded in the DVI file, only referenced. Each font, once loaded, is referenced by an internal index providing a compact format.
The DVI format also relies on the character encodings of the fonts it references, not on those of the system processing it. This means, for instance, that an EBCDIC-based system can process a DVI file that was generated by an ASCII-based system.
=References=
*[http://www.ctan.org/tex-archive/systems/knuth/texware/dvitype.web DVIType.web], a DVI parser written in WEB, which contains the full DVI format specification when extracted with WEAVE.
=External link=
*[http://www.math.umd.edu/~asnowden/comp-cont/dvi.html Description of the DVI file format] *[http://www.macrotex.net/dvii/ TeX DVI file Information utility]|
|