A caption for a figure can be created in two ways: either directly when you
provide both text=
and image=
, or indirectly, when you call Figure()
within an R chunk with image=
not provided. In that case, the caption is
saved for later use, and fig()
retrieves it when needed. The label of the
figure is automatically set to the label of the chunk.
Figure(text = NULL, image = NULL, label = NULL, hold = NULL) fig(..., hold = FALSE) fig_id(label = NULL)
text | The text of the caption. It can contain Markdown formatting. |
---|---|
image | The Markdown code to include a figure like
|
label | The label to use (not required if the function is run from within an R chunk because the chunk label is used by default). |
hold | Should we save the caption for later use, and return invisibly?
Default value is |
... | Same arguments as for |
The caption with a code to number the figure is returned (invisibly, if
hold = TRUE
).
Figure("The official R logo.", " {width='80%'} ")#>