0

I always get the text before the plot, even though it comes after in the code (this code is from R Markdown, since I'm just switching all my scripts to Quarto, although copy and paste should be possible, I'm finding that there's always weird formatting when I create the PDF).

plot(silhouette(km.res3$cluster, dist(dat)), main="Silhouette Plot")

then i write "blablabla" and the blablabla is displayed BEFORE, and not AFTER the Plot.

Do you know what to do?

CB95
  • 77
  • 1
  • 11
  • 1
    You need to tell Latex to hold the position of your figures in the `header-includes` section of the quarto YAML - see [here](https://stackoverflow.com/a/51608212/12545041). I'm going to vote to close this as a duplicate but if this doesn't work let me know and I'll retract the close vote. – SamR Aug 20 '23 at 07:04
  • Use `fig-pos: H` in yaml header under the `format: pdf`. See [this answer](https://stackoverflow.com/a/76139403/10858321) – shafee Aug 20 '23 at 07:48
  • @shafee is that equivalent to `\usepackage{float}` followed by `\floatplacement{figure}{H}` in the Latex header? If so your native quarto method seems preferable. – SamR Aug 20 '23 at 08:55
  • 1
    @SamR, AFAIK yes, both have equivalent consequence! – shafee Aug 20 '23 at 16:54

0 Answers0