[R] Graphics and LaTeX documents with the same font

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Sep 28 14:42:48 CEST 2007


On Fri, 28 Sep 2007, Paul Smith wrote:

> Dear All,
>
> I know how to export graphics as pdf files and then how to include
> them in LaTeX documents. However, I do not know how to do in order to
> have the text of the graphics written with the font selected for the
> LaTeX document. Is that possible?

Well, it depends on what that font is.  But if it is TeX font,
see the section called 'TeX fonts' in ?postscript and the detailed 
description in the article in R-news 6/2 by Paul Murrell and myself.

If it is an Adobe Type1 font such as Times New Roman, just specify an 
appropriate family in the pdf() call.

Dietrich Trenkler wrote:

> maybe you will find the psfrag package useful.

I doubt it will be even usable with PDF (there are pdfrack and Xfigfrag, 
though), and with postscript it is at best a kludge as R does its own 
micro-positioning of text based on the font metrics.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list