Rutgers, The State University of New Jersey

Generating PDF files from TeX  

NSF is now requiring PDF files for grant submissions. Science many scientific departments do all documentation preparation using TeX, it has now become important to know how to produce PDF files from TeX.

Unfortunately there is no perfect alternative, and the best current alternative requires you to spend money.

There are a number of problems:

The only alternatives that give proper output involve using Type 1 fonts. To install Type 1 fonts for use by dvips, see /rutgers/ref/ru-dist/tex-type1. Look at README in that directory.

Once you've installed them, you have your choice of three approaches to generate the PDF file.

I would encourage people to experiment with pdftex. However it appears to me that the only safe approach at the moment is to use the following set of tools:

This means that departments that want to produce .PDF files will need access to the Distiller. There is a copy on RCI. Thus you can move your files to RCI for conversion if you don't want to buy your own copy.

Use of Distiller

If you're not careful a subtle problem can occur: the individual documents look OK, but when NSF puts them together, the resulting PDF file is scrambled in some contexts.

To prevent this, invoke distiller with the following options:

distill -embedallfonts on -subsetfonts on -maxsubsetpct 100 FILENAME

Here's what this does:

-embedallfonts says to include all fonts used in the document (except the standard 13). You'd think this would be the default.

-subsetfonts says to include only the individual characters used, not the whole font.

-maxsubsetpct 100 says to subset all the time. By default, if more than a certain percent of the font is used, it will include the whole font. With this setting, it will always use the subset mechanism. (The manual says that the maximum value for this is 99, by the way.)

I think the default is probably embed, subset, and maxpercent something less than 100. So by turning up maxpercent to 100, you force all fonts to be subsetted, thus saving some space.

I believe the subset mechanism works differently than the full font mechanism. I suspect this is a bug workaround, forcing the the subset mechanism to be used all the time

Note that you can set default parameters for distiller, in the Startup directory. (Users can also have their own defaults.) The online distiller manual will explain this. I recommend setting these parameters to be the defaults.

I just installed Type 1 fonts: Why doesn't ghostscript show page numbers anymore?

After installing Type 1 fonts, one user observed that his documents no longer showed page numbers in Ghostview. The explanation is sort of interesting:

dvips tries to model the memory in the printer. If it thinks the document is too big, it breaks it up into sections.

If the document uses sections, it inserts a comment of the form

     %DVIPSSectionPage: 1
before every page. If the document does not use sections, it inserts a comment of the form
     %%Page: 1 1
before every page. The %%Page: comment is a standard EPS convention, which ghostview understands. The %DVIPSSectionPage: is not. Thus you won't see any pages in Ghostview if dvips breaks your document into sections.

It is reasonable to suggest that this is a bug.

Now, there are four ways to "solve" this (other than modifying dvips):

My suggestion is that you look again at your config.* files, and increase memory to more reasonable values.


For more information, contact
Last updated: Tuesday, 29-Jun-1999 16:37:37 EDT
© 1999 Rutgers, The State University of New Jersey. All rights reserved.