28

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?
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
  • 3
    You got lots of good answers here, but you can also check out the [TeX Stackexchange](http://tex.stackexchange.com/). See for instance [this question](http://tex.stackexchange.com/questions/349/what-is-the-practical-difference-between-latex-and-pdflatex). – Matthew Leingang Nov 29 '10 at 13:12

5 Answers5

20

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.)

Josh Lee
  • 171,072
  • 38
  • 269
  • 275
  • 3
    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 Jan 05 '09 at 19:56
  • @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 Jan 06 '09 at 03:19
  • 1
    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. – Josh Lee Jan 06 '09 at 03:40
  • And the benefit? Output looks better? – Norman Ramsey Jan 07 '09 at 00:46
  • 1
    Pretty much. The majority of your hyphens will disappear, making for smoother comprehension, and the right-side margin will be smoother. – Josh Lee Jan 07 '09 at 01:23
  • Mmm. Less hyphenation. Nice. – Norman Ramsey Jan 08 '09 at 20:37
  • 2
    @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 Jan 16 '09 at 19:41
  • 3
    This answer is slightly misleading since XeTeX unfortunately doesn’t support pdftex’ microtypographic extensions. :-( – Konrad Rudolph Feb 28 '10 at 11:39
5

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 'links in bio' Ericson
  • 20,880
  • 12
  • 98
  • 148
  • 1
    xdvi is not only much faster than xpdf, it is infinitely easier to look at, with full antialiasing &c. The only competition is Adobe Reader on a *really* fast machine. – Norman Ramsey Apr 17 '09 at 03:31
  • 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 Apr 17 '09 at 03:32
  • Note that I pointed to MetaFun, not MetaFont. But I certainly claim no special knowledge of either. I just play around with them. – Jon 'links in bio' Ericson Apr 17 '09 at 08:20
3

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
  • 6,488
  • 3
  • 27
  • 28
  • 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 Apr 17 '09 at 03:37
  • 1
    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 Apr 17 '09 at 03:45
  • 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 Apr 17 '09 at 09:00
1

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
  • 11,661
  • 4
  • 46
  • 85
0

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.

cjs
  • 25,752
  • 9
  • 89
  • 101
  • 2
    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 Dec 04 '09 at 03:04