Rmarkdown insert image with latex_engine:xelatax

when I insert image, I can not see image in pdf(beamer format). on the other hand it shows in slide(HTML). I removed latex_engine command, thus it was solved. I guess it has Bug.

This works as expected

---
title: "insert image"
output: 
  pdf_document:
    latex_engine: xelatex
---


Save the plot in a png file to include later
```{r}
graph <- "plot.png"
library(ggplot2)
p <- ggplot(mpg, aes(class, hwy)) + geom_boxplot()
ggsave(graph, p)
```

Include the file in the pdf

```{r}
knitr::include_graphics(graph)
```

I guess you are doing something different and having a reproducible example would really help (FAQ: What's a reproducible example (`reprex`) and how do I do one?)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.