Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting fig.showtext in pkgdown template packages #69

Open
Bisaloo opened this issue May 7, 2024 · 0 comments
Open

Allow setting fig.showtext in pkgdown template packages #69

Bisaloo opened this issue May 7, 2024 · 0 comments

Comments

@Bisaloo
Copy link

Bisaloo commented May 7, 2024

I am using showtext for a ggplot2 theme for my organization. As a result, I would like showtext to always be enabled in vignettes in pkgdown websites.

I can specify:

knitr::opts_chunk$set(
  fig.showtext = TRUE,
  fig.retina = 1
)

in each vignette of each package but it gets a bit cumbersome.

I would like to set it once and for all for all vignettes and all packages via the pkgdown template package we are using. There is a way to do this but it requires packages that define custom parameters to explicit get them from the theme:

https://pkgdown.r-lib.org/reference/build_articles.html#figures

https://pkgdown.r-lib.org/reference/fig_settings.html

You can see for example how the rgl package is doing it:

https://github.com/dmurdoch/rgl/blob/0b13a6948314cdfa608a241d7b568585b3a05032/R/pkgdown.R#L46-L47

Is this something that could be implemented in showtext?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant