如何在 bookdown 上指定 csl 参考书目样式

how to specify a csl bibliography style on bookdown

如何在 bookdown 中文中指定 csl 参考书目样式 Bookdown Chinese example, for example a zotero one CSL

我下载了csl文件到工作目录,并在index.Rmd YAML header中指定为

bibliography: book.bib    
biblio-style: chinese-gb7714-2005-numeric

bibliography: book.bib
biblio-style: chinese-gb7714-2005-numeric.csl

但 Rstudio 提示我:

Error: Failed to build the bibliography via bibtex
Please delete bookdown.Rmd after you finish debugging the error.
Execution halted

Exited with status 1.

当我把它改成

bibliography: book.bib
csl: chinese-gb7714-2005-numeric

bibliography: book.bib
csl: chinese-gb7714-2005-numeric.csl

我可以制作这本书,但是参考列表样式不是 CSL 期望的样式。

所有 YAML header

--- 
title: "题名"
author: "姓名"
date: "`r Sys.Date()`"
bibliography: book.bib
description: "矮脚黄"
documentclass: ctexbook
geometry:
- b5paper
- tmargin=2.5cm
- bmargin=2.5cm
- lmargin=3.5cm
- rmargin=2.5cm
github-repo: yihui/bookdown-chinese
indent: 2m
link-citations: yes
lof: no
lot: no
colorlinks: yes
site: bookdown::bookdown_site
biblio-style: unsrt
whitespace: none
---

更新:

今天发现参考章节header不正确。它应该是 "Reference" 而不是上一章的。

您可能漏掉了两行:

  • 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" ]

查看完整程序