You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using tikzDevice as device when plotting with knitr and rmarkdown, there appear to be differences between using global options and chunk options for setting the PDF engine. I will demonstrate this with a R Markdown document with embedded PDF documents.
Setting engine = "luatex" has no effect when using the dev.args chunk option, the PDF metadata still indicate pdfTeX as creator:
---title: "Setting PDF engine via chunk options"output: html_document---```{r, dev-tikz, dev = "tikz", dev.args = list(engine = "luatex")}
par(mar = c(4, 4, 2, .1))curve(dnorm, -3, 3, xlab = '$x$', ylab = '$\\phi(x)$', main = 'The density function of $N(0, 1)$')text(-1, .2, cex = 3, col = 'blue', '$\\phi(x)=\\frac{1}{\\sqrt{2\\pi}}e^{\\frac{-x^2}{2}}$')```
Only when setting the global option tikzDefaultEngine = "luatex", the metadata indicate LuaTeX as creator:
---title: "Setting PDF engine via global options"output: html_document---```{r}options(tikzDefaultEngine = "luatex")``````{r, dev-tikz, dev = "tikz"}
par(mar = c(4, 4, 2, .1))curve(dnorm, -3, 3, xlab = '$x$', ylab = '$\\phi(x)$', main = 'The density function of $N(0, 1)$')text(-1, .2, cex = 3, col = 'blue', '$\\phi(x)=\\frac{1}{\\sqrt{2\\pi}}e^{\\frac{-x^2}{2}}$')```
I have provided the necessary information about my issue.
If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/knitr').
If I have posted the same issue elsewhere, I have also mentioned it in this issue.
I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
When using
tikzDevice
as device when plotting with knitr and rmarkdown, there appear to be differences between using global options and chunk options for setting the PDF engine. I will demonstrate this with a R Markdown document with embedded PDF documents.Setting
engine = "luatex"
has no effect when using thedev.args
chunk option, the PDF metadata still indicatepdfTeX
as creator:Only when setting the global option
tikzDefaultEngine = "luatex"
, the metadata indicateLuaTeX
as creator:See also daqana/tikzDevice#214
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
xfun::session_info('knitr')
The text was updated successfully, but these errors were encountered: