A tip about adding LaTeX fonts in NCAR Graphics

From: Raphaël Pierre <raphael.pierre_at_nyahnyahspammersnyahnyah>
Date: Fri, 14 Mar 2008 23:11:40 +0100

Hello,
I could not find any help about this topic and I think it could help a
few among NCARG users.

Let's say that you need to include an encapsuled postscript generated by
NCL in you LaTeX document. If this image contains character strings, you
may want them to be written in your own LaTeX style. Here is a solution.

As an example, let's consider the x-axis label of some plot.

1. Adapting the NCL source file.

A priori, no matter the font you specify in your .ncl file, just pick one.
   res_at_tiXAxisFont = 21 ; Helvetica.
Choose a dummy string (you'll have to reuse it afterwards).
   res_at_tiXAxisString = "xlabel"
The important step is the one that follows.
   res_at_tiXAxisFontQuality = "Low"
This option forces NCL to include the font in you output file, the .eps
image.

(To ensure this has been done correctly, open the .eps file with a text
editor and check if a line like that:
%%DocumentFonts: Helvetica
appears at the bottom.)

2. Adapting the LaTeX source file.

Add the usual packages for including graphics (e.g. graphicx).
Add the PSfrag package (available on CTAN and in usual LaTeX distros)
which will permit you to replace the dummy string by the correct one.
   \usepackage{psfrag}
Use the appropriate command.
   \begin{figure}
   \psfrag{xlabel}{$x$}
   \includegraphics{figure.eps}
   \end{figure}
And you're done.

Hoping this will be useful.

Regards,

Raphael Pierre
Ph.D. student
Fresnel Institute
Aix-Marseille University, France
raphael.pierre_at_gmail.com
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 14 2008 - 16:11:40 MDT

This archive was generated by hypermail 2.2.0 : Sun Mar 23 2008 - 15:01:37 MDT