I'm having problems with using pdfpages package with rmarkdown. I want to insert a multipage PDF into my rmarkdown rendered PDF document. I'm using tinytex.
The yaml has \usepackage{pdfpages}
and in the body of the rmarkdown I have \includepdf[pages=-]{test.pdf}
I keep getting this error: ! Undefined control sequence. l.222 \includepdf [pages=-]{test.pdf}
Error: LaTeX failed to compile temp.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See temp.log for more info. Execution halted
I've gone into cmd and used:
tlmgr install pdfpages
It seems to have said its installed. I see the necessary packages in this location on my PC. C:\Users\myprofile\AppData\Roaming\TinyTeX\texmf-dist\tex\latex
I shutdown R-studio and try knitr to PDF, but same error. If I remove the \includepdf[pages=-]{test.pdf} line then the PDF renders.
Any suggestions on troubleshooting? I've been working on it for a few days now. I could save each page of the multi-page PDF as an image and use includegraph, but that is not as ideal as doing it all at once.
Any help appreciated. Thanks!