figure captions, references using knitr and markdown to html

前端 未结 5 799
迷失自我
迷失自我 2020-12-05 04:00

I\'m writing an Rmd file, to be processed by knitr into HTML. It contains some R chunks that generate figures, which get stored as data URIs in HTML.

1) How do I add

5条回答
  •  我在风中等你
    2020-12-05 04:40

    1. You can create the figure numbers with a simple counter in R; see one example here. The problem is whether the markdown renderer will render the figure caption for you: R Markdown v1 won't, but v2 (based on Pandoc) will.
    2. I do not know. There is no direct way to insert a label as an identifier for figures, so it is probably not possible to cross reference figures with pure Markdown. Once you've got issues like this, think (1) do I really need it? (2) if it is intended to be a document with a complicated structure, I think it is better to use LaTeX directly (Rnw documents).

提交回复
热议问题