Impossible to cite with biblatex in R Sweave

I am writing a report with R Sweave and I would like to cite papers. It is the first time I use Sweave, but in Latex alone I used to call my bibliography with biblatex. Therefore, I'm calling the .bib file placed in the folder where my .Rnw file is.

Here's my code :

\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}

and here's the paper I want to cite (placed in 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}
} 

I searched in several links but I couldn't find a solution :

I also tried with backend = bibtex but it didn't work.
Here are the lines of the log describing the problem (I think) :

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.

Does anybody have a solution ?

Also asked here : https://stackoverflow.com/questions/56960392/impossible-to-cite-with-biblatex-in-r-sweave

1 Like

Solved : the solution is to :

  • compile the .Rnw file with R Sweave. You will get warnings/badboxes
  • compile the .tex file (created by Sweave) with another tex program (texstudio, kile...). That will create the .bbl file
  • recompile the .Rnw file with R Sweave
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.