PeterSmith.Org

Citations in bookdown

    I using the bookdown package, to produce my coursebook for BUSINESS 705.

    Everything was looking good until I realised my in-text citations were not looking right when I published the 'book' to my website. Instead of APA citations like (Huff, 2009), I was getting (Huff 2009); the comma was missing. Also, page numbers were not displaying correctly.

    At first I thought I could add biblio-style: apalike to the YAML for the book, but that—it seems—only affects things going to Latex/PDF.

    My next option was to look at raising an issue on GitHub, but that suggested I checkout StackOverflow first. No luck there, but I began to wonder if I could do something with the CSL file. On the RStudio site, I found a reference to specifying the CSL file in RMarkdown files.

    So, in the YAML header of my book I added:

    
    csl: apa.csl

    After placing a copy of apa.cls in the working directory of my book, all it took was a quick, build and deploy and my citations were beautifully styled as per APA.


    Webmentions
    If you webmention this page, please let me know the URL of your page.

    BTW: Your webmention won't show up until I next "build" my site.

    Word count: 200 (about 1 minutes)

    Published:

    Updated: 31 May '17 11:35

    Author: Peter Smith

    Permalink: https://petersmith.org/blog/2017/05/31/citations-in-bookdown/

    Section: blog

    Kind: page

    Bundle type: leaf

    Source: blog/2017/05/31/citations-in-bookdown/index.org