我正在尝试关注this blog帖子,以便为我的每个出版物自动生成.md
文件,以供blogdown
使用。帖子中的函数使用包RefManageR
从BibTeX文件中读取条目,并为每个条目创建一个.md
文件。
我的问题是,即使我竭尽全力以UTF-8编码保存RefManageR
并在对{{1 }}。
例如:我使用Zotero通过将集合导出到具有UTF-8编码的BibTeX来生成.bib
。它在我的ReadBib
中提供了以下条目:
.bib
如您所见,作者姓名之一(Gonzálezdel Pliego)带有重音。我通过在RStudio中打开(检查字符是否正确显示)来检查编码,并确定我会执行“使用编码保存”。无论我做什么,当我像这样将.bib
读入R时:
@article{senior_pantropical_2017,
title = {A pantropical analysis of the impacts of forest
degradation and conversion on local temperature},
volume = {7},
issn = {2045-7758},
doi = {10.1002/ece3.3262},
number = {19},
journal = {Ecology and Evolution},
author = {Senior, Rebecca A. and Hill, Jane K. and González del
Pliego, Pamela and Goode, Laurel K. and Edwards, David P.},
month = oct,
year = {2017},
pages = {7897--7908}
}
它总是这样显示:
.bib
为什么á显示为Ã?我尝试了各种包和函数(ReadBib('path/to/refs.bib', .Encoding = "UTF-8")
,[1] R. A. Senior, J. K. Hill, P. González del Pliego, et al. “A pantropical analysis of the impacts of forest degradation and conversion on local temperature”. In: _Ecology and Evolution_7.19 (Oct. 2017), pp. 7897-7908. ISSN: 2045-7758. DOI: 10.1002/ece3.3262.
和RefManageR::ReadBib
)以及指定和检查编码的各种不同方式。我无法手动排版字符(例如bibtex::read.bib
),因为我的一些出版物中有 lot 位作者。不确定如何继续。
答案 0 :(得分:0)
我使用bib2df::bib2df()
来读取UTF-8编码的bibtex文件。
options(encoding="UTF-8")
bib_df <- bib2df("publications.bib")
它对我有用。