# Typesetting mathematics: how do {\em you} convert text into pdf?

Prompted by this question I would like to ask the community how they convert their mathematics into pdf files. In any given procedure for converting mathematics into pdf I am interested in two issues: first typographical quality of text and of mathematical formulas and second production and placement of figures and labels within figures.

As a concrete example my current procedure is: latex and bibtex until the references settle down, dvips -o to produce postscript, and then ps2pdf to produce pdf files. I go through postscript in order to make psfrag labels work. I've never been fully happy with the output - in particular label placement inside of figures is difficult.

As a final issue, in the question referenced, Tilman suggests that pdftex has typographical improvements over latex. I've looked around on-line and these seem to be margin kerning (hanging punctuation) and glyph scaling (font expansion). How does one use these features? Do they make a difference in practice?

EDIT: After a bit of pain, I've managed to switch from my previous procedure (described above) to the much simpler procedure of using pdflatex. Instead of psfrag I now use Colin Rourke's pinlabel package. I am very happy with pinlabel -- the fonts are exactly what I expect them to be, and the job of labelling is much easier than it used to be. It is still possible to align labels inside of a figure, and they virtually always show up where I intended.

I started using the microtype package, which turns on margin kerning and glyph scaling. I can see that these change the output, but I honestly can't say that the output is better - I guess my eyes aren't that sensitive. One thing to watch out for - pdftex 1.20 threw show-stopping errors when typesetting figure captions. I updated to 1.40 and the problem went away.

Thanks for your suggestions - if other people have other latexing procedures I'd be interested to hear about them.

-
Could you please clarify what you mean by label placement inside of figures? –  Vladimir Dotsenko Apr 15 '10 at 13:43
Have you tried pdflatex? –  S. Carnahan Apr 15 '10 at 15:22
As SC says, on any modern machine, pdfLaTeX is preferable to LaTeX -> dvips -> ps2pdf. In fact, postscript is rapidly becoming an unsupported format, so I think you should at the least use dvipdf directly, unless you're using eps images. –  Theo Johnson-Freyd Apr 15 '10 at 16:36
@Theo: Do you have any references supporting your claim that PS is becoming unsupported? –  Andrea Ferretti May 9 '10 at 10:11
You misspelled "\emph{you}" in the title. –  JeffE Apr 14 '12 at 9:13

You can do margin kerning (aka “protrusion”) and font expansion in pdfLaTeX simply by loading the package microtype (i.e., by adding

\usepackage{microtype}

to the preamble). I also suggest using the tracking option for small-caps, which increases the space between letters (which is typographically correct, but only for small-caps and all-caps text):

\usepackage[tracking=smallcaps]{microtype}

For further information (and for several fine-tuning options) you can consult the microtype manual.

Edit: Yes, in my opinion and (I think) in a typographer’s opinion, these features do make a lot of difference. Margin kerning and font expansion help pdfLaTeX typeset the text, producing a lot less over/underfull hboxes. Letterspaced small-caps are also more legible and much more aesthetically pleasing.

-
The really big observable benefit with microtypography is less hyphenation. –  Charles Stewart Jun 25 '13 at 13:46

I almost always use pdflatex and I "draw" my figures using tikz and pgf. This is a pure latex solution, and the quality of the figures is proportional to the amount of time you are willing to put into them, but by default, the quality is generally quite good.

-
Same here. Tikz is awesome (if somewhat daunting). –  Thierry Zell Aug 12 '10 at 0:02

Taking the title, "How do you convert ..." literally [emphasis added], the Mac program TeXShop does this for me.

In a unix environment, I have used dvips followed by ps2pdf and experienced some problems but these were long ago. Someone once told me how to embed LaTeX code into xfig files, but I never used it. If you place figures in the tex via a picture environment, then you just have to continue to adjust stuff, or print on graph paper and use coordinates.

If you are lazy with xfig and have to label stuff, then always place your labels at magnification 1. Otherwise character placement will be wrong. I found that a 24 point font for characters with an 18 point font for subscripts works about the best in terms of scales. Even so, I have noticed that in published versions of stuff we have written the fonts in figures are too small for my tastes.

Then again, I think that figures are meant to communicate an idea instantly, and often a plethora of notation within a figure can be a distraction on first reading.

-
Labels with Xfig: make sure that you have the "special" tag selected for text input with xfig. But better still: use TikZ! –  Andrew Stacey Apr 15 '10 at 14:01

I recommend using the dvipdfm program, the analog of dvips for PDF. It supports EPS images and other special DVI commands. Files produced by ps2pdf or pdfTeX are known to cause problems.

-

For the graphics in TeX, I use mpgraphics package which with only one run of LaTeX, I can see my metapost graphics in the output.

For maths, I think breqn package is very useful because it does automatic line breaking for equations and unlike align environment from amsmath package, you do not need to break and align equations manually.

-