use csl-file for pdf-output in bookdown

前端 未结 1 809
执笔经年
执笔经年 2020-12-10 16:50

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

1条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-10 17:35

    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: |
            
  • A Minimal Book Example
  • after: |
  • Published with bookdown
  • 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" ]

    0 讨论(0)
提交回复
热议问题