我正在为一份需要补充材料的期刊写文章。我希望使用一个独特的标签,比如SuppMat:
,而不是默认的fig:
来将图表发送到这个部分。如果不行,我可以使用默认的fig
标签,但我需要在补充材料部分重新开始编号。
我知道有一个使用LaTeX的答案(在这里找到),但我必须在导出到docx
时完成。下面是使用officedown
的可重现示例。
---
output:
officedown::rdocx_document
---
```{r setup, include=FALSE}
pacman::p_load(knitr, officedown, officer)
knitr::opts_chunk$set(echo = FALSE,
eval = TRUE,
fig.cap = TRUE)
```
# Main Text
Please see Supplementary Figure \@ref(fig:appendix-fig1) and Figure \@ref(fig:main-fig1).
```{r fig.id="main-fig1", fig.cap="This should be labelled **Figure 1**"}
barplot(1:5, col=1:5)
```
```{r tab.id="main-tab1", tab.cap="Main Text Table 1"}
head(mtcars)
```
\newpage
# Supplementary Materials {#SuppMat}
```{r fig.id="appendix-fig1", fig.cap="This figure should be labelled **Supplementary Figure 1**"}
barplot(1:5, col=1:5)
```
```{r tab.id="appendix-tab1", tab.cap="Should be labelled **Supplementary Table 1**"}
head(mtcars)
```