I'm trying to eventually use purrr to make multiple PDF documents. The Rmd renders fine when using default parameters and running directly from the template and using ctrl+shift+k in RStudio, but I'd like to produce multiple documents with different parameters. I'm using a R project and my working directory has a folder called programs and a folder called Enclosures. I would like the files PDFs to go to the folder Enclosures. The Rmd file in question has some extra TeX needed and are read in using the in_header and before_body commands. It seems that Pandoc isn't finding these TeX files. Here's a snippet of code:

rmarkdown::render(input="Programs/16A_TwoTableTemplate.Rmd",
                  intermediates_dir="Programs/Intermediates",
                  output_dir = "Enclosures",
                  output_file = StateByStateDataset$FPEnclosure[i],
                  params=list(state=StateByStateDataset$STATE[i]), 
                  clean=FALSE)


Here's the error:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS "\rtpnfil03/rtpnfil03_vol4/CSFACF/Statistics/Universe_For_Survey/Enclosures/Programs/Intermediates/16A_TwoTableTemplate.utf8.md" --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output pandoc15c812ec3620.tex --template "C:\Users\sazimmer\Documents\R\win-library\3.5\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --pdf-engine pdflatex --include-in-header "Extra\preamble.tex" --include-before-body "Extra\doc-prefix.tex" --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes"
File Extra\doc-prefix.tex not found in resource path

Where should the "Extra" folder be for Pandoc to find it?

I'm not sure what was going on exactly but making a reproducible example made me realize maybe I had some relative paths wrong initially and it may have been as simple as that. Sharing an example of creating multiple parameterized reports here: https://github.com/szimmer/Parameterized_RMD_Example

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