commonmark_document {RmdConcord}R Documentation

R Markdown drivers to add concordance

Description

These drivers replace the like-named rmarkdown or markdown drivers with ones that output Commonmark rather than Pandoc Markdown. Commonmark is a dialect of Markdown. The Pandoc driver for Commonmark supports output of source position information. By using this function as your output driver, you can get that in your own documents.

A replacement for markdown::latex_format is not planned; see the note below.

Usage

html_documentC(sourcepos = TRUE, ...)
html_vignetteC(sourcepos = TRUE, ...)
pdf_documentC0(latex_engine = "pdflatex",
           sourcepos = TRUE,
           defineSconcordance = TRUE,
           ...)
html_formatC(options = list(sourcepos = TRUE), ...)

Arguments

latex_engine

Command to convert ‘.tex’ file to ‘.pdf’.

defineSconcordance

If TRUE, insert a definition of the ⁠\Sconcordance⁠ macro just before ⁠\begin{document}⁠.

sourcepos

Whether to include source position information.

options

The options argument to pass to the base driver. If options$sourcepos is not specified, it will default to TRUE.

...

Other arguments to pass to the base driver.

Details

Each driver modifies the standard driver from rmarkdown or markdown, e.g. html_documentC is similar to html_document, but uses Commonmark and adds concordances.

Value

An R Markdown output format object which will add concordance information.

Note

The pdf_documentC0 function adds the concordances, but they won't be interpreted by LaTeX or PDF previewers. To get that to happen, use patchDVI::pdf_documentC.

The html_formatC function requires markdown version 1.12.1 or higher. If a lower version of that package is installed html_formatC will still run, but will issue a warning and not add any concordances.

The concordances produced by html_formatC tend to be off by a few lines as the underlying Commonmark processor only issues source position records once per paragraph.

A latex_formatC driver appears as if it would be quite messy and is not currently planned. The issues are:

Author(s)

Duncan Murdoch


[Package RmdConcord version 0.3 Index]