You can create a new output format with a function wrapping pdf_document:
my_latex_document <- function(..., includes = NULL) {
header_file <- file.path("path", "to", "header.tex")
before_file <- file.path("path", "to", "before-body.tex")
after_file <- file.path("path", "to", "after-body.tex")
custom_includes <- rmarkdown::includes(
in_header = c(header_file, includes[["in_header"]]),
before_body = c(before_file, includes[["before_body"]]),
after_body = c(after_file, includes[["after_body"]])
)
rmarkdown::pdf_document(includes = custom_includes, ...)
}
Of course, the way to make sure those files exist is to bundle everything up in a package. Then use system.file(...) to point to them.
Note: I only did a quick test of this function, so think of it as pseudo-code.