Skip to content
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

Fix caption alignment with centered images #127

Closed
stefaniebutland opened this issue Jul 19, 2024 · 3 comments
Closed

Fix caption alignment with centered images #127

stefaniebutland opened this issue Jul 19, 2024 · 3 comments

Comments

@stefaniebutland
Copy link
Member

See image & caption at bottom of blog post: https://openscapes.org/blog/2024-07-18-openscapes-update/

Captions are left-aligned when image is centered
![Llanwrst, Wales, photo by Julie Lowndes](llanwrst-wales-jslowndes.jpg){fig-align="center" width="60%" fig-alt="photo focal point is a narrow river with central sandbar, flowers in foreground along the river are dark pink and white, trees along riverside and hills in background"}

@ateucher
Copy link
Contributor

This looks like a quarto bug. There is an existing issue for it for docx outputs, I added a comment for html: quarto-dev/quarto-cli#11589 (comment)

@ateucher
Copy link
Contributor

Ok, apparently not a bug but by design:

"Figures" (which in the Pandoc AST are images standing alone in a paragraph with a caption) are center aligned (and their captions left-aligned, as captions are often long-ish and in that case look very strange center-aligned)

Plain images (no caption) are left aligned

Here's a discussion about it: quarto-dev/quarto-cli#2304

In short, it seems like the way to fix it is with something like:

::: {style="text-align:center;"}
![Caption text](https://quarto.org/quarto.png)
:::

@stefaniebutland
Copy link
Member Author

Documented in our website wiki under Adding captions below embedded images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants