Skip to content

lst-cap-location: margin has bad placement in PDF output #11384

Open

Description

Bug description

Writing a Tufte style document with margin use. Having a listing for my code segments doesn't properly place the caption text in the margin.

---
format:
    pdf:
      documentclass: scrartcl
      papersize: a4
      geometry:
        #- showframe
        - left=20.0mm
        - textwidth=105.0mm
        - marginparsep=7.7mm
        - marginparwidth=57.3mm
        - top=20mm
        - bottom=20mm
        - footskip=10mm
      
      code-annotations: true
      code-line-numbers: false
      code-block-bg: "#FFFFE8"
      code-block-border-left: "#DDDDC8"

reference-location: margin
citation-location: document
tbl-cap-location: margin
cap-location: margin
lst-cap-location: margin

---

<!-- uses margin, as declared in YAML -->
::: { #lst-adcread-a }

``` {.rs}
fn read_12bit_adc() -> u16 {
    let v: u16 = adc1.read_dr(); // data register
    assert!(v <= 4095);
    return v;
}
```

When reading the the value from the Analog to Digital Converter (ADC)
hardware, the value which is given back cannot be known at compile time.

:::


---


::: { #lst-adcread-b cap-location=bottom}

``` {.rs}
fn read_12bit_adc() -> u16 {
    let v: u16 = adc1.read_dr(); // data register
    assert!(v <= 4095);
    return v;
}
```

When reading the the value from the Analog to Digital Converter (ADC)
hardware, the value which is given back cannot be known at compile time.

:::

---

::: { #lst-adcread-c cap-location=top}

``` {.rs}
fn read_12bit_adc() -> u16 {
    let v: u16 = adc1.read_dr(); // data register
    assert!(v <= 4095);
    return v;
}
```

When reading the the value from the Analog to Digital Converter (ADC)
hardware, the value which is given back cannot be known at compile time.

:::

Image

Quarto check output

Running latest version of quarto-cli from main branch.

sasja@ed800-g2:~/.quarto/quarto-cli$ git show -s --format="%as %H"
2024-11-11 adc7186f0ee20ed125588cd603330beb2e76bc71
sasja@ed800-g2:~/.quarto/quarto-cli$ quarto check
Quarto 99.9.9
[✓] Checking environment information...
      Quarto cache location: /home/sasja/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: adc7186f0ee20ed125588cd603330beb2e76bc71
      Path: /home/sasja/.quarto/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2024.10
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/sasja/.TinyTeX/bin/x86_64-linux
      Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.6
      Path: /usr/bin/python3
      Jupyter: 5.7.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    article-layoutbugSomething isn't workinglatexLaTeX engines related libraries and technologies

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions