我使用bookdown以html和pdf生成文档。我怎样才能在表格的标题中插入对文档部分的引用?如何在可同时用于pdf和html输出的bookdown文档的表格标题中插入引用
使用\\ref{sec:FirstSection}
正常工作与pdf_book(但不gitbook):
---
title: "Test"
output: bookdown::pdf_book
---
# A section {#sec:FirstSection}
The dataset in Table \@ref(tab:aTable) contains some data.
# Another section
```{r, aTable, echo = FALSE}
knitr::kable(
cars[1:5, ],
caption = "See Section \\ref{sec:FirstSection}."
)
```
同时使用\\@ref(sec:FirstSection)
正常工作与gitbook(但不pdf_book)
---
title: "Test"
output: bookdown::gitbook
---
# A section {#sec:FirstSection}
The dataset in Table \@ref(tab:aTable) contains some data.
# Another section
```{r, aTable, echo = FALSE}
knitr::kable(
cars[1:5, ],
caption = "See Section \\@ref(sec:FirstSection)."
)
```