-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure layouts broken in LaTeX/PDF #7017
Comments
I'm just going to leave this here 😭 |
lol I've had like 10 typst-related tabs open for a week now, hoping to get around to figuring it out. Guess it's time 😂 |
ha just found a new issue when using typst, though, using the same reprex: ---
title: "Layout test"
format: typst
---
```{r}
#| label: fig-charts
#| fig-cap: "Charts"
#| layout: "[1, 1]"
plot(cars)
plot(pressure)
```
|
That one is a duplicate of #6965 :) |
Hmmm. @cderv, this is the keep-md output for that HTML example. It doesn't look right to me (there's no .qmd
.html.md
|
There are two things here
I'll start by the second Repeated captionThis is not a bug in knitr but a feature 😅 . When there is several plots in same chunk, some figure options are recycled. Source here: https://github.com/yihui/knitr/blob/1a6adb7f866171c923bde27a41169738178c5b0b/R/plot.R#L267-L270 So it is possible this behavior explain why this is the case in .qmd doc too. If we don't want that, we need a way to prevent the recycling is this happens. I believe for Jupyter if you only provide one Let's note that if no
This are examples from our docs: https://quarto.org/docs/authoring/figures.html#layout I believe for Python it almost works. See the numbering which is not quite correct
Intermediates .md::: {#cell-fig-charts .cell layout-ncol='2' execution_count=1}
``` {.python .cell-code}
import matplotlib.pyplot as plt
plt.plot([1,23,2,4])
plt.show()
plt.plot([8,65,23,90])
plt.show()
```
::: {.cell-output .cell-output-display}
![Line Plot 1](test2_files/figure-html/fig-charts-output-1.png){#fig-charts width=566 height=404}
:::
::: {.cell-output .cell-output-display}
![Line Plot 2](test2_files/figure-html/fig-charts-output-2.png){#fig-charts width=566 height=404}
:::
:::
See @fig-charts.
No reference resolved with several layout in chunk with knitrI am looking into that as we speak. It seems we never set an quarto-cli/src/resources/rmd/hooks.R Lines 636 to 649 in 1d7aeb0
This is quite some change to do it... but it seems there should always be a label right ? I am looking into this... 👀 happy to fix the R side in Quarto but we need to discuss to be on the same page on how it should work |
A quick user intrusion, here: academic and scientific styles usually require figures to have a caption, made of a
Other styles, like the one required for end-user manuals, don't require it. The figure can only include images, but have no captions (being an extensive description the core of the preceding or following text). In my view, an empty caption (
|
@ptram that is working on
|
We've had other reports of users who now expect the empty captions, so I think this bug has officially become a feature. 🎉 🫠 |
Bug description
Custom figure layouts cause this error when rendering to PDF:
Steps to reproduce
The .tex file has this:
Based on a quick naive search, this StackExchange post says that adding a
[H]
to the inside-the-minipage
-figure environments will fix it, and it does. If I edit the .tex file like so and compile it outside of Quarto, it works:But I don't know if that's the true solution or how it worked in previous versions. Quarto 1.3 worked fine—some sort of regression happened at some point 🤷♂️
Expected behavior
Side-by-side plots should appear
Actual behavior
Nothing :)
Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: