title: RMarkdown: Space in LaTeX output at place of code for float
body: <p>When including code for a figure between two paragraphs in RMarkdown, the float resulting from the code might be placed at a different place of the document, leaving space between the paragraphs in the LaTeX/PDF output file.</p>
  
  <p>The following minimal example illustrates the issue:</p>
  
  <pre><code>---
  output: pdf_document
  ---
  
  This is my first paragraph. 
  Next in the Rmd file would be the code for the figure.  
  The figure is correctly treated as a float by LaTeX, meaning that LaTeX will put it to the next suitable position.
  ```{r pressure, echo=FALSE, fig.cap="Example", out.width='0.5\\textwidth', fig.pos='B'}
    plot(pressure)
  ```
  The problem now is, that this leaves space to my second paragraph.
  Usually, this should not be the case.
  In pure LaTeX, there is a linebreak, of course, but no vertical space in addition.
  </code></pre>