I am trying to compile a PDF Output with an R Markdown file and build my bibliography with the biblatex package and using R Studio.
Here are my code/files
in index.Rmd
---
title: |
Hello World!
author: |
Juan Pérez
bibliography: refs.bib
---
# Intro
Lorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum.
[@Somoza1968]
In a separate file I have _output.yml file:
bookdown::pdf_document2:
latex_engine: lualatex
includes:
in_header: preamble.tex
keep_tex: yes
citation_package: biblatex
In a separate file I have Refs.bib:
@Book{Somoza1968,
title = {Argentina, la mortalidad según tablas de vida de 1914, 1946-1948 y 1959-1961},
publisher = {CELADE},
year = {1968},
author = {Somoza, Jorge L.},
address = {Santiago},
timestamp = {2018-07-03},
type = {Book},
}
And preamble.tex
\usepackage[]{biblatex}
Without any other options, it works, but every time that I want to add an option to biblatex (for example style=alphabetic) I get this error message:
tlmgr search --file --global '/biblatex-dm.cfg'
! LaTeX Error: Option clash for package biblatex.
Error: Failed to compile index.tex. See index.log for more info.
In addition: Warning message:
In parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) :
Failed to find a package that contains biblatex-dm.cfg
Execution halted
Any ideas what could be the problem? Do I need a specific configuration for R Studio? Any suggestion of which one could be the best practice to build a customized bibliography using R Markdown, is welcome.
biblatexpackage when you saycitation_package: biblatexin the.ymlfile. If you then load it again with different options inpreamble.texyou get an option clash, since packages can't be loaded multiple times with different options. Maybe it helps to turn off the inclusion ofbiblatexin the.ymlfile but I don't know if Biber is run in that case. – moewe Sep 04 '18 at 04:36.texfile, but even without it, it was fairly straightforward to deduce what was going on. In future questions about R markdown and friends it might still be a good idea to provide the intermediate.texcode produced by markdown so the problem can be analysed more easily. – moewe Sep 04 '18 at 12:38