【发布时间】:2021-08-07 18:55:06
【问题描述】:
我正在使用 Knitr 编写报告,并尝试使用 bookdown 自动编号并参考它们。
这是我的标题:
---
title: "My title"
author: "Me"
email: "My email"
output:
bookdown::html_document2:
number_sections: true
toc : true
fig_caption : TRUE
---
```{r setup, include=FALSE}
library(bookdown)
knitr::opts_chunk$set(echo = TRUE)
setwd(dir=dirname(rstudioapi::getActiveDocumentContext()$path))
```
And my first figure :
```{r fig1,echo=F, eval=T, fig.align = 'center', fig.cap="My first figure"}
knitr::include_graphics(here::here("images", "Formule 3.png"))
```
当我编织它时,我可以看到我的身影,但在它下面,我可以看到:
(#fig:fig1)我的第一张图
我预计:
图1:我的第一个图
当我删除代码块中的 fig1 时,我得到一个自动编号,但我不知道如何引用它,因为我没有任何引用。
谁能解释我做错了什么?
提前谢谢你。
最好的问候,
让-卢克。
【问题讨论】:
-
我无法重现您的问题,并且我得到了正确的数字编号,例如
Figure 1。您介意将sessionInfo()和rmarkdown::pandoc_version()的结果添加到您的帖子吗?
标签: html numbers knitr figure bookdown