bookdown::pdf_book error when Tlmgr_search can't find image file

Hi,

I've just started using RStudio and RMarkdown so am certainly a novice. I'm hoping to work with bookdown to create technical documents but am running into problems creating the pdf when I try to include a figure. The following is the content of the *.Rmd file I'm trying to generate.

# Some Title {#SomeTag}

```{r, echo = FALSE, out.width='25%', fig.align='center', fig.cap='This is test figure'}
knitr::include_graphics('images/Test_Fig.svg', 
                        auto_pdf = getOption("knitr.graphics.auto_pdf", TRUE),
                        dpi=300,
                        rel_path = TRUE,
                        error = TRUE)
options(tinytex.verbose = TRUE)
```

I can generate the gitbook and epub versions without a problem, however the PDF fails with the following error:

This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
tlmgr search --file --global "/images/Test_Fig"
! LaTeX Error: File `images/Test_Fig' not found.

It appears the LaTeX engine is having difficulty locating the image file but the ePub and Gitbook are finding it without issue. (Side point, it appears that the tlmgr search is looking globally not to the relative local directory?)

I've tried updating and reinstalling Tinytex. Any suggestions are greatly appreciated - I'm sure its something trivial that I'm doing incorrectly.

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.