Defines functions useknitr defSconcordance

Documented in defSconcordance useknitr

defSconcordance <- function() cat('
  \\csname newcount\\endcsname\\pdfoutput\\fi%
     \\immediate\\pdfobj stream{#1}%
     \\pdfcatalog{/SweaveConcordance \\the\\pdflastobj\\space 0 R}%

useknitr <- function(writeMacro) {
    if (!requireNamespace("knitr"))
        stop("This function requires the knitr package.")
    knitr::opts_knit$set(concordance = TRUE)
    infile <- knitr::current_input()
    if (missing(writeMacro))
        writeMacro <- any(grepl(knitr::knit_patterns$get("header.begin"),
        		    readLines(infile, 100)))   
    if (writeMacro) 
    cat("\\input{", tools::file_path_sans_ext(infile), "-concordance}",
        sep = "")

Try the patchDVI package in your browser

Any scripts or data that you put into this service are public.

patchDVI documentation built on May 2, 2019, 5:50 p.m.