Home > Software engineering >  How to use a bibtex citation key in a quarto gt table?
How to use a bibtex citation key in a quarto gt table?

Time:09-15

I would like to add a bibtex reference to the notes for a gt table in Quarto, but using @citationkey does not seem to work. Does anyone know how to do it?

Here's a reproducible example:

---
title: "Untitled"
format: pdf
bibliography: refs.bib
---

```{r}
#| include: false
library(dplyr)
library(gt)

    ```

Here I can cite @dirac

But below I get only the literal "@dirac". If I do not include the quotation marks, the code does not compile.

```{r}
#| include: true
#| echo: false

head(mtcars) %>%
  gt() %>%
  tab_source_note("@dirac")
    ```

# References {-}

And the reference in refs.bib:

@book{dirac,
  title={The Principles of Quantum Mechanics},
  author={Paul Adrien Maurice Dirac},
  isbn={9780198520115},
  series={International series of monographs on physics},
  year={1981},
  publisher={Clarendon Press},
  keywords = {physics}
}

CodePudding user response:

Following enter image description here

  • Related