10/11/2008

Palatino in LaTeX - the modern variant

In order to use palatino as font in a LaTeX document one runs into trouble if the package units is used and one wants to use the palatino.sty.

Use the modern version called mathpazo.sty which contains also the math fonts, but you will have to set the sans serif and typewriter by hand (the old palatino.sty still set Helvetica and Courier, respectively). mathpazo.sty also knows some options - please refer to the documentation.

One problem: mathpazo.sty doesn't know greek letters in the math alphabet \mathrm . Normally this is no problem, but if you use the package units you will end up without the greek symbols in the unit, because it uses the text mode. A (not very nice) workaround would be:
\[\unit[1]{\text{$\mu$} m} \]
or \unit[1]{$\mu$m}
Note that the \text command is from the ams package, which you will need as well.

Thanks to an anonymous colleague for pointing this out.

Addendum:
As avocadohead pointed out (see comment to this post), the usage of the package SIunits instead of units is unproblematic with greek letters.
However, please note that the syntax of both packages differs:
\usepackage{units}: \unit[3]{unit}
\usepackage{SIunits}: \unit{3}{unit}

3 comments:

avocadohead said...

I used palatino/mathpazo together with SIunits and had no trouble with
\unit{1}{\micro\meter}. So maybe a simple package switch is also an option.

avocadohead said...

If you are using pylab plots together with your ever so stylish Palatino LaTeX document, this is how to change the pylab labels to Palatino:
pylab.rc('font',**{'family':'serif', 'serif':['Palatino Linotype']})
(got the tip here)

avocadohead said...

If you want to use LaTeX-formatted labels, you can even do that in pylab:

matplotlib.rc('font',**{'family':'serif','serif':['Palatino']})
matplotlib.rc('text', usetex=True)

Both lines before "import pylab", see the Cookbook