insertfigure | R Documentation |
Formats the caption according to the output format.
For the short caption, you need this Lua Filter: https://github.com/pandoc/lua-filters/tree/master/short-captions
The function EZfigure()
is a wrapper function for insertfigure(..., label = knitr::opts_current$get("label"), path = knitr::fig_chunk(knitr::opts_current$get("label"), ext = "png"), unlisted = FALSE, ext = "png", auto_pdf = TRUE)
. By default, the file path from the previous chunk is used.
insertfigure(
path,
caption,
label = NULL,
shortcaption = NULL,
unlisted = FALSE,
ext = "png",
auto_pdf = getOption("knitr.graphics.auto_pdf", FALSE)
)
EZfigure(caption, shortcaption = NULL)
path |
Full path to the image file (with extension), default is the path to the figure of the last chunk |
caption |
A character vector containing the (long) caption of the figure. |
label |
An optional character vector containing the label used for referencing. |
shortcaption |
An optional character vector containing the short caption. |
unlisted |
Either |
ext |
The file extension, defaults to |
auto_pdf |
Whether to use PDF images automatically when the output format is LaTeX. If |
Command to insert a figure in Markdown
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.