在 RMarkdown 中调整引用格式和样式

Adjust cite format and style in RMarkdown

希望您过得愉快。我正在 RMarkdown 撰写一份报告,我想问一个与样式相关的问题。我是 运行 .Rmd 文件中的下一个代码:

---
bibliography: bb.bib
fontsize: 11pt
nocite: '@*'
output: pdf_document
link-citations: true
---
\newpage

\section{Testing}\label{sec1}
```{r}
summary(cars)
```
\section{Demo}
This was done using @shiina and we will use some info from Section \ref{sec1} to do.
```{r}
summary(iris)
```
\section{References}

一切正常,我明白了:

在前面的图中,圆圈是我引用的,但我想更改样式。在这种情况下,只有年份使 hyperlink 成为参考书目,而 autor 部分 Shiina and Birge 不会 link 成为参考书目。

是否可以调整引文的样式,以便我可以将此:Shiina and Birge, 2004 与作者和年份 link 编入参考书目。或者可能是这样的:[Shiina and Birge, 2004] 因为 RMarkdown 使用 () 而不是 []。我不知道如何在 RMarkdown 中设置该样式。

bb.bib文件的内容是下一个:

@article {shiina,
author = {Shiina, Takayuki and Birge, John R.},
title = {Stochastic unit commitment problem},
journal = {International Transactions in Operational Research},
volume = {11},
number = {1},
publisher = {Blackwell Publishing},
pages = {19--32},
year = {2004},
}

@book{groewe2001,
  title={Stochastic unit commitment in hydro-thermal power production planning},
  author={Gr{\"o}we-Kuska, N. and R{\"o}misch, W.},
  year={2001},
  series = { Preprints aus dem Institut f{\"u}r Mathematik },
  publisher = { Humboldt-Universit{\"a}t zu Berlin, Institut f{\"u}r Mathematik },
}

非常感谢您的帮助。

您可以将 csl 字段添加到 YAML header 作为 link 到定义样式的 csl file

---
bibliography: bb.bib
fontsize: 11pt
nocite: '@*'
csl: cslfilename.csl
output: pdf_document
link-citations: true
---

See here for further examples. There is a long list of csl files on Github and all of them are modifiable