不可能在 R Sweave 中用 biblatex 引用
Impossible to cite with biblatex in R Sweave
我正在用 R Sweave 写报告,我想引用论文。这是我第一次使用 Sweave,但仅在 Latex 中,我曾经用 biblatex
来称呼我的参考书目。因此,我正在调用放置在我的 .Rnw 文件所在文件夹中的 .bib 文件。
这是我的代码:
\documentclass[11pt, twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber]{biblatex}
\addbibresource{references.bib}
\begin{document}
\SweaveOpts{concordance=TRUE}
test : \cite{helpman_globalization_2016}
\printbibliography
\end{document}
这是我要引用的论文(放在 references.bib
中):
@article{helpman_globalization_2016,
langid = {english},
title = {Globalization and {{Wage Inequality}}},
url = {http://www.nber.org/papers/w22944.pdf},
number = {22944},
journaltitle = {NBER Working Paper Series},
urldate = {2019-01-24},
date = {2016},
author = {Helpman, Elhanan},
doi = {10.3386/w22944}
}
我搜索了几个链接,但找不到解决方案:
https://tex.stackexchange.com/questions/71565/knitr-and-biblatex
https://texblog.org/2013/08/20/rknitr-automatic-bibliography-generation-with-biblatex-in-rstudio/
With knitr and .Rnw for LaTeX, how do you print the full bibliography in PDF output?
我也试过 backend = bibtex
但没用。
以下是描述问题的日志行(我认为):
LaTeX Font Info: ... okay on input line 8.
Package biblatex Info: Input encoding 'utf8' detected.
Package biblatex Info: Automatic encoding selection.
(biblatex) Assuming data encoding 'utf8'.
Package biblatex Info: Input encoding 'utf8' specified.
Package biblatex Info: Data encoding 'utf8' specified.
(biblatex) No need to reencode data.
\openout3 = `test_biblio-blx.bib'.
Package biblatex Info: Trying to load bibliographic data...
Package biblatex Info: ... file 'test_biblio.bbl' not found.
No file test_biblio.bbl.
有人有解决办法吗?
也在这里问:https://community.rstudio.com/t/impossible-to-cite-with-biblatex-in-r-sweave/35008
从我痴迷于谷歌搜索中看到的,您可以尝试在另一个程序中编译它并将 test_biblio.bbl
文件移动到工作目录中。
我尝试在我的 Texmaker 中使用您的示例执行此操作并且成功了。因此,当您想要查看引用时,只需在外部重新编译即可。
我正在用 R Sweave 写报告,我想引用论文。这是我第一次使用 Sweave,但仅在 Latex 中,我曾经用 biblatex
来称呼我的参考书目。因此,我正在调用放置在我的 .Rnw 文件所在文件夹中的 .bib 文件。
这是我的代码:
\documentclass[11pt, twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber]{biblatex}
\addbibresource{references.bib}
\begin{document}
\SweaveOpts{concordance=TRUE}
test : \cite{helpman_globalization_2016}
\printbibliography
\end{document}
这是我要引用的论文(放在 references.bib
中):
@article{helpman_globalization_2016,
langid = {english},
title = {Globalization and {{Wage Inequality}}},
url = {http://www.nber.org/papers/w22944.pdf},
number = {22944},
journaltitle = {NBER Working Paper Series},
urldate = {2019-01-24},
date = {2016},
author = {Helpman, Elhanan},
doi = {10.3386/w22944}
}
我搜索了几个链接,但找不到解决方案:
https://tex.stackexchange.com/questions/71565/knitr-and-biblatex
https://texblog.org/2013/08/20/rknitr-automatic-bibliography-generation-with-biblatex-in-rstudio/
With knitr and .Rnw for LaTeX, how do you print the full bibliography in PDF output?
我也试过 backend = bibtex
但没用。
以下是描述问题的日志行(我认为):
LaTeX Font Info: ... okay on input line 8.
Package biblatex Info: Input encoding 'utf8' detected.
Package biblatex Info: Automatic encoding selection.
(biblatex) Assuming data encoding 'utf8'.
Package biblatex Info: Input encoding 'utf8' specified.
Package biblatex Info: Data encoding 'utf8' specified.
(biblatex) No need to reencode data.
\openout3 = `test_biblio-blx.bib'.
Package biblatex Info: Trying to load bibliographic data...
Package biblatex Info: ... file 'test_biblio.bbl' not found.
No file test_biblio.bbl.
有人有解决办法吗?
也在这里问:https://community.rstudio.com/t/impossible-to-cite-with-biblatex-in-r-sweave/35008
从我痴迷于谷歌搜索中看到的,您可以尝试在另一个程序中编译它并将 test_biblio.bbl
文件移动到工作目录中。
我尝试在我的 Texmaker 中使用您的示例执行此操作并且成功了。因此,当您想要查看引用时,只需在外部重新编译即可。