I would like to use a .csl
-file for formatting references with bookdown. Adding csl: some-style.csl
to index.Rmd
affects the output to gitbook
, but not to pdf_book
. I know that I can specify biblio-style
, but this only accepts some standard styles and not csl-files. Is there a proper workaround?
Steps to reproduce:
- Create new project with RStudio and choose "Book Project using bookdown" as option.
- Download some
.csl
file from https://www.zotero.org/styles and copy to root of project. - Add
csl: my_csl_file.csl
to the header inindex.Rmd
. - Build the book to pdf and html, and observe the differences in the references (either in the references section, or in the introduction)
Header in index.Rmd
:
---
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
bibliography: [book.bib, packages.bib]
csl: american-sociological-review.csl
link-citations: yes
description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
---