1

I'm trying to use knitr while learning LaTeX but all my figures are placed at a seemingly random place.

It's driving me insane. Any ideas?

Example Input

PDF Output

I tried reinstalling TeX Live and R but nothing changed

EDIT : Ok, I solved more or less the problem by wrapping all chunk in \begin{figure}[H] \end{figure}

LaTeX is complaining but it works

( R 2.15.2, Rstudio, Tex live )

aussetg
  • 23
  • You need to give us some clues as to what the input looked like, and where the figure went (Preferably a complete small document that shows the problem). LaTeX figure placement is a deterministic algorithm, the placement of the figures depends on the input source. – David Carlisle Feb 10 '13 at 17:04
  • I'll use one of the Knitr example to show it's not my fault :p

    Example

    Output

    – aussetg Feb 10 '13 at 17:10
  • Welcome to TeX.SX. Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – Claudio Fiandrino Feb 10 '13 at 17:21
  • What version of knitr are you using? Also, it's good to give your OS in any question/bug report. – scottkosty Feb 10 '13 at 22:49
  • Are you new to LaTeX? Do you know that figures will float by default? I'm not surprised by the output you saw. – Yihui Xie Feb 11 '13 at 03:00
  • OS is Crunchbang Waldorf ( Debian 7 Basically ) , and yes I'm new to Latex. How do I ask ( force ) knitr to put the graphics EXACTLY where they were inserted? – aussetg Feb 11 '13 at 13:10
  • @Darknight670 So you have discovered the H option, which can be good or bad. Typesetting figures (or floats) in LaTeX is really really tricky. You will know more about this as you become familiar with LaTeX. – Yihui Xie Feb 20 '13 at 01:45

0 Answers0