Why do {gt} font changes show up in the RStudio Window but not when I render to HTML with Quarto?

I am changing the font of a {gt} table and it looks fine in the RStudio preview but reverts to the default font when I render to HTML with Quarto. I've tried it a couple of ways and none of them work. I'm on Linux Mint 20

Minimal example


---
title: "qt error"
format: html
---

```{r}

library(gt)

exibble |> 
  gt() |> 
  opt_table_font(google_font(name = "Merriweather"))

exibble |> 
  gt() |> 
  tab_options(table.font.names = "Georgia")

```

Sorry it's rendering the YAML as markdown. I don't know how to stop it from doing that. It's just got a default Quarto YAML at the top, as you'd expect

I was able to reproduce the problem earlier today and found the same thing (font setting did not work in Quarto). I have applied a fix for this in the in-development version of gt on GitHub (Add more options for setting fonts for the entire table by rich-iannone · Pull Request #1275 · rstudio/gt · GitHub). If you install gt from GitHub now, your .qmd should now behave as expected. Please open an issue in Issues · rstudio/gt · GitHub if that is not the case after testing again.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.