Contents


What is TeX

TeX is occasionally called a document production system. TeX is really lower level than that. It is more of a typesetting system.

LaTeX is a system built upon TeX. LaTeX makes it easier to use, and more suitable for a document production system while retaining all of the typesetting abilities and cruft associated with TeX.

To use TeX, you create your document with your favorite text editor. Then you compile your document with TeX, LaTeX or some variant to produce a dvi file. You then postprocess this dvi file with dvips to PostScript and print the resulting PostScript.


Versions of TeX Available

There are two major releases of TeX in our facility. Which release you have available is dependent upon the type of machine you are using.

The Old TeX is stable. Some say it is dead. I agree. The Old Tex has minimal support. No new features will be added or incorporated into Old TeX.

Files produced using the old TeX back in 1987 will probably still produce the same results today.

The old TeX is the default release on Mach machines. If you have pmax_mach, or sun4_mach then the TeX you have by default is the old TeX.

The new TeX includes LaTeX 2.e, the New Font Selection Scheme (NFSS), in addition to LaTeX 2.09.

The new TeX is available as the alpha release on pmax_mach, sun4_mach, and i386_mach. The new TeX is also available on our vendor platforms of pmax_ul43a, sun4_413, hp700_ux90, alpha_osf1, and alpha_osf20. It is the default release on our vendor platforms.

If you are starting a new document, or if you have absolutely no experience with TeX, then you probably want to start with New TeX.


Differences Between Old and New

Occasionally as users migrate from the Old version of TeX to the new version of TeX they run into problems. Here are a few of the common problems that they encounter.

Please do not attempt to use dvi files produced with the old version of TeX as input to new TeX utilities. If you generated a dvi file on a mach machine a long time ago, the new version of dvips will quite possibly not work with on that old dvi file.

Search Paths

We can change where TeX and related programs search for the files that it needs by changing environment variables. In many cases the defaults are adequate and there is little reason to change them.

If you are moving from an old TeX environment to a new TeX environment, you might want to look at all of your environment variables with

printenv
and unsetenv any environment variables that reference TeX. The environment variables that worked with the old release of TeX probably wont work the new release of TeX.

The search paths are environment variables set to a list of directory specifiers seperated by ":". For example, the command

setenv TEXFONTS .:/foo/bar
would set the environment variable TEXFONTS to a search path of two directories. The first directory is ".", or the current directory and the second is "/foo/bar".

We can also specify subdirectories in an environment variable specification. For example,

setenv TEXFONTS .:/usr/bovik/lib/fonts//tfm
Sets the environment variable to look in two places. The first place is "." or the current directory. The second place is any and all subdirectories named "tfm" at least two levels below the directory "/usr/bovik/lib/fonts". That means that the directory "/usr/bovik/lib/fonts/euler/tfm" will be searched, but the directory "/usr/bovik/lib/fonts/tfm" will not be searched. If there are multiple subdirectories named "tfm", the order that they are searched is not defined.

If the environment variable begins with ":", ends with ":", or has "::" in the middle of it, the default search path is inserted at that point.

Therefore, if you wanted to append the directory /usr/bokik/lib/fonts to the TEXFONTS search path, you would execute the command

setenv TEXFONTS :/usr/bovik/lib/fonts

dvips Behaviour

The default for the new version of dvips is to spool to the printer, rather than dump to the stdout. For example, if the old way you generated PostScript output from dvips was

dvips file.dvi > file.ps
The new way is
dvips -o file.ps file.dvi
To spool the file with special lpr switches, for example -h for no header, and -P for a particular printer, the command would be
dvips -o "lpr -h -Pprintername" file.dvi

Where is pslatex

There is no "pstex" or "pslatex" in the new version of TeX.

The method that pstex and pslatex used PostScript fonts has fallen into disfavor. It was extremely limited in the way and the number of PostScript fonts that TeX could use. You may want to use one of the following styles of latex.

\documentstyle[palatino]{article}
\documentstyle[times]{article}
\documentstyle[bookman]{article}


amssymbols

The amssymbols.sty in the old version of TeX was hacked together. If before you used
amssymbols.sty
Please try using
\input amssym.def \input amssym
instead.


Old TeX Documentation

For information on Old TeX you can look in the guide Using LaTeX at CMU SCS.

You can also check online manual entries for


TeX Default Search Paths

The search paths are environment variables set to a list of directory specifiers seperated by ":". For example, the command
setenv TEXFONTS .:/foo/bar
would set the environment variable TEXFONTS to a search path of two directories. The first directory is ".", or the current directory and the second is "/foo/bar".

Old TeX Search Paths

The default values for the old version of TeX were:

New TeX Search Paths

The new TeX Search paths are implemented by a set of routines called KPATHSEA, written by Karl Berry. There is some documenation on KPATHSEA in

In the new TeX release we can specify subdirectories in a search path. For example,

setenv TEXFONTS .:/usr/bovik/lib/fonts//tfm
Sets the environment variable to look in two places. That means that the directory "/usr/bovik/lib/fonts/euler/tfm" will be searched, but the directory "/usr/bovik/lib/fonts/tfm" will not be searched. If there are multiple subdirectories named "tfm", the order that they are searched is not defined.

If the environment variable begins with ":", ends with ":", or has "::" in the middle of it, the default search path is inserted at that point.

Therefore, if you wanted to append the directory /usr/bokik/lib/fonts to the TEXFONTS search path, you would execute the command

setenv TEXFONTS :/usr/bovik/lib/fonts

The default search paths are:


LaTeX 2.09

This is the established version of LaTeX. It is well covered in Leslie Lamport's 1986 book titled LaTeX A Document Preparation System . Many existing documents are built to run through this system.

This version of LaTeX is available as either

But this version of LaTeX is being replaced. A group calling themselves the LaTeX 3 Project are working on a new release of LaTeX. They have fixed many of the problems with LaTeX 2.09 . Their current release is called LaTeX 2e .


AMSTeX and AMSLaTeX

The AMS TeX and LaTeX pacakages are a moderately useful. They were created by the American Mathematical Society.

Documentation


LaTeX 2e

This is the newest version of LaTeX available. It is currently being developed and bugged, so please be patient. Man of the same folks that worked on AMSTeX and AMSLaTeX are now working on LaTeX 2e. If you are starting a new document, I recommend this system.

The latest edition (2nd Edition) of Leslie Lamport's LaTeX book is based on this version. (ISBN 0-201-56889-6)

Base Documentation

LaTeX 2e Package Documentation


BibTeX

In latex, you make a databse of references in mybib.bib. then in your paper, paper.tex you put in \cite{ref1}, etc. these end up as entries in paper.aux.

In order to get a bibliography into the paper, you put in a magic command \bibliography{mybib} which also has the side effect of putting an entry into paper.aux that tells bibtex to look for refs in mybib.bib.

The bibtex program picks out the magic entries from paper.aux, looks them up in mybib.bib and spits out paper.bbl.

When run through latex, the same \bibliography command makes latex source in paper.bbl and hence the bibtex generated reference list.

So, to get this right from a clean start, you run latex, then bibtex, then latex *twice* to get the references correct.


xdvi

The xdvi program displays dvi files on an X display. By clicking on the various buttons, you can page forward and backward through the document.

The program xdvi doesn't really understand virtual fonts. PostScript fonts are a type of virtual font. The old version silently substitutes bitmap fonts for virtual fonts. The new version verbosely substitutes bitmap fonts for virtual fonts.

If you have an included PostScript file in your TeX document it will not be displayed by the xdvi utility.

The most complete documentation on xdvi (beside the sources) is the man page.


dvips

The program dvips converts dvi files into PostScript files. The old version of dvips produces the PostScript on stdout. The new version spools the PostScript to the program lpr.

Fonts and Resolutions

Your dvi file can either use bitmap fonts or virtual fonts. By default, TeX and LaTeX generate dvi files that use bitmap fonts. PostScript fonts are a type of virtual font.

Let's say you have used dvips to generate a PostScript file. And let's say that it uses bitmap fonts at 300dpi. When you print the file on a 600dpi printer, the characters will appear in the correct place and size, but the edges of the characters and the stems will not be as smooth and crisp as they could be if the file had been generated using 600dpi fonts.

Likewise, if you use dvips to generate a PostScript file that uses 600dpi fonts. Later you print it on a 300dpi printer. The characters and symbols will appear in the correct place and size, but the PostScript document will be larger than it needs to be.

There are several ways you can set the resolution.

The default is a 300dpi printer.

We could create configuration files for each of the over 100 printers in our facility. And I may do that someday. But the printer types and names keep changing. And we keep getting new ones in. But for now, there aren't configuration files for each individual printer.

Type 1 fonts

Usually, dvips uses the MetaFont bitmap version (pk or gf) fonts. Recently, a free version of the Computer Modern Type-1 formats have been released. Please consider using these fonts if you are going to compile the resulting PostScript file into PDF format.  To use Type 1 Computer Modern fonts instead of bitmap versions issue the following commands.
 
cd /the/source/directory/for/your/manuscript
cat /usr/local/lib/texmf/dvips/psfonts.map \
    /usr/local/lib/texmf/fonts/cmpsfont/mapfiles/psfonts.cmz > psfonts.map
If you've munged the environment variable DVIPSHEADERS, you'll have to put this newly created psfonts.map file in the path before /usr/local/lib/texmf/dvips/psfonts.map . The directory "." is already the first element in the path by default.

The program /usr/local/bin/ps2pdf has been known to have problems with these fonts.  Please consider using /usr/local/bin/distill (the adobe acrobat distiller) available on some of our supported platforms.  It appears to do a better job than ps2pdf.

Full Documentation


Why does epsfig no longer work?

If you previously had something like
\usepackage{epsfig}
Plese try using something like
\usepackage[dvips]{epsfig}

Somethings change. There are several different programs that convert dvi to PostScript. The epsfig package needs to know which program you are going to be using.


CMU Specific Features

I've included an Encapsulated version of the Carnegie Mellon wordmark in the TeX search path on vendor Unix machines. A wordmark is much like a trademark. Below are two examples of how you might use the Carnegie Mellon wordmark. While they aren't perfect, and while the TeX documents don't have the absolute perfect typography and design you might expect, they should give you a small idea on how to do some things. Copy these examples to a private area, and modify them as you deem necessary. After you have modified these files, compile them with latex2e (not latex209) and dvips.


For more help

For printed documentation available in the bookstore such as

For more information, you might also want to check For other questions or problems, send mail to help@cs.cmu.edu.

Introduction to the SCS Computing Facilities

SCS Facilities Staff Home Page