r - 如何在 bookdown 上指定 csl 引用书目样式

标签 r markdown bookdown

如何在 bookdown 中文上指定 csl 引用书目样式 Bookdown Chinese example ,例如 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
---

更新:

今天我发现章节引用的标题不正确。应该是“引用”而不是上一章的。 Incorrect header

最佳答案

您可能错过了两行:

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

查看 use csl-file for pdf-output in bookdown 的完整过程

关于r - 如何在 bookdown 上指定 csl 引用书目样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50652853/

相关文章:

r - 通过 sapply 应用多个函数

r - 在 R 中绘制按时间显示日期的折线图

javascript - Github 风格的 Markdown - 带有空行的代码块不会呈现

r - 有没有办法将 chemarr 的 latex 表达式用于 `gitbook` 格式的 bookdown 包?

r - bookdown to html_document2 中的数字列表

regex - 转换为数字 : simplify 2 calls of gsub to one

r - 如何在r中的ggraph网络中按权重调整边的宽度

html - Pandoc:在 `tex` 到 `markdown` 转换中包含原始 `html`

gulp通过markdown json用jade生成html文件

r - 在 r bookdown 中更改章节颜色(pdf 输出)