These are convenience functions to set pre-defined pattern lists (the syntax
to read input documents). The function names are built from corresponding
file extensions, e.g. pat_rnw()
can set the Sweave syntax to read Rnw
documents.
pat_rnw()
pat_brew()
pat_tex()
pat_html()
pat_md()
pat_rst()
pat_asciidoc()
pat_textile()
The patterns object knit_patterns
is modified as a side
effect.
# see how knit_patterns is modified
knit_patterns$get()
#> $chunk.begin
#> NULL
#>
#> $chunk.end
#> NULL
#>
#> $chunk.code
#> NULL
#>
#> $inline.code
#> NULL
#>
#> $global.options
#> NULL
#>
#> $input.doc
#> NULL
#>
#> $ref.chunk
#> NULL
#>
#> $header.begin
#> NULL
#>
#> $document.begin
#> NULL
#>
pat_rnw()
knit_patterns$get()
#> $chunk.begin
#> [1] "^\\s*<<(.*)>>=.*$"
#>
#> $chunk.end
#> [1] "^\\s*@\\s*(%+.*|)$"
#>
#> $inline.code
#> [1] "\\\\Sexpr\\{([^}]+)\\}"
#>
#> $inline.comment
#> [1] "^\\s*%.*"
#>
#> $ref.chunk
#> [1] "^\\s*<<(.+)>>\\s*$"
#>
#> $header.begin
#> [1] "(^|\n)\\s*\\\\documentclass[^}]+\\}"
#>
#> $document.begin
#> [1] "\\s*\\\\begin\\{document\\}"
#>
knit_patterns$restore() # empty the list