При включении кода для фигуры между двумя абзацами в RMarkdown, плавающая в результате кода может быть размещена в другом месте документа, оставляя пространство между абзацами в выходном файле LaTeX / PDF.
Следующий минимальный пример иллюстрирует проблему:
---
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.