crmda_html_document {stationery}R Documentation

Custom output_format object to make MathJax work with custom HTML template

Description

The rmarkdown::html_document fails to use MathJax if a custom HTML template is supplied. This is described here https://github.com/rstudio/rmarkdown/issues/727. The workaround is to provide this wrapper.

Usage

crmda_html_document(template = "theme/guide-template.html", ...)

Arguments

template

Name of template file.

...

Any arguments passed along to html_document in rmarkdown

Details

This function is needed only so as to "fool" pandoc in order to make an HTML document compatible with MathJax. See the example files created by initWriteup("rmd2html-guide") for a usage example.

Value

html_document object with custom template

Author(s)

Paul Johnson

Examples

tdir <- tempdir()
doctype <- "rmd2html-guide"
dirout <- initWriteup(doctype, dir = file.path(tdir, doctype))
list.files(dirout)
MESSG <- paste("Inspect the YAML header output section of 'skeleton.Rmd'.",
               "It makes use of 'crmda_html_document'.")
cat(MESSG)

[Package stationery version 1.1 Index]