use csl-file for pdf-output in bookdown
I had the same problem. The following procedure worked for me:
- 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. In my case:
chicago-author-date-de.csl
- Set in _output.yml
citation_package: none
- Add in all formats (gitbook, pdf_book, epub_book) in _output.yml the line
pandoc_args: [ "--csl", "chicago-author-date-de.csl" ]
- Delete or comment out in index.Rmd the line
biblio-style: apalike
- 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 linepandoc_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
Using Functions and Environments
Replace Nan Values in a List with Zero (0)
Change Color Median Line Ggplot Geom_Boxplot()
How to Measure Area Between 2 Distribution Curves in R/Ggplot2
Rcurl: Http Authentication When Site Responds with Http 401 Code Without Www-Authenticate
How to Add Annotation on Each Facet
R Ggplot2 Boxplots - Ggpubr Stat_Compare_Means Not Working Properly
Resetting Cumsum If Value Goes to Negative in R
Makecluster Function in R Snow Hangs Indefinitely
Updating a Subset of a Dataframe
Ggplot2: Fill Color Behaviour of Geom_Ribbon
Package Domc Not Available for R Version 3.0.0 Warning in Install.Packages
Removing Traces by Name Using Plotlyproxy (Or Accessing Output Schema in Reactive Context)
R: Saving Ggplot2 Plots in a List
Using R - Delete Rows When a Value Repeated Less Than 3 Times
R Remove Multiple Text Strings in Data Frame
Make List of Objects in Global Environment Matching Certain String Pattern