Format for converting from R Markdown to another variant of markdown (e.g. strict markdown or github flavored markdown)

  variant = "markdown_strict",
  preserve_yaml = FALSE,
  toc = FALSE,
  toc_depth = 3,
  number_sections = FALSE,
  fig_width = 7,
  fig_height = 5,
  fig_retina = NULL,
  dev = "png",
  df_print = "default",
  includes = NULL,
  md_extensions = NULL,
  pandoc_args = NULL,
  ext = ".md"



Markdown variant to produce (defaults to "markdown_strict"). Other valid values are "commonmark", "markdown_github", "markdown_mmd", markdown_phpextra", or even "markdown" (which produces pandoc markdown). You can also compose custom markdown variants, see the pandoc online documentation for details.


Preserve YAML front matter in final document.


TRUE to include a table of contents in the output


Depth of headers to include in table of contents


TRUE to number section headings


Default width (in inches) for figures


Default height (in inches) for figures


Scaling to perform for retina displays. Defaults to NULL which performs no scaling. A setting of 2 will work for all widely used retina displays, but will also result in the output of <img> tags rather than markdown images due to the need to set the width of the image explicitly.


Graphics device to use for figure output (defaults to png)


Method to be used for printing data frames. Valid values include "default", "kable", "tibble", and "paged". The "default" method uses a corresponding S3 method of print, typically The "kable" method uses the knitr::kable function. The "tibble" method uses the tibble package to print a summary of the data frame. The "paged" method creates a paginated HTML table (note that this method is only valid for formats that produce HTML). In addition to the named methods you can also pass an arbitrary function to be used for printing data frames. You can disable the df_print behavior entirely by setting the option rmarkdown.df_print to FALSE. See Data frame printing section in bookdown book for examples.


Named list of additional content to include within the document (typically created using the includes function).


Markdown extensions to be added or removed from the default definition or R Markdown. See the rmarkdown_format for additional details.


Additional command line options to pass to pandoc


Extention of the output document (defaults to ".md").


R Markdown output format to pass to render


See the online documentation for additional details on using the md_document format.

R Markdown documents can have optional metadata that is used to generate a document header that includes the title, author, and date. For more details see the documentation on R Markdown metadata.


if (FALSE) {

render("input.Rmd", md_document())

render("input.Rmd", md_document(variant = "markdown_github"))