给出以下可重现的示例:
---
title: "pdf output by user defined tex template"
output:
pdf_document:
template: default.latex
#bibliography: bib.bib
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# About Pandoc metadata
https://pandoc.org/MANUAL.html#variables-for-latex
# Default tex templates
https://bookdown.org/yihui/rmarkdown-cookbook/latex-template.html
The default LaTeX template of Pandoc can be found at.
https://github.com/jgm/pandoc/tree/master/data/templates (named default.latex).
If you want to create your own template, you may want to start with this template.
# A reference to be cited in bibliography
here it is: @R-base
# References
- 当我取消注释"bibliography"yaml元数据时,我得到以下错误:
好了!LaTeX错误:有些地方不对劲--可能是遗失了一件物品.
另一方面:
- 当我注释掉"模板"yaml元数据,但不注释"参考书目"时,我得到了相关部分中参考文献的正确列表
我使用的模板(从开始)是PanDoc的默认LaTeX模板,可在以下位置找到: https://github.com/jgm/pandoc/blob/main/data/templates/default.latex个
BIB文件仅包含以下条目:
@Manual{R-base,
title = {R: A Language and Environment for Statistical
Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2019},
url = {https://www.R-project.org},
}
我的问题是:
在用户定义的"模板"的情况下,如何获得正确的引用列表(稍后我计划使用其他变量根据我的需要进行定制)?
我应该在模板文件中输入一些内容吗? 最终会怎样做呢?
如有任何帮助,非常感谢