Skip to content

Code annotation in margin. #8211

Open
Open
@sasja-san

Description

@sasja-san

I was asked (here) to make an issue about this.

It would be nice, when making use of sidenote/margin space, to be able to have code annotations placed there.

---
format:
    pdf:
      code-annotations: true
      code-block-bg: "#FFFFE8"
      code-block-border-left: "#DDDDC8"
---

# Normal code annotation

```c
int main() {
  printf("Hello, World!\n"); /* <1> */
  return 0;                  /* <2> */
}
```
1. Say hello.
2. Leave.




# Workaround to use margin

::: {.column-margin}
1. Say hello.
2. Leave.
:::
```c
int main() {
  printf("Hello, World!\n"); /* <1> */
  return 0;                  /* <2> */
}
```

This workaround gives wonky placement in HTML.

Here's the current (main branch on 2023-01-10) output as HTML and PDF.

quarto-code-annotation-workaround-out

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions