我想在图形标题中引用一篇文章。我尝试在块选项中使用Rmarkdown / pandoc[@citekey]
和乳胶\\citep{citekey}
形式,但fig.cap
没有任何运气。
这是一个可重现的示例:
---
output:
rmarkdown::tufte_handout
references:
- id: Nobody06
title: 'My Article'
author:
- family: Nobody
given: Jr
issued:
year: 2006
---
Some text [@Nobody06].
```{r figure, fig.cap="A figure [@Nobody06]"}
library(ggplot2)
qplot(1:10, rnorm(10))
```
# References
这会在文本块中产生正确的引用,但是在图形标题中会[@Nobody06]
(当我使用RMarkdown表单时)或(?)
(当我使用Latex表单时)。
有谁知道是否可以在fig.cap
现场使用引文?
该bookdown包扩展rmarkdown的功能,并提供了一些有用的工具。文本引用可用于解决此问题。如软件包作者所述,可以使用文本引用:
您可以将一些文本分配给标签,并使用文档中其他位置的标签来引用文本。
如下所示,这对于引用非常有效:
---
output: bookdown::tufte_handout2
references:
- id: Nobody06
title: 'My Article'
author:
- family: Nobody
given: Jr
issued:
year: 2006
---
(ref:crossref) Some text [@Nobody06].
```{r figure, fig.cap="(ref:crossref)"}
library(ggplot2)
qplot(1:10, rnorm(10))
```
# References
您会注意到,输出格式已调整为bookdown::tufte_handout2
允许书本功能正常工作的格式。您可以在此处找到输出格式的完整列表。
在此处阅读有关文本参考的更多信息:https : //bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#text-references
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句