Skip to main content

Module dvi

Module dvi 

Source
Expand description

The DVI writer (TeX: The Program §583–§602, §617–§642), as LuaTeX uses it when \outputmode=0.

A DVI file is a preamble, one bop…eop sequence per page and a postamble that repeats the font definitions. The commands follow TeX82, with these differences observed in LuaTeX’s output:

  • movements are emitted lazily, just before the next character, rule or special, as right/down commands with the smallest length that TeX82’s movement would pick; the w, x, y, z registers are never used (TeX82’s §607–§615 optimization is absent);
  • rules are always set_rule, also in vertical lists, so the reader’s h moves by the rule width;
  • a box nested inside the page is bracketed by push/pop; a push immediately followed by its pop is removed (dvi_pop, §601);
  • characters and fonts use the shortest command for their number (set1…set4, fnt1…fnt4, fnt_def1…fnt_def4);
  • the preamble comment is " LuaTeX output YYYY.MM.DD:HHMM", from \year, \month, \day and \time at the first page.

The walker in crate::shipout computes positions with TeX’s rounding rules and calls this writer with absolute DVI coordinates (h to the right and v downwards from the DVI origin, \hoffset and \voffset included).

Structs§

DviWriter
The state of the DVI file being written.