Skip to contents

This RMarkdown output format is a drop-in replacement for hugodown::md_document(). Like the later, it is designed to generate markdown that is maximally compatible with Hugo. It intelligently generates a preview so that you see something useful when Hugo isn't running, but it doesn't get in the way of hugo's full-site preview when it is.


  toc = FALSE,
  toc_depth = 3,
  fig_width = 7,
  fig_asp = 0.618,
  use_boxes = FALSE,
  fig_retina = 2,
  tidyverse_style = TRUE,
  standalone = FALSE,
  includes = NULL,
  pandoc_args = NULL



TRUE to include a table of contents in the output


Depth of headers to include in table of contents


Figure width (in inches).


Figure aspect ratio, defaults to the golden ratio.


TRUE to allow the use of info, warn, and output boxes.


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.


Use tidyverse knitr conventions? This sets


Set to TRUE to include title, date and other metadata field in addition to Rmd content as a body.


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


Additional command line options to pass to pandoc


On top of the functionality of hugodown::md_document() four new arguments are available. use_boxes allows the use of expendable html boxes. standalone, includes and pandoc_args are adapted from rmarkdown::md_document() and allow additional content and command line options.

Syntax highlighting

md_document() uses a hybrid system for syntax highlighting. For R code it uses downlit. For other languages, it relies on Chroma, the syntax highlighter built into hugo.


For examples of how to include expandable boxes when the use_boxes argument is set to TRUE refer to the vignette("customize-boxes", package = "hugodownplus")