我想使用.csl
- 文件来格式化带有bookdown的引用。将csl: some-style.csl
添加到index.Rmd
会影响gitbook
的输出,但会影响pdf_book
。我知道我可以指定biblio-style
,但这只接受一些标准样式而不是csl文件。有适当的解决方法吗?
重现的步骤:
.csl
文件并复制到项目的根目录。csl: my_csl_file.csl
添加到index.Rmd
的标头中。 index.Rmd
中的标题:
---
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
bibliography: [book.bib, packages.bib]
csl: american-sociological-review.csl
link-citations: yes
description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
---
答案 0 :(得分:3)
我遇到了同样的问题。以下程序适用于我:
chicago-author-date-de.csl
citation_package: none
pandoc_args: [ "--csl", "chicago-author-date-de.csl" ]
biblio-style: apalike
# References {-}
这是我的_output.yml文件:
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" ]