6.2 Use a custom HTML template
We mentioned LaTeX templates in Section 5.4. You can also specify a custom HTML template for Pandoc to convert Markdown to HTML. Below is a brief example template:
You can see that the template contains a few variables such as
$body$. You can find the full list of Pandoc variables and their meanings at https://pandoc.org/MANUAL.html#templates.
<head> area. To apply a template to an Rmd document, you can save the template to a file, and pass the file path to the
template option of
The rmarkdown package uses a custom HTML template shipped with the package, which is different from Pandoc’s default template. To use the latter, you can specify