|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T d
Length: 9197 (0x23ed) Types: TextFile Names: »dvi.tex«
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦af5ba6c8e⟧ »unix3.0/DVIWARE.tar.Z« └─⟦ca79c7339⟧ └─⟦this⟧ »DVIware/laser-setters/mctex/doc/dvi.tex«
\subsection{DVI File Structure} A \dvi\ (`DeVice Independent') file contains a stream of special codes that instruct conversion programs in the art of building output pages. Most of these details are irrelevant to anyone else, but a few are especially important. A \dvi\ file has three major sections. It starts with a {\em preamble\/} listing particular constants used in the file. After this comes the main body, as a series of separate pages. Finally, there is the {\em postamble}, which summarises things about the file overall. Many \dvi\ file readers look first at the postamble, since it has most of what they need to know. If you hand a plain file to a \dvi\ reader, it should complain about a missing postamble or missing preamble. \subsubsection{Magnifications}\label{sec:dvimag} Each \dvi\ file begins with a {\em magnification}, set with the \TeX\ primitive \verb|\magnification|. Given a magnification factor $m$, the document will be printed at $m/1000$ times normal size. Thus, values larger than 1000 cause the document to expand; values smaller than this make it shrink, and the default value is of course 1000. This is sometimes useful for obtaining extra resolution. For instance, if you have a copier that reduces to 77\% original size, a magnification of $1000/.77$, or 1299, would produce output that, when shrunk, would appear normal size. (Note that this magnification applies to {\em all\/} the dimensions in the \dvi\ file, and is not like \LaTeX's \verb|\documentstyle| options for 11 or 12 point output.) Most \dvi\ drivers allow a second magnification to be applied in addition to that in the \dvi\ file. For instance, by applying another magnification of 770, you could make a document with a \verb|\magnification| of 1299 appear at normal size ($1.299 \cdot 0.77 \approx 1.0$). \subsubsection{Fonts} After the \verb|\magnification|, a \dvi\ file lists the {\em fonts\/} it needs. A font is a collection of {\em glyphs\/} (character shapes) along with details about how to print them on paper (or on a video screen). \TeX\ fonts come in several varieties, but the ones you are likely to encounter are called `\gf' and `\pk' fonts. GF and PK fonts are directly interconvertible and can usually be regarded as identical. These examples will use \pk\ fonts. Fonts, too, come in various magnifications. The standard set of magnifications is: none (unmagnified), \verb|\magstephalf| (1.095 times normal size), \verb|\magstep1| (1.2 times normal size), \verb|\magstep2| (1.44 times normal size), and so on, up through \verb|\magstep6| (2.986 times normal size). Each \verb|\magstep| is 1.2 times bigger than the previous one. What this means to you is that your system must have each font in eight different sizes for you to use any font at any standard magnification. Most systems do not have every font in every size. When you come across one that is not in the size you want---for instance, were you to ask for \verb|cmssqi8 scaled \magstep3|, it would probably not be there---you may get an error like this: \begin{quote} \begin{verbatim} Warning: no font for cmssqi8 scaled 1728 (wanted, e.g., /usr/local/lib/tex/fonts/cmssqi8/cmssqi8.518pk) \end{verbatim} \end{quote} If this happens, the \dvi\ driver may quit\footnote {In this case the word {\tt warning} will be omitted.} (possibly after noting other missing fonts) and leave you to solve the problem yourself. You can often do this by choosing some other font in your \TeX\ file, or you may be able to get a local guru to generate the font in your size. You can also substitute a font that is nowhere near the right size by creating a file---typically a link or a symbolic link---with the appropriate name (here {\tt cmssqi8.518pk}), either in your own directory or in the system font directory. The output will, however, tend to look bad. On the other hand, the \dvi\ driver may add this admonishment: \begin{quote} \begin{verbatim} I will substitute boxes for the missing glyphs \end{verbatim} \end{quote} In this case, you will get little square boxes like those in Chapter~11 of {\em The \TeX book\/}---or, if the message said {\tt white space} instead of {\tt boxes}, just blank space---instead of glyphs from your font. (Which you get is up to the person who does the installation. For all the gory details, including how \verb|\magstep3| translates to {\tt .518pk}, see \S\ref{sec:fontdesc} on p.~\pageref{sec:fontdesc}.) \subsubsection{Count Registers}\label{sec:dvicount} Each individual \dvi\ page is marked with ten counters, known as \ccount0 through \ccount9. These are the numbers \TeX\ prints in square brackets when it formats your document. Normally, \ccount0 holds the page number and the rest of the counters are not set (are zero). The \dviselect\ program described in \S\ref{sec:dviselect} on p.~\pageref{sec:dviselect} makes use of these counters. You can make \LaTeX\ put the current chapter number of a book or report into \ccount1 by adding the magic invocation \begin{quote} \begin{verbatim} \makeatletter \countdef\c@chapter=1 \makeatother \end{verbatim} \end{quote} between your \verb|\documentstyle| declaration and your \verb|\begin{document}| command.\footnote {Such tricks for use with \dviselect\ should be agreed-upon and put into standard \LaTeX\ style files, where the {\tt\string\makeatletter} and {\tt\string\makeatother} invocations would be unnecessary (and in fact, would be wrong). As of yet, this has not happened.} \subsubsection{Drift}\label{sec:drift} \TeX\ imagines that it can put any character anywhere on a page, with a resolution of less than one millionth of an inch, which is more precise than anyone could measure. Real printers and displays cannot do this. To make the output look right, \dvi\ drivers are required to follow information kept in each font as to where to put characters, and this sometimes disagrees with where \TeX\ put the characters. Normally, the disagreement is negligible. In some peculiar cases, however, it can build up, and the characters would `drift away' from where they should be. Because of this, the disagreement is always limited to a small number of pixels (individual dots on the printer or screen). This limit is called the {\em maximum drift}, often abbreviated to {\em maxdrift}. The average low-resolution (300 dot per inch) printer driver will limit the drift to three pixels, or $1/100$ of an inch. This can sometimes be changed on the command line. Normally you will never notice, or care. \subsubsection{Margins} \TeX\ documents are supposed to be printed with a one inch top margin and a one inch left margin.\footnote {Yes, there really {\em is\/} a standard for \dvi\ converters, and it really {\em does\/} say this, despite international standards and the metric system.} That is, the \dvi\ coordinate $(0,0)$ is supposed to correspond to the position one inch away from the top left corner of the page, measured horizontally and vertically. \TeX\ and \LaTeX\ may add more margin space on top of this, but this amount is built into each \dvi\ driver. Most of these programs have options to override or adjust the amount of margin. Typically you will need this only if you are printing on special paper. Be aware, though, that some laser printers move the $(0,0)$ point away from the corner of the page to try to hide the fact that they cannot print along the edges, and you (or the system administrator, during installation) may have to compensate for this. Incidentally, many `300 dot per inch' laser printers are not exactly 300 dots per inch; a typical low-cost printer might have 297 dots per inch in one direction, and 302 dots per inch in the other. Not only does this vary from one printer to the next, it may also vary on the same printer due to changes in temperature, humidity, and the like. You may be able to tweak a printer into alignment if you really expect perfection, but it probably will not stay perfect for long.\footnote {For real precision, you need something with more resolution anyway. At the time of this writing, the University of Maryland charged \$2 per foot for printing on a Mergenthaler 1000-line-per-inch phototypesetter, while laser printer output cost about \$.15 per page, and previewing was free. Those typesetting books were advised to preview and to use laser printers until they were sure that the book was in its final form.} \subsubsection{Specials and Graphics} \TeX\ can be told to pass arbitrary strings on to the \dvi\ reader. The construct \verb|\special{hello}|, for instance, passes the string {\tt hello}. It is up to the \dvi\ conversion program to make sense out of these strings. Unfortunately, there is no standard for meanings or even for formats of \verb|\special|s, and the result has been chaos. Each attempt to set some standard has foundered, and it seems unlikely that the situation will improve soon. What this really means is that any \verb|\special|s you use may well tie you to a particular kind of printer. You may not be able to preview their effects. Nonetheless, there is no substitute for real graphics of the sort available only with \verb|\special|. Just be aware that your pictures will not be as portable as the rest of your text.