pdf-- how to render figures and paragraphs "in the right order" #3738
-
Just a question, I am new to quarto and don't know anything about the conventions used by Tex (which, I understand, is the engine used for pdf rendering). Basically, I am writing a document in rstudio and rendering it to pdf. I have some large figures that appear in the document in addition to paragraphs and headings. I write some paragraphs (eg p1, p2, p3), then have a figure (eg fig-1), then some more paragraphs (p4, p5) and some more figures (fig-2, fig-3). So in the qmd file it's like this...
But when I render (regardless of whether it's the cli or rstudio render button), it comes out like this...
Fig-1 gets shoved down past p4 and p5! That, IMHO, really messes up my intention and the flow of ideas in the document. Is there a way to "force" the pdf render to not mess with the ordering of paragraphs and figures? I understand this means that I may end up with awkward page breaks. That's OK. I prefer that problem to this one. Is this a strongly opinionated feature from the TeX days? I don't even know what to call my expectation other than "render-my-paragraphs-and-figures-in-the-order-I-wrote-them". Is there a vocabulary word for this? How should I approach this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You're looking for https://quarto.org/docs/authoring/figures.html#figure-position, specifically |
Beta Was this translation helpful? Give feedback.
-
I have a similar question. I have a sequence of R code blocks, each generating a figure. However, in the PDF, each page then contains a figure plus the echoed code block of the next figure. How could I make each block appear on the same page as the corresponding figure (before or after)? |
Beta Was this translation helpful? Give feedback.
You're looking for https://quarto.org/docs/authoring/figures.html#figure-position, specifically
fig-pos: 'h'
.