Tho*_*s K 8 r r-markdown bookdown
我想使用.csl-file 使用 bookdown 来格式化引用。添加csl: some-style.csl到index.Rmd影响输出到gitbook,但不影响到pdf_book。我知道我可以指定biblio-style,但这仅接受一些标准样式而不接受 csl 文件。有适当的解决方法吗?
重现步骤:
.csl从https://www.zotero.org/styles下载一些文件并复制到项目的根目录。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."
---
Run Code Online (Sandbox Code Playgroud)
我有同样的问题。以下程序对我有用:
chicago-author-date-de.cslcitation_package: nonepandoc_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" ]
Run Code Online (Sandbox Code Playgroud)