views:

1296

answers:

6

Not sure this is a programming question, but we use LaTeX for all our API documentation and user documentation, so I hope it will go through.

Can someone please explain what are the relative merits of using pdflatex as opposed to the "classic" technique of

latex foo
dvips -Ppdf foo
ps2pdf foo.ps

From time to time I run into people who have difficulty because things don't work in pdflatex, and I know that using pdflatex gives up two things I have grown to value:

  • Can't use the very speedy xdvi viewer
  • Can't use the PStricks package

I should add that I typically get PDF with hyperlinks by using something on the order of

\usepackage[ps2pdf,colorlinks=true]{hyperref}

so it's not necessary to use pdflatex to get good PDF.

So

  1. What are the advantages of pdflatex that I don't know about?
  2. What are the disadvantages of the old tools that I've overlooked?
+15  A: 

My favorite pdflatex feature is the microtype package, which is available only when using pdflatex to go directly to PDF, and really produces stunning results with no effort on my part. Apart from that, the only caveats I run into are image formats:

  • pdflatex supports PDF, PNG, and JPG images.
  • the postscript drivers support (at least) EPS.

Also, if you want to install fonts, the procedures are slightly different depending on what fonts that driver supports. (Hint: use XeTeX to instantly enable OpenType fonts.)

jleedev
Yeah, the biggest difference is probably in image support. pdflatex supports all the common image formats, but not eps, while you otherwise get eps, and nothing else.
jalf
@jleedev: would you be kind enough to elaborate a little on what microtype does for you? The README file went into some deep technicalities of typography...
Norman Ramsey
I just say `\usepackage[kerning,spacing]{microtype}` which enables glyph scaling and margin kerning. You can browse the other options, but this is basically all you need.
jleedev
And the benefit? Output looks better?
Norman Ramsey
Pretty much. The majority of your hyphens will disappear, making for smoother comprehension, and the right-side margin will be smoother.
jleedev
Mmm. Less hyphenation. Nice.
Norman Ramsey
@jalf: Not to mention that pdflatex directly embeds JPG and PNG images in the PDF bytestream without recompression. I like to run all my images through optipng and advpng for the final version.
Boojum
This answer is slightly misleading since XeTeX unfortunately doesn’t support pdftex’ microtypographic extensions. :-(
Konrad Rudolph
@Norman: Xetex now has limited support for microtypography. Cf. the Texlive pretest release: http://tug.org/texlive/pretest.html
Charles Stewart
+3  A: 

Also pdftex is the engine under development (towards luatex) and maintenance. I'm not sure the DVI counterparts are as actively maintained.

PStricks is supplanted by Tikz.

I didn't use xdvi in years, so pardon the trollish rhetorical questions: Does xdvi display vector fonts? Does it support synctex (jumping to and from code)? Does it have the confort of use of PDF readers like Skim?

Damien Pollet
xdvi manages vector fonts and embedded EPS just fine. I live in the Linux ghetto, not the OSX ghetto, so I'm not qualified to compare with synctex or Skim. xdvi does work nicely with \usepackage{hyperref}.
Norman Ramsey
It's not accurate to say that pstricks is supplanted by Tikz, but Tikz/PGF is at least a promising alternative (more portable, perhaps better designed, but less expressive).
Norman Ramsey
OK :) To be honest, I prefer graphics editors to programming, it's less work to obtain a good enough result, and easier to make visual adjustments (I did write pretty complex povray objects in the past though).As for synctex, maybe evince supports it?
Damien Pollet
+4  A: 

As it turns out, I recently read a post that shows the difference directly. Any document that uses tables or narrow columns will be improved automatically. I also find the inter-word spacing to be far more pleasing with pdflatex.

Is xdvi much faster than xpdf? I find the edit, TeX, view cycle to be very quick with pdflatex.

Have you tried MetaPost or MetaFun for graphics? I tend to put graphics creation in the hands of the capable, but MetaFun would likely be the package I'd use. Just reading the manuals is a pleasure.

Jon Ericson
Norman Ramsey
In my youth I used MetaFont and MetaPost extensively, but in my old age I prefer to put the ink where I want it to go (as opposed to figuring out what constraint to write).
Norman Ramsey
Note that I pointed to MetaFun, not MetaFont. But I certainly claim no special knowledge of either. I just play around with them.
Jon Ericson
A: 

I used pdflatex to generate the PDF for my ICFP 2009 paper. (I still needed to use standard latex to generate the PostScript file.) I did so for two reasons:

  1. I couldn't seem to get ps2pdf to generate Letter, rather than A4 output, no matter what command line options I used.

  2. For the printers, I needed to produce a version 1.3 PDF file, not 1.4. pdflatex made this easy to do. I set the PDF author and title information while I was at it.

Both of these problems may be fixable in some way, but as a first-time latex user, I didn't find any obvious solutions, nor did more experienced users whom I'd asked.

Curt Sampson
Interesting. Linux explicitly offers `ps2pdf13` and `ps2pdf12`, which generate legacy PDFs. The A4 output sounds more like a default TeX configuration out of the box; I have to run `texconfig` to change the default paper size. But if you are on Windows, that's a closed book to me.
Norman Ramsey
A: 

What may become a reason to prefer pdf-based texs to ps-based texs is support for tagged PDF: there is no similar standard for expressing metadata in postscript. When publishers demand tagged pdfs, suddenly you might care.

There's some experimental support for generating tagged pdfs in pdftex. Cf. Ross Moore's DML'09 talk.

Charles Stewart
A: 

Taco Hoekwater is working on Escrito, a Postscript interpreter written in Lua, which would allow you to use pstricks in Luatex. He has an impressive project completion record: maybe I should have used "will" rather than "would" in the previous sentence.

Charles Stewart