Closed abichat closed 11 months ago
Easy repro here:
---
title: "Untitled"
format: html
knitr:
opts_chunk:
fig.align: center
---
```{r}
plot(1:10)
I think the issue is that we support this on a per-cell basis but not at the document level. (It still feels like a bug to me because this passes validation and our schemas autocomplete it.)
Here's more context. It is possible to get quarto to respect fig-align
globally, but it will currently only do so if it detects that a code cell is a figure. In quarto parlance, a figure is (again, currently!) interpreted fairly strictly. It needs a label and a caption. So the following works:
---
title: "Untitled"
format: html
fig-align: center
---
```{r}
#| label: fig-1
#| fig-cap: A caption
plot(1:10)
With that said, we agree that our "figure" options should work more generally (esp. `fig-align`, `fig-dpi`) for any images, so we'll fix this before 1.3 is out. Thanks for the report!
This turns out to be pretty delicate with its interaction with our figure discovery code. It will all get changed in 1.4, so I'm pushing this.
This is fixed on main
.
This still isn't working for me. I have the latest version of Quarto (1.5.57).
This still isn't working for me. I have the latest version of Quarto (1.5.57).
@jtr13 Please open a new issue referencing this one (after trying the pre-release version if possible) and please provide a fully reproducible example, i.e., "This still isn't working for me." is not something we can use or work on unfortunately.
See https://github.com/quarto-dev/quarto-cli/issues/4315#issuecomment-1426023371 which does work at least in the pre-release.
Thanks for the explanation. I see there's already one open with the same issue: https://github.com/quarto-dev/quarto-cli/issues/9800
Bug description
Hello,
I try to center all figures in my document with a YAML argument so I tried the generic option
fig-align
title: "Untitled" format: html knitr: opts_chunk: fig.align: center