Previous Next Contents

Chapter 6:   Specials

As not every publishing feature is built-in to TeX, the creator of TeX, Donald E. Knuth, made sure that a facility to insert ``hooks'' into a dvi file was available. These hooks are called specials and are invoked via the \special command. For example, if you put the command \special{Hello} in a TeX file, the resulting dvi file will contain a \special opcode with argument Hello. TeX postprocessors (such as dvi viewers or printer drivers) can then interpret the \special's and take the appropriate action.

One of the more common uses of the \special is to insert figure files into a TeX document. For example, the LATEX graphics package provides the \includegraphics command which will take as an argument the name of figure file and place a \special command in the dvi file listing the name of the file, its dimensions, and other information. Although TeX itself knows nothing about figure files, most dvi printer drivers (such as dvips) know how to interpret the \special information and will insert the figure.

You can tell dvii to go through a dvi file and list the location and contents of each \special. This can be useful, for instance, if you want to see on which page a particular figure appears without actually viewing or printing the file.

dvii -s test

s:[2/2]:: A short special
s:[3/3]:: abcdefghijklmnopqrstuvwxyzABCDE...
s:[4/4]:: PSfile 1.eps
s:[4/4]:: PSfile 2.eps
s:[4/4]:: PSfile 3.EPS
s:[4/4]:: PSfile dog1.gif
s:[4/4]:: PSfile cat.eps
s:[6/-3]:: Some control characters: []

Previous Next Contents