【发布时间】:2021-03-25 14:58:56
【问题描述】:
我正在尝试使用 Rmarkdown 来自动标记 Figure 的标题,但我希望它不是 Figure 1,而是 Figure S1,即只是在那里添加 S。 An example here 和 here 表明使用 pdf 输出是不可能的。好的,我对 .doc 文件很好,但我的图形标题仍然没有打印出来?我想知道有什么问题吗?
R 降价的最小示例:
---
title: Supporting Information
subtitle: "Iron(I) etc"
author: "Some people here"
abstract: "Added the addresses here since there is no abstract in the SI"
output:
word_document:
fig_caption: yes
---
```{r, include=F}
library(captioner)
figS<- captioner(prefix = "Figure S", auto_space = TRUE, levels = 1, type = NULL, infix = ".")
figS("Figure S1", "Single-crystal X-ray structure of some text (1)", display=FALSE)
```
```{r Xray, fig.cap=figS("This is my figure description"), echo=FALSE}
plot(cars)
```
这会正确打印出Figure S1。但是,现在我的实际人物描述不见了?
我想要的输出是 pdf,但如果不是,我可以用 word 来做。感谢您提出如何解决此问题的建议!
【问题讨论】:
-
我编辑了答案以删除
S和数字之间的空格。所以,现在我们有Figure S1而不是Figure S 1
标签: latex r-markdown knitr