【发布时间】:2020-06-15 14:59:08
【问题描述】:
当我导出带有以乳胶编码的重音符号的 .bib 引用时(例如,它们是从 mendeley 导出的),它们看起来不像预期的那样可以在 R 中进行进一步的独立处理。
我的文件.bib:
@misc{Llorens1980,
abstract = {Aunque el reactor de fusi{\'{o}}n termonuclear constituye la esperanza m{\'{a}}s s{\'{o}}lida de obtenci{\'{o}}n de energ{\'{i}}a a gran escala, los problemas f{\'{i}}sicos y tecnol{\'{o}}gicos que el mismo plantea son muchos y dif{\'{i}}ciles.},
author = {Llorens, Mart{\'{i}}n and Menzell, Alfred and Villarrubia, Miguel},
booktitle = {Investigaci{\'{o}}n y Ciencia (Scientific American)},
keywords = {INGENIER{\'{I}}A NUCLEAR},
number = {51},
pages = {1--5},
title = {{F{\'{i}}sica y tecnolog{\'{i}}a del reactor de fusi{\'{o}}n}},
volume = {DICIEMBRE},
year = {1980}
}
在 R 中:
testbibR <- RefManageR::ReadBib("myfile.bib")
testbibR$author
[1] "Mart\\'in Llorens" "Alfred Menzell" "Miguel Villarrubia"
testbibR$title
[1] "{F{\\'{i}}sica y tecnolog{\\'{i}}a del reactor de fusi{\\'{o}}n}"
btex<-bibtex::read.bib("myfile.bib")
btex$author
[1] "Mart\\'in Llorens" "Alfred Menzell" "Miguel Villarrubia"
btex$title
[1] "{F{\\'{i}}sica y tecnolog{\\'{i}}a del reactor de fusi{\\'{o}}n}"
testbib <- bib2df::bib2df("myfile.bib")
testbib$AUTHOR[[1]]
[1] "Llorens, Mart{\\'{i}}n" "Menzell, Alfred" "Villarrubia, Miguel"
testbib$TITLE
[1] "F{\\'{i}}sica y tecnolog{\\'{i}}a del reactor de fusi{\\'{o}}n"
我想知道我是否可以在那些地方看到Martín
相关帖子:https://github.com/ropensci/bib2df/issues/35
顺便说一句,在导入/导出这些围兜时,包似乎以(其他)乳胶格式重写,作者字段(Mart\'in)。只有bib2df 将所有字段写入原始字段,见上文。
RefManageR::WriteBib(testbibR,"refmanager.bib")
bibtex::write.bib(btex,"bibtex.bib")
bib2df::df2bib(testbib,"bib2df")
【问题讨论】:
-
我不熟悉任何用于 R 的 TeX 到 Unicode 转换器。您可能只需要手动替换您关心的 unicode 字符。