Previous Next Contents

4. 4. Using teTeX.

Theoretically, at least, everything is installed correctly and is ready to run. TeTeX is a very large software package. As with any complex software, you'll want to start by learning teTeX slowly, instead of being overwhelmed by its complexity.

At the same time, the software should do something useful. So instead of watching TeX typeset

``Hello, World!''

as Professor Knuth suggests in the TeXBook, we'll produce a couple of teTeX's own documents in order to test it.

You should be logged in as root the first few times you run teTeX. If you aren't, metafont may not be able to create the necessary directories for its fonts. The texconfig program includes an option to make the font directories world-writable, but if you're working on a multiuser system, security considerations may make this option impractical or undesirable.

In either instance, if you don't have the appropriate permissions to write to the directories where the fonts are stored, metafont will complain loudly because it can't make the directories, and you won't see any output because you will have a bunch of zero-length font characters. This is no problem. Simply log out, re-login as root, and repeat the offending operation.

Of course, it doesn't mention this in teTeX's manual. But the nice thing about teTeX is that, if you blow it, no real harm is done. It's not like a compiler, where, say, you will trash the root partition if a pointer goes astray. What, you haven't read the teTeX manual yet? Of course you haven't! It's still in the distribution, in source code form, waiting to be output!

So, without further delay, you will want to read the teTeX manual. It's located in the directory

/usr/lib/teTeX/texmf/doc/tetex.

The LaTeX source for the manual is called TETEXDOC.tex. (The .tex extension is used for both TeX and LaTeX files. Some editors, like Emacs, can tell the difference.) There is also a file TETEXDOC.dvi included with the distribution, which you might want to keep in a safe place -- say, another directory -- in case you want to test your DVI drivers later. With that out of the way, type


latex TETEXDOC.tex

LaTeX will print several warnings. The first,
LaTeX Warning: Label(s) may have changed. Rerun to get the
cross-references right.
is a standard procedure for building a document's Table of Contents. So, repeat the command. The other warnings can be safely ignored. They simply are warning you that some of the FTP paths mentioned in the documentation are too wide for their alloted spaces. (If you're really inquisitive, look at one of the TeX references for a discussion of \hbox and \vbox.)

TeTeX will have generated several files from TETEXDOC.tex. The one we're interested in is TETEXDOC.dvi. This is the device-independent output that you can send either to the screen or the printer. If you're running teTeX under the X Windows System, you can preview the document with xdvi. You can also preview the file on a character-based display with dvi2tty, dvi2svga, or ghostscript. Both dvi2tty and dvi2svga need to be compiled first, though, and ghostscript also may need to be re-compiled depending on the version of svgalib installed on your system.

Of course, you can send the output to the printer without previewing it first. The teTeX distribution comes with DVI drivers for the following printers: HP Laserjets and printers which support PCL, the HP Deskjet (and Officejet) family, and to a file, using dvitype. The man(1) pages can provide you with details.

If your printer is not covered by teTeX's standard dviware, you have several options: you can convert the file to PostScript using dvips and print it either with a PostScript printer or ghostscript. (See below.) There is also a complete library of DVI drivers available via anonymous FTP at

ftp://ftp.math.utah.edu/pub/tex/dvi
The former option is more flexible, the latter is easier. For the present, let's assume that you have a HP Laserjet II. You would give the command
dvilj2 TETEXDOC.dvi 
which will write a PCL output file of TETEXDOC.dvi, including soft fonts which will be down loaded to the Laserjet. This is NOT a feature of TeX or LaTeX, but a feature provided by dvilj2. Other DVI drivers provide features which are relevant to the devices they support. Dvilj2 will fill the font requests which were made in the original LaTeX document with the the closest equivalents available on the system. In the case of a plain-text document like TETEXDOC.tex there isn't much difficulty. All of the fonts requested by TETEXDOC.tex will be generated by metafont, which is automatically invoked by dvilj2 and generates the fonts if they aren't already present. (If you're running dvilj2 for the first time, it needs to generate all of the fonts, which could take up to several days if you're using a slow machine.) There are several options which control font generation via dvilj4; they're outlined in the man page. At this point, you shouldn't need to do any direct operation of metafont. If you do, then something has gone awry with your installation. All of the DVI drivers will invoke metafont directly via the kpathsea path-searching library -- also beyond the scope of this document -- and you don't need to do any more work with metafont for the present -- all the metafont sources for the Computer Modern font library are provided.

You can simply dump TETEXDOC.lj to the printer now, via the command


cat TETEXDOC.lj >/dev/lp0

if your printer is connected to /dev/lp0 or wherever your printer is connected. The idea is that you simply dump the file to the appropriate device. If your system has a lpd printer daemon, the command
lpr TETEXDOC.lj

should spool the output to the printer. You may need a magicfilter (tm?) that understands PCL. Again, look at the Printing-HOWTO for details.

The nine-page teTeX Users Manual provides some useful information for further configuring your system, some of which I have mentioned, much that this document doesn't cover.

Some of the information in the next section I haven't been able to test, because I have a non-PostScript HP Deskjet 400 color inkjet printer connected to Chanel3's parallel port. However, not owning a PostScript printer is no barrier to printing text and graphics from your text documents.


Previous Next Contents