# Configure R Studio to use Biber for APA on Beamer Slides (Biblatex + Biber + R Studio + MiKTeX) [duplicate]

I'm trying to generate with R Studio a beamer presentation that uses backend=biber option.

Here is my MWE:

\documentclass{beamer}
\usepackage[american]{babel}
\usepackage{csquotes}
%apa requires biber
\usepackage[style=apa, backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}

%create file in house
\begin{filecontents}{refs.bib}
@Article{fakecite,
author =   {ACME Inc.},
title =    {\LaTeX the Destroyer},
journaltitle = {JSS},
date =     {2014}}

@Manual{textbook,
author =  {Newman Newday},
title =   {Rock n Roll},
year =    {2001}}

\end{filecontents}

\bibliography{refs}

\begin{document}
\being{frame}

\frametitle{Captain America}
A fake citation \parencite{fakecite}.

\end{frame}

\begin{frame}
\printbibliography
\end{frame}
\end{document}


The error message I am receiving is:

LaTeX Warning: File refs.bib' already exists on the system.
Not generating it from this source.


The output that is displayed is two frames. The first frame only has the keywords to access bib citations in bold font. The second slide is blank.

I have MikTeX v2.9 x64 bit, R Studio 0.98.766, and biblatex-apa v6.5 installed.

So far, what I've done is:

1. Downloaded biber from http://sourceforge.net/projects/biblatex-biber/, moved it into C:\Program Files\MiKTeX 2.9\miktex\bin\x64 , and ran "Refresh FNDB" in MiKTeX Settings (Admin) so that MiKTeX knows biber exists.

2. I've used the following R Script to ensure the right directory is acted upon:

setwd("~/Presentation") Sys.setenv(TEXINPUTS=getwd(), BIBINPUTS=getwd(),BSTINPUTS=getwd())

3. Ran compile to pdf once. The error was then generated. Ran compile to pdf again. Same error. (bibtex's apacite normally required two runs.)

4. Deleted refs.bib, bibexample.nav, bibexample.bbl, bibexample.bcf, bibexample.run, bibexample.snm, bibexample.syntax, & bibexample.toc. Then run compile to pdf again. Same error is generated.

5. Read biblatex-apa: undefined references . Noticed that in C:\Program Files\MiKTeX 2.9\tex\latex\biblatex-apa\apa.bbx the command causing errors in previous post was present ( \RequireBiber[3] ). I changed the command based on the responses left on that post to \RequireBiber[2] and then \RequireBiber[1] to no avail.

6. I've also tried to reproduce the following posts to no avail: APA6 and Beamer and BibLaTex and Problem with APA + biber + biblatex

Any help would be appreciated.

## marked as duplicate by Johannes_B, Masroor, Svend Tveskæg, Mico, MalipivoDec 6 '14 at 15:38

• Welcome to TeX SE! Can you not call it something other than refs.bib? Try jobname.bib assuming your source file has a suitable name. filecontents is refusing to write refs.bib because this filename is apparently already known on your system. Or is R studio doing this due to some misguided protection feature? – cfr Jun 3 '14 at 0:10
• Thanks for the welcome! Switching it yields the same warning except it now displays as "jobname.bib" is already on the system. Removing the auto-generation leads to a new issue being: Package biblatex Warning: Patching footnotes failed. (biblatex) Footnote detection will not work. @cfr – coatless Jun 3 '14 at 0:15
• I imagine the first problem must be something R studio specifically is doing i.e. it is protecting any existing bib from being overwritten. (Or you have some generic file protection mechanism doing this.) Removing auto-generation will probably work. Those are warnings, not errors. They may or may not be problematic depending on what you are trying to do. – cfr Jun 3 '14 at 0:21
• Going further in the file: LaTeX Warning: There were undefined references. Package biblatex Warning: Please (re)run Biber on the file: (biblatex) bibtex (biblatex) and rerun LaTeX afterwards. So, it seems as if the compile is only running once? – coatless Jun 3 '14 at 0:46
• You have to run biber or tell R Studio. Then you have to rerun latex or pdflatex`. Or tell R Studio to run everything. – cfr Jun 3 '14 at 0:58