Skip to content

Footnote marker placement when using gt::md() in Quarto in gt v0.11.0 #1773

@ddsjoberg

Description

@ddsjoberg

Prework

Description

When a footnote is placed next to text that has been processed with gt::md(), the footnote marker is placed in a separate row when rendered with Quarto. I spotted this behaviour in both column labels and footnotes (I haven't checked all location types, e.g. table cells, grouped row headers, summary rows, etc FYI). Note this does not occur when running the code interactively in the RStudio IDE. I think this is new behavior in gt 0.11.0.

Reproducible example

In the example below, I am using gt::md() in the column label and in the actual footnote text. In both cases, the use of gt::md() drives the footnote marker so its own row.

---
title: "Untitled"
format:
  html:
    embed-resources: true
---

## Quarto

gt footnotes without `gt::md()`: no issues.

```{r}
mtcars[1:2, 1:2] |> 
  gt::gt() |> 
  gt::cols_label(mpg = "**MPG**") |> 
  gt::tab_footnote(
    "_Adding footnote_",
    locations = gt::cells_column_labels(columns = gt::everything())
  )
```

gt footnotes **WITH** `gt::md()`: footnote markers appear on their own line.

```{r}
mtcars[1:2, 1:2] |> 
  gt::gt() |> 
  gt::cols_label(mpg = gt::md("**MPG**")) |> 
  gt::tab_footnote(
    gt::md("_Adding footnote_"),
    locations = gt::cells_column_labels(columns = gt::everything())
  )
```
image

Thank you again!!! 🕺🏼

PS This issue could be related to #1541. But that doesn't mention Quarto?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions