How can I specify pandoc's markdown extensions using a YAML block?

You can use Markdown Variants to do this in an Rmarkdown document. Essentially, you enter your extensions into a variant option in the YAML header block at the start of the your .Rmd file.

For example, to use grid tables, you have something like this in your YAML header block:

--- title: "Habits" author: John Doe date: March 22, 2005 output: md_document variant: markdown+grid_tables ---

Then you can compile to a PDF directly in pandoc by typing in your command line something like:

pandoc yourfile.md -o yourfile.pdf

For more information on markdown variants in RStudio: http://rmarkdown.rstudio.com/markdown_document_format.html#markdown_variants

For more information on Pandoc extensions in markdown/Rmarkdown in RStudio: http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html#pandoc_markdown


You can specify pandoc markdown extension in the yaml header using md_extension argument included in each output format.

---
title: "Your title"
output:
  pdf_document:
    md_extensions: +grid_tables
---

This will activate the extension. See Rmarkdown Definitive Guide for details.