我正在尝试将我的出版物放到R-Markdown中,特别是通过使用rticles包,但是我遇到了引用方面的问题。目标是让natbib选项运行,这样引用就不会被pandoc“硬编码”了。
我熟悉本网站的以下主题及其参考资料,但这并不能提供解决方案:natbib-seems-to-not-work-properly-with-pdf-book-rticles
每当我在使用natbib选项时“编织”这篇文章时,我的引用仍然没有定义。我能够找到的唯一解决方案是通过keep_tex: true选项并在编译后手动添加\bibliography命令。我无法想象,这真的是必需的,使引文发挥作用。
我尝试过的,也是我能想到的最好的是下面发布的对rticles提供的模板的修改。我发现让它运行的唯一方法实际上是打开生成的.tex文件,在\end{document}之前添加行\bibliography{mybibfile},这不能像预期的那样。
有人能复制我的问题吗,我只是遗漏了什么,还是这个问题更多的是在包方面?
---
title: Short Paper
author:
- name: Alice Anonymous
email: alice@example.com
affiliation: Some Institute of Technology
footnote: Corresponding Author
address:
- code: Some Institute of Technology
address: Department, Street, City, State, Zip
journal: "An awesome journal"
date: "`r Sys.Date()`"
bibliography: mybibfile.bib
output:
bookdown::pdf_book:
citation_package: natbib
base_format: rticles::elsevier_article
number_sections: yes
keep_tex: true
---
Bibliography styles
===================
Here are two sample references: @Feynman1963118 [@Dirac1953888].
References {#references .unnumbered}
==========使用以下mybibfile.bib
@article{Dirac1953888,
title = "The lorentz transformation and absolute time",
journal = "Physica ",
volume = "19",
number = "1-–12",
pages = "888--896",
year = "1953",
doi = "10.1016/S0031-8914(53)80099-6",
author = "P.A.M. Dirac"
}
@article{Feynman1963118,
title = "The theory of a general quantum system interacting with a linear dissipative system",
journal = "Annals of Physics ",
volume = "24",
pages = "118--173",
year = "1963",
doi = "10.1016/0003-4916(63)90068-X",
author = "R.P Feynman and F.L {Vernon Jr.}"
}发布于 2019-04-26 14:49:09
有时参考部分不会出现,因为在通过LaTeX从RMarkdown编织PDF时没有指定书目样式。根据正式文件,您可以在YAML部分中设置如下所示的biblio-style:
bibliography: mybibfile.bib
biblio-style: apa #whatever style you want发布于 2021-08-24 21:19:41
在rmd文件末尾添加\bibliography{mybibfile}也是有效的。
https://stackoverflow.com/questions/55513126
复制相似问题