(LaTeX) figure width=100% in margin not always based on marginparwidth

Open
#8,806 1 comment 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Feb 21, 2024.

Assessment

This issue has not been assessed yet.

Description

article-layout bug latex
Bug description

It seems that a figure placed inside a {.column-margin} div that's also not a #fig still uses geometry->textwidth for scaling in percentages. It should probably use geometry->marginparwidth.

quarto-margin-image-width

Second page code shows other cases where it works as I expect.

---
format:
    pdf:
      papersize: a4
      geometry:
        - showframe # Debugging purposes 
        - left=15.0mm
        - textwidth=102.0mm
        - marginparsep=7.7mm
        - marginparwidth=70.3mm
---

::: {#fig-mainseg}

![](segfault.png){width=100%}

It's a basic fact of life.

:::


:::{.column-margin #fig-marginseg cap-location=bottom}

![](segfault.png){width=100%}

This seems to work fine...

:::

\vspace{3cm}

:::{.column-margin}

![](segfault.png){width=100%}

This is where we break.

:::


{{< pagebreak >}}


:::{.callout-note title="image in callout"}

Here we see the C mom teaching about `\0`.
The image width seems proper.

![](segfault.png){width=100%}

:::


::::::{.column-margin}

:::{.callout-note title="image in marginal callout"}

This works fine...

![](segfault.png){width=100%}

...too.

:::

::::::

Quarto check output
sasja@ed800:~/.quarto/quarto-cli$ git show -s --format="%as %H"
2024-02-20 5446285d6aebd56cca2785610edad9c18ea06ea3
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

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.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.