-
First off, this is a cross-post from Stackoverflow where this question received no answers... Apologies if that is a faux-pas. I am creating a PDF using Quarto. I have several instances in which I am using subfigures. The subfigures are large, and have to remain large - each component of the subfigure should be approximately the size of the page. The problem is that when rendering to PDF, the second subfigure does not float to the next page - instead it is placed below the first. This seems similar to issue #5553 but here I include a reproducible example, using images taken from this Wikipedia article downloaded at original resolution. https://en.wikipedia.org/wiki/Petasites_hybridus ---
title: "test"
format:
html:
theme: cosmo
pdf:
documentclass: scrreprt
include-in-header:
text: |
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}
docx: default
editor: visual
---
test
::: {#fig-flower layout-nrow="2"}


:::
Any thoughts on how to fix this? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Since this is mostly LaTeX, you can add Note that "responsive" image is not a thing in LaTeX, so if you include images that are too large to fit in a page, that's basically up to you to resize the figures (using markup/LaTeX code or figure editor). Could you share a small "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks. You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````qmd
---
title: "Reproducible Quarto Document"
format: html
---
This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.
```{r}
plot(cars)
```
The end.
```` |
Beta Was this translation helpful? Give feedback.
-
I have essentially the same question (I think) but in a slightly different context. I am trying to create both revealjs slides and pdf from the same document. I have multiple subfigures as fragments so that in the revealjs slides they stack and replace each other on the slide, this works fine. When it comes to pdf though they are all printed on the same page one after each other and do not float so later subfigures get cut off. From what I understand from the answer above the only way is to put them as separate figures which means the revealjs stacking doesn't work. Is there a way to get the subfigures to split onto multiple pages or else achieve the stacking effect with separate figures?
In my actual document I do this with both pictures and generated outputs and have the same problems with both methods, so I've included examples of both in the example. |
Beta Was this translation helpful? Give feedback.
-
I actually have a similar question, but with computed figures. Here is a MWE: ---
title: "MWE"
keep-tex: true
format:
pdf:
mathspec: true
---
See @fig-test
```{r}
#| label: fig-test
#| fig-cap: Random plots
#| fig-subcap:
#| - Random 1
#| - Random 2
#| - Random 3
#| - Random 4
#| - Random 5
for (i in 1:5)
plot(rnorm(100), pch = 19, cex = 0.5)
``` I can of course use For completeness, I add the link to the stack overflow question of @russ-dvm I added a specific question on stack overflow for computed figures |
Beta Was this translation helpful? Give feedback.
I don't think it's possible for us to make "multi-page subfigures" that float like you expect them to. That requires coordination between multiple different floats in LaTeX. From my understanding, that's not how the LaTeX layout system works.