Convert an R Markdown pdf driver to one that handles concordances.
pdf_with_patches.Rd
This function produces a new driver which matches the old
one in most respects, but adds an argument sourcepos
(and possibly others).
If that argument is TRUE
(the default) then concordances
are handled by the new driver.
This is used to produce pdf_documentC
in this package, and should also work on other drivers that produce
PDF output using Pandoc.
Details
This function makes use of the RmdConcord::pdf_with_concordance
function. That function adds concordances
to the output of the original driver; this function patches the PDF file so that
source references in it refer to the original
source file.
Examples
pdf_with_patches(rmarkdown::latex_fragment)
#> Loading required namespace: RmdConcord
#> function (latex_engine = "pdflatex", sourcepos = TRUE, defineSconcordance = TRUE,
#> run_latex = TRUE, ...)
#> {
#> force(run_latex)
#> res <- driver(latex_engine = latex_engine, sourcepos = sourcepos,
#> ...)
#> res <- apply_patches(res, sourcepos, defineSconcordance,
#> run_latex)
#> }
#> <bytecode: 0x5618f7bf2288>
#> <environment: 0x5618f7bf18e8>