[R] autoscaling plot font size in Sweave output possible?

Friedrich.Leisch@tuwien.ac.at Friedrich.Leisch at tuwien.ac.at
Fri Jan 7 09:49:04 CET 2005


>>>>> On Thu, 06 Jan 2005 23:56:31 +0100,
>>>>> Patrick Drechsler (PD) wrote:

  > Hi,
  > I was wondering if it's possible to have fonts in plots to be
  > autoscaled to the same font size used by LaTeX in a surrounding
  > Sweave document.

Not using the standard mechanism, because there figures are rescaled
*after* they are created, and the font is rescaled together with the rest.

What yoy have to do is:

1) Create your own Sweave.sty file, say MySweave.sty which is a copy
   of the ofiginal one *without* the \setkeys{Gin} line and insert a

   \usepackage{MySweave}

   in the .Rnw document.


2) Explicitly set height and width of each figure chunk to what it
   should be in the final document. Unfortunately you cannot use any
   fractions of \textwidth or the like because Sweawe has no means to
   know what that might be.

3) Set the font size to what you use in the tex document using
   ps.options().


It is because of 2) that I didn't follow this route for the current
defaults, and I haven't found a really convincing alternative which
works in "most" situations ...

Hth,
Fritz

-- 
-------------------------------------------------------------------
                        Friedrich Leisch 
Institut für Statistik                     Tel: (+43 1) 58801 10715
Technische Universität Wien                Fax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071
A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch




More information about the R-help mailing list