quarto-dev / quarto-dev/quarto-cli

Warn Users When `column` and `fig-cap-location` interfere with one another (e.g. screen width figure with margin caption)

Open
#4,150 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

article-layout enhancement lint
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

When I add a figure caption in the margin, Quarto doesn't respect the page layout options. I see that this makes sense in hindsight because there wouldn't be space for the caption, but I spent a while being confused why my figures weren't exapnding into the margin like I intended -- so maybe a warning would be helpful here when both options are toggled on?

Minimal example

---
title: "test"
format: html
---

```{r}
#| column: page-right
#| fig-cap-location: margin
#| fig-cap: "This is a test"
#| fig-width: 12
#| fig-height: 8
plot(1:5)
```

```{r}
#| column: page-right
#| fig-cap-location: bottom
#| fig-cap: "This is a test"
#| fig-width: 12
#| fig-height: 8
plot(1:5)
```

Output

Screenshot 2023-01-30 at 10 12 51

Version

❯ quarto -V
1.2.313
 setting  value
 version  R version 4.2.1 (2022-06-23)
 os       macOS Ventura 13.1
 system   x86_64, darwin17.0
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Chicago
 date     2023-01-30
 pandoc   2.19.2 @ /usr/local/bin/pandoc
Checklist
  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal .qmd example in the issue and render both figures to reproduce the interaction between column and fig-cap-location. Trace the handling of those options in Quarto's HTML rendering path. Done means users receive a clear warning when the settings interfere, while compatible settings remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript, r
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.