[knitr] Consider defaulting to svglite when svg device is used on R (e.g. as default in format: typst)
#11712
Labels
enhancement
New feature or request
figures
knitr
needs-discussion
Issues that require a team-wide discussion before proceeding further
typst
Milestone
See discussion at #11680
format: typst
setsfig-format: svg
as default.In R, this leads to set
dev = 'svg'
for knitr, and this will use thegrDevices::svg()
.It seems this R device on MacOS will require to use X11 and so have XQuartz installed, which is not the case by default on OSX environment.
To currently this means thant using Typst in Quarto to produce PDF requires X11 on mac when the document / project uses R. It does not seem ideal.
Other option in R ecosystem is svglite https://github.com/r-lib/svglite
We could consider using it as default for Quarto with R by setting
dev = 'svglite'
whenfig-format: 'svg'
. Or doing it only when svglite 📦 is available on the environment.Currently only way to set it is doing
as
fig-format: svglite
is not an option, becausefig-format
is supposed to be engine agnostic.This could also be handled at the knitr level by default to svglite if available. Or having a better fallback mechanism for
dev = 'svg'
to detect it is not working.The text was updated successfully, but these errors were encountered: