Cat pandoc command to include a figure

quartorsv_cat_pandoc_fig(
  path,
  caption = NULL,
  label = NULL,
  args = NULL,
  force_cross_ref = TRUE,
  force_exists = TRUE
)

Arguments

path

character. Path to the figure.

caption

character. Caption of the figure.

label

character. Label of the figure. Need not supply #fig- prefix (but it will not be repeated if you do).

args

character. Additional arguments to be passed to pandoc.

force_cross_ref

logical. If TRUE, then will throw an error if either caption or label are NULL as these are both required for cross-referenceable figures in quarto. Default is TRUE.

force_exists

logical. Will throw an error if the file at path does not exist. Default is TRUE.

Examples

quartorsv_cat_pandoc_fig(
  path = "path/to/fig.png",
  caption = "Incredible hist() plot",
  label = "hist-plot",
  args = "width=50%",
  force_exists = FALSE
)
#> ![Incredible hist() plot](path/to/fig.png){#fig-hist-plot width=50%}