[R] Computer Modern and Sweave

Bert Stumm tmp.mail.2008 at gmx.de
Tue Sep 1 13:56:48 CEST 2009


Hello,

I have a small but nasty problem with the Computer Modern fonts
in connection with Sweave.

Instead of giving my own code, it's probably better to look at a
well established example. There is a nice introduction to using
Sweave at Paul Murrell's website which can be found at:

http://www.stat.auckland.ac.nz/~paul/R/CM/CMR.html

Essentially, what I need from this page are the following 4 files for 
creating my final pdf:

http://www.stat.auckland.ac.nz/~paul/R/CM/cmTutorial.Rnw

( 
  This example needs the according Tex-package and the files for the symbol
  faces found at (the links are also given on the site): 
  http://www.ctan.org/tex-archive/help/Catalogue/entries/cm-lgc.html 
  http://www.stat.auckland.ac.nz/~paul/R/CM/cmsyase.afm
  http://www.stat.auckland.ac.nz/~paul/R/CM/cmsyase.pfb
) 


Creating the tex-file with
> R CMD Sweave cmTutorial.Rnw
and compiling it with
> pdflatex cmTutorial.tex

yields a perfect plot. BUT, if minus signs appear in the plot, it does not
work poperly anymore! Just change the endpoints in the 'histogram'  function to 'c(-59.5, 76.5)' ( instead of 'c(59.5, 76.5)' ) and run the
two upper commands again. Then, I see a minus sign in the file 
'cmTutorial-latticeShow.pdf' but NOT in the 'cmTutorial.pdf'. 
Very strange is also, that using sth. like mtext(text="-1.987",...) will
give me a nice minus-sign in the pdf.

###
 
Did anybody encounter this problem and could possibly help me with this
question?
How can pdflatex change something in the included pdf?

Cheers,
Frank

-- 

für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02




More information about the R-help mailing list