yixuan / showtext

Using Fonts More Easily in R Graphs
http://cran.r-project.org/web/packages/showtext/index.html
478 stars 38 forks source link

Quarto Support #64

Open cttnguyen opened 1 year ago

cttnguyen commented 1 year ago

Thanks for the really useful package. I'm running into some problems when trying to use showtext with Quarto.

I'm familiar with using fig.showtext = TRUE in rmarkdown code chunks and fig_retina = 1 for html output, but how can the same be specified for Quarto?

Also is there a way to set fig.showtext for all code blocks?

grantmcdermott commented 1 year ago

The following YAML option works for me:

knitr:
  opts_knit:
    fig.showtext: true

P.S. If you're using base R plots, then I would recommend adding global.par: true (or maybe global.device: true) to opts_knit so that any font family set in par persists over the full document. (See here.)