Use Csl-File for PDF-Output in Bookdown

use csl-file for pdf-output in bookdown

I had the same problem. The following procedure worked for me:

  1. Create new project with RStudio and choose "Book Project using
    bookdown" as option.
  2. Download some .csl file from https://www.zotero.org/styles and copy to root of project. In my case: chicago-author-date-de.csl
  3. Set in _output.yml citation_package: none
  4. Add in all formats (gitbook, pdf_book, epub_book) in _output.yml the line pandoc_args: [ "--csl", "chicago-author-date-de.csl" ]
  5. Delete or comment out in index.Rmd the line biblio-style: apalike
  6. Replace the content of 06-references.Rmd with # References {-}

Here is my _output.yml file:

bookdown::gitbook:
css: style.css
pandoc_args: [ "--csl", "chicago-author-date-de.csl" ]
config:
toc:
before: |
<li><a href="./">A Minimal Book Example</a></li>
after: |
<li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
download: ["pdf", "epub"]
bookdown::pdf_book:
includes:
in_header: preamble.tex
latex_engine: xelatex
citation_package: none
pandoc_args: [ "--csl", "chicago-author-date-de.csl" ]
keep_tex: yes
bookdown::epub_book:
pandoc_args: [ "--csl", "chicago-author-date-de.csl" ]

how to specify a csl bibliography style on bookdown

You probably missed two lines:

  • Set in _output.yml citation_package: none
  • Add in all formats (gitbook, pdf_book, epub_book) in _output.yml the line pandoc_args: [ "--csl", "chinese-gb7714-2005-numeric.csl" ]

See the full procedure at use csl-file for pdf-output in bookdown

How to change to another bibliography style in Bookdown

  • Download your .csl file from https://www.zotero.org/styles?q=nature
    and copy it to the root of your project.
  • Set in _output.yml citation_package: none
  • Add in all formats (gitbook, pdf_book,
    epub_book) in _output.yml the line pandoc_args: [ "--csl",
    "your-csl-file.csl" ]
  • Delete or comment out in index.Rmd the line biblio-style: apalike

See for the full procedure use csl-file for pdf-output in bookdown

Changing Chapter colors in r bookdown (pdf output)

ekstroem put me on the right track to use the sectsty package. I tried using \chapternumberfont from the sectsty package, which didn't work. I think Bookdown doesn't set the name for the chapter number to this particular name. I found a workaround that worked, by using setting the entire chapter to grey, and then setting the chapter title to black:

\usepackage{xcolor}
\usepackage{sectsty}
\definecolor{battleshipgrey}{rgb}{0.52, 0.52, 0.51}
\chapterfont{\color{battleshipgrey}}
\chaptertitlefont{\color{black}}

Set space between Reference items in Rmarkdown biblography using csl-file

Found it, in

CSL use:

<bibliography entry-spacing = "2" >

Questions about referencing figures in R Markdown (PDF output)?

You have not provided your YAML header, but I think there is the problem. It should have the following line:

--- 
output:
bookdown::pdf_document2
---

You can not use the features of bookdown without loading the templates from the package.



Related Topics



Leave a reply



Submit