My First (Mistaken) Impression: PDF sucks
I have always been a LaTeX fan ever since I read
Leslie Lamport's excellent LaTeX2e book. Emphasizing logical structure rather than visual
formatting, it gives great power to the learned
user. Its professional
quality output is praised by scientific and
academic journals all over the world.
Well, LaTeX and the underlying TeX engine was
developed in the days when PostScript was prevalent. Although its standard output format
was DVI, LaTeX documents mostly come as PostScript because that is the most widely-accepted portable printer-friendly format then.
And then, along came PDF, the funky new format
published by Adobe. My initial experiences with PDF were less than
pleasant. Being a LaTeX fan, I
tried my hand at creating some PDF's of my LaTeX
documents. And guess what -- most of it doesn't
show up properly in earlier versions of Acrobat
Reader, sometimes it even crashes Acrobat Reader
-- and when it does show up correctly
(in later versions of Acrobat Reader),
the font looks smudged, blurred, pixelated, and
just plain unreadable. Furthermore, when I view
the original PostScript on GSView, it looks just
great.
So, my initial reaction was, oh well,
PDF can't handle LaTeX's superior formatting.
It sucks!
And so I thought, until one day, I read this page.
The Problem
The problem with converting LaTeX-produced PS into PDF, is that the usual program used to perform the initial conversion to PostScript, dvips, simply
calls METAFONT (LaTeX's font engine) to rasterize
your document's fonts at 300dpi, and then loads
the bitmapped results into the PS file.
This is known as a Type 3 font, which
will also get propagated into the PDF once you
convert the PostScript.
The
problem with Type 3 fonts is that Acrobat Reader
does not handle it in a sane way. Unlike
other utilities (like GSView, which apparently
does a good job at scaling bitmapped fonts),
Acrobat Reader was not designed to handle Type 3
fonts well, and it does a minimal, unreadable job
at scaling these 300dpi bitmapped fonts (and does
so at turtle-crawling speeds, too).
This may seem like PDF's fault, but it really
isn't. The real problem comes from dvips
embedding type 3 fonts in the PostScript. Type 3
fonts aren't particularly great either -- although 300dpi is good for printing on low-end
printers, high-end printers with 600dpi resolution won't show any difference with these
fonts, because the bitmaps are 300dpi. Type 1
fonts, however, are infinitely scalable fonts;
and there are type 1 fonts that you can
use with LaTeX!
The Solution
To create from a LaTeX document a PDF that
doesn't suck, what you need is to force dvips to embed Type 1 fonts in the PostScript,
and not use any type 3 fonts at all.
In order to do this, you need to make sure
that you have installed the Type 1 versions of
all the fonts that you used in your
document. Usually, if you don't mind using Times
or one of the other common fonts, all it takes
is to do something like \usepackage{times} which will cause LaTeX to typeset your
document in the Times font. Since there is only
a Type 1 version of Times, dvips will
always produce Type 1 fonts in the PostScript.
But, if you're like me, and you just must use the default Computer Modern font, you'll need to install the Type 1 version of the CM font. After you
install these fonts, you'll need to configure
dvips to not use Type 3 fonts. Here
are the instructions for doing this.
You may also want to consult the documentation
for your particular LaTeX distribution -- it may
have a slightly different mechanism for adding
new Type 1 fonts.
Now, run dvips again to produce a PostScript, convert it to PDF using Distiller
or any of the other PDF writing tools, and check
it out on Acrobat Reader. It should look great
now.
But... if you're like me (again), you've used some of
the more esoteric features of LaTeX, such as
diacritics, dotless i's and j's, etc.. If your
document uses these symbols, you may find that
your PDF still looks butt-ugly. That's
because these diacritics are from the EC
(European Common) font, and the Type 1 CM fonts
don't include these characters. What you need
at this point, is to google for
"cm-super" (or search for it on
CTAN).
cm-super is a Type 1 font that includes all the EC characters missing from the default type 1 CM fonts. Install this font, and configure
dvips accordingly.
Troubleshooting
If for some reason your PDF refuses to show
up with clear, readable fonts, go to the Info
menu in Acrobat Reader, and look up exactly what
fonts are being used by your PDF file. You may
find that there are still some Type 3 fonts in
there. If you're lucky, it may display the name
of the font, in which case you should search for
the Type 1 versions of the font and install it.
But sometimes, Acrobat Reader just uses a non-descript single- or double-letter designation for
the font, which is no help in identifying what it
is.
One way to find out what font it is, if your
distribution of LaTeX supports it, is to run
dvips -Ppdf. This will force dvips to not use any Type 3 fonts; if there are
any missing Type 1 fonts, it will try to invoke
METAFONT (mf on the command-line) with a very high magnification factor.
Most likely, METAFONT will get confused, and will
just print an error message and do nothing.
Examine the line that calls mf, and you
should see the name of the font -- e.g., ecbx71, etc.. Once you identified the mystery fonts, google
for them, and install the appropriate Type 1 fonts.
Epilogue
Armed with this array of Type 1 fonts, you
should now be able to produce PostScript that
only contains type 1 fonts. Distiller, or any
of the other PDF-writing software, should now be
able to create a PDF of your original document
that looks decent, and is actually
readable on-screen using Acrobat Reader.
Now you can show off LaTeX's beautiful output to those PDF-only people!