Christoph Lehmann
2004-Jun-25 11:51 UTC
[R] sweave: graphics not at the expected location in the pdf
Hi I use sweave for excellent pdf output (thank you- Friedrich Leisch). I have just one problem. Quite often it happens, that the graphics are not at the place where I expect them, but (often on a separate page) later on in the pdf. How can I fix this, means how can I define, that I want a graphic exactly here and now in the document? Many thanks and best regards Christoph -- Christoph Lehmann <christoph.lehmann at gmx.ch>
Don MacQueen
2004-Jun-25 14:49 UTC
[R] sweave: graphics not at the expected location in the pdf
This is actually a LaTeX question, not an R (or even Sweave, strictly speaking) question. Here is what I have done. In the preamble, specify \usepackage{here} Then later on specify [H] when including a figure, as in: \begin{figure}[H] \begin{center} <<fig=TRUE,width=6.5,height=4>>plot(x,y) @ \caption{My plot\label{fig1}} \end{center} \end{figure} Is the "here" package *required* in order to use [H]? I don't know. I just found it mentioned in a LaTeX book, tried it, and it worked. The most helpful book I've found so far is Guide to LaTeX (fourth edition), by Helmut Kopka and Patrick W. Daly And yes, Sweave is great! -Don At 1:51 PM +0200 6/25/04, Christoph Lehmann wrote:>Hi > >I use sweave for excellent pdf output (thank you- Friedrich Leisch). I >have just one problem. Quite often it happens, that the graphics are not >at the place where I expect them, but (often on a separate page) later >on in the pdf. How can I fix this, means how can I define, that I want a >graphic exactly here and now in the document? > >Many thanks and best regards > >Christoph >-- >Christoph Lehmann <christoph.lehmann at gmx.ch> > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html-- -------------------------------------- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA
Tamas Papp
2004-Jun-25 15:02 UTC
[R] sweave: graphics not at the expected location in the pdf
On Fri, Jun 25, 2004 at 01:51:08PM +0200, Christoph Lehmann wrote:> I use sweave for excellent pdf output (thank you- Friedrich Leisch). I > have just one problem. Quite often it happens, that the graphics are not > at the place where I expect them, but (often on a separate page) later > on in the pdf. How can I fix this, means how can I define, that I want a > graphic exactly here and now in the document?This is not an R problem. Standard LaTeX is squeamish about putting figures on a pages where the fit is "tight". Put \renewcommand\floatpagefraction{.99} \renewcommand\topfraction{.99} \renewcommand\bottomfraction{.99} \renewcommand\textfraction{.01} in the document preamble. You might have to play around with the values a bit, make sure that \textfraction and the others add up to 1. Best, Tamas -- Tam??s K. Papp E-mail: tpapp at axelero.hu (preferred, especially for large messages) tpapp at westel900.net Please try to send only (latin-2) plain text, not HTML or other garbage.
Patrick Drechsler
2004-Jun-26 05:36 UTC
[R] sweave: graphics not at the expected location in the pdf
Hi Christoph, Christoph Lehmann wrote on 25 Jun 2004 12:51:08 MET: [...]> Quite often it happens, that the graphics are not at the place > where I expect them, but (often on a separate page) later on in > the pdf. How can I fix this, means how can I define, that I > want a graphic exactly here and now in the document?Your email address implies that you can read german so here's the German LaTeX FAQ pointer: ,----[ http://www.dante.de/faq/de-tex-faq/html/de-tex-faq.html ] | 6.1.1 Wieso werden die meisten meiner Abbildungen an das Ende des | Kapitels oder Dokuments verschoben? | | 6.1.2 Wie kann ich die Default-Plazierungseinschrnkungen ndern? | Ich mchte meine Abbildungen auch `h'ier plazieren, ohne jedesmal | das optionale Argument angeben zu mssen. | | 6.1.3 Wie mu ich die `float'-Parameter ndern, so da die | Abbildungen und Tafeln gnstiger innerhalb eines Abschnitts | verteilt werden? | | 6.1.13 Wie kann ich Abbildungen oder Tafeln, die nicht innerhalb | einer `figure'- oder `table'-Umgebung stehen, dennoch mit einer | Bildunterschrift (Legende) versehen? `---- Especially the last option might be interesting for you (using the packet capt-of). There's also an english FAQ at <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html?label=floats> showing some more approaches. HTH, Patrick -- "You know the world is going crazy when the best rapper is a white guy, the best golfer is a black guy, the Swiss hold the America's Cup, France is accusing the US of arrogance, and Germany doesn't want to go to war." -- Charles Barkley