quarto-dev / quarto-dev/quarto-cli
Varying subfigure width
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Discussed in https://github.com/quarto-dev/quarto-cli/discussions/1817
Originally posted by jpmorr August 11, 2022
When dealing with a single image it's quite simple to vary the image width in the standard markup:
{#fig-img1 width=60%}
I'd like to do something similar when using a subfigure to have a little more fine gained control over some I'll fitting figures generated elsewhere.
::: {#fig-specimen_comp layout-ncol=2}
{#fig-img1 width=60%}
{#fig-img2}
Comparison between two samples
:::
However, I've noticed that the width attribute is completely ignored in the subfigure, setting to 10% or 90% does not change the size of the subfigure. I don't want to change the width of the column as the caption text should be equal width in this case. Is it possible to change the width of the figure, much like in latex you can set a figure to be [width=0.75\textwidth]?
Obvious solution is to make a copy of the figure I want to resize and crop it to fit better, but I like the latex solution of just changing the size.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read discussion #1817 and reproduce the supplied Quarto Markdown example with different subfigure width values. Trace how the subfigure layout handles image width compared with a standalone image. Done means the width setting changes the subfigure image without changing the column or caption width, with behavior matching the requested LaTeX-style control.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex, markdown
- Domain
- content
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100