[R] pdf() and pdflatex

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Fri Nov 8 19:14:07 CET 2002


The pdf driver uses the MediaBox as the specified device size, just as the
postscript() driver uses the device size for the bounding box.

That appears to work correctly for me with pdflatex and graphicx.  Space
that would appear on the screen will also appear on the pdf file.
I've just run a test and latex/dvips with .eps and pdflatex with .pdf
seem to give identical page layouts.

On Fri, 8 Nov 2002, Frank E Harrell Jr wrote:

> I am having good success in using pdf() to produce pdf graphics files for inclusion in documents processed by pdflatex [I'm using R 1.6.0 on Linux].  I am having one small problem consistently though, which I believe I also had with S-Plus's pdf.graph(): wasted space at the top of the graph which causes pdflatex to put the graph on a later page, when the current page has plenty of space.
>
> Here is how I typically call pdf( ):
>
> pdf(filename, width=5.333, height=4,     pointsize=10,family='Helvetica',onefile=FALSE)
> par(lwd = lwd, mgp = c(2.5, .6, 0),
>     mar = c(3.5, 3.5, 1, 1) + 1.e-10, bty='l')
> par(smo=0)
> plot( . . .)
> dev.off()
>
> Here is how I include the graphics file in LaTeX:
>
> \usepackage{graphics}
> ...
> \begin{figure}[hb]\leavevmode\centerline{\includegraphics{mygraph.pdf}}
> \caption{A caption}
> \label{fig:mygraph}
> \end{figure}
>
> I need onefile=FALSE because some of the high-level graphics commands I use produce more than one page of output.  I am using pdflatex rather than including postscript files with latex so that I can use the hyperref style for pdflatex.
>
> Has anyone had this problem or have a suggested solution?  Thanks in advance.
> --
> Frank E Harrell Jr              Prof. of Biostatistics & Statistics
> Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
> U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list