Skip to content

In PDF output, code listings can float away from their annotations #10297

Open
@cderv

Description

@cderv

Following up on feedback from @giabaio and @nichtich at

Take this example

---
title: Hello World
format: pdf
---

## Hello

{{< lipsum 1-2 >}}

```{#lst-customers .r lst-cap="Customers Query"}


# this is a comment that adds length to the code block
# this is a comment that adds length to the code block
# this is a comment that adds length to the code block

library(tidyverse)

# this is a comment that adds length to the code block
# this is a comment that adds length to the code block
# this is a comment that adds length to the code block

library(palmerpenguins)
penguins |>                                      # <1>
  mutate(                                        # <2>
    bill_ratio = bill_depth_mm / bill_length_mm, # <2>
    bill_area  = bill_depth_mm * bill_length_mm  # <2>
  )                                              # <2>
```
1. Take `penguins`, and then,
2. add new columns for the bill ratio and bill area.

{{< lipsum 3-4 >}}

image

So it seems the issue from 1.3 is happening again. It was initially fixed by 5e1027b but does not seem to apply anymore

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcode-annotationcrossreflatexLaTeX engines related libraries and technologies

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions