Rendering pdf images using the cairo_pdf device as default. #1170
-
Is there an option to render/save figures as
I’m running on macOS 12 for information. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I think you would need to use a knitr only solution (meaning not a Quarto configuration working also for other language). You can change the default device with knitr using the On the chunk you need ```{r, dev='cairo_pdf'}
#| label: fig-a
#| fig-cap: This is a figure caption.
library(ggplot2)
ggplot() +
geom_segment(aes(x = 0, xend = 1, y = 1, yend = 0)) +
xlab("\u0394")
``` Or globally in a setup chunk ```{r setup, include=FALSE}
knitr::opts_chunk$set(dev = "cairo_pdf")
``` or using Quarto specific syntax in YAML for engine (https://quarto.org/docs/computations/execution-options.html#engine-binding) knitr:
opts_chunk:
dev: cairo_pdf This way, knitr should use Hope it helps |
Beta Was this translation helpful? Give feedback.
-
Piggy-backing on this question: Is there a way to automatically invoke (or limit) I normally render the same .qmd file to both HTML and PDF. Setting (By comparison, with RMarkdown you can invoke the device directly under the document-specific YAML: Thanks in advance. |
Beta Was this translation helpful? Give feedback.
I think you would need to use a knitr only solution (meaning not a Quarto configuration working also for other language).
You can change the default device with knitr using the
dev
chunk optionOn the chunk you need
Or globally in a setup chunk
or using Quarto specific syntax in YAML for engine (https://quarto.org/docs/computations/execution-options.html#engine-binding)
This way, knitr should use
g…