yaml 中的参考书目不显示 backref

问题描述 投票:0回答:0

如果我在文档末尾添加

\bibliography{bib}
\bibliographystyle{apalike}
,那么超链接到参考文献和反向链接效果很好。但是,如果我在我的文档 yaml 中添加
\bibliography{bib}
,那么我的
backref
将不起作用,并且我的参考文献将在它们之间没有空格的情况下打印出来。第一个示例效果很好,但第二个示例效果不佳。

  #WORKS AS EXPECTED
---
title: "references"
output:
  pdf_document: 
    number_sections: yes
    toc: yes
    toc_depth: 4
hyperrefoptions:
  - backref
colorlinks: true
linkcolor: red
citecolor: blue
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

And this is an instance to cite authors \cite{Mills94} and this other author \cite{Gingras_2006} and this other author as well \cite{Smith2009}

\newpage
\addcontentsline{toc}{section}{References} 

\color{black}
\bibliography{bib}
\bibliographystyle{apalike}

在第二个例子中,我怎样才能让我的

backref
工作,我怎样才能像第一个例子那样用水平空间分隔我的引用?

#THIS ONE DOES NOT WORK AS EXPECTED
---
title: "references"
output:
  pdf_document: 
    number_sections: yes
    toc: yes
    toc_depth: 4
hyperrefoptions:
  - backref
colorlinks: true
linkcolor: red
citecolor: blue
bibliography: bib.bib
link-citations: yes
biblio-style: apalike
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

And this is an instance to cite authors [@Gingras_2006] and also [@Mills94] as wel as [@Smith2009]

\newpage

# References {-}

这是我的

bib.bib

@unpublished{Gingras_2006,
   author = {Marty Gingras},
   year = {2006},
   title = {{California Department of Fish and Wildlife (CDFW).  Unpublished spreadsheet providing capture and population data for White Sturgeon.  WSTALKEY.xls spreadsheet.  December 22, 2006.}},
   note = {Unpublished}
},@unpublished{Smith2009,
   author = {{Smith, C.T., A.R. LaGrange, and W.R. Arden}},
   year = {2009},
   title =  {{Run composition of Chinook Salmon at Red Bluff Diversion Dam during gates-in operations:  A comparison of phenotypic and genetic assignment to run type. Unpublished report prepared for the U.S. Bureau of Reclamation, Mid Pacific Region, Red Bluff, CA. CY2007 report.  Technical Information Leaflet No. AB-08-01.  33 pp.}},
   note = {Unpublished}
},
@misc{Mills94,
  author = {{Mills, T.J., and R. Fisher}},
  year = {1994},
  title = {{Central Valley Anadromous Sport Fish Annual Run-Size, Harvest, and Population Estimates, 1967 through 1991. Inland Fisheries Technical Report prepared for the California Department of Fish and Game}},
  howpublished = {\url{http://www.fws.gov/}},
  note = {Report}
}
r latex r-markdown knitr hyperref
© www.soinside.com 2019 - 2024. All rights reserved.