9

当使用 Rmarkdown 构建包含引用的 pdf 时,默认情况下会删除引用的超链接。

查看生成的乳胶文件,我可以在序言中看到 \usepackage{hyperref},但引用如下:

rmd input:    @sharpe
latex output:  sharpe (1999)

因此,它会在 pdf 中产生非动态引用。

我期望的乳胶输出是:\citet{sharpe},它在 pdf 中生成超链接引用。

任何想法为什么它会像这样写出我的 bibtex 输入以及如何使其超链接?

4

2 回答 2

11

默认情况下 pandoc 将渲染引文。我看到了两种选择。

  1. \citet{sharpe}在 Rmd 中使用而不是@sharpe. 缺点:您只能将 Rmd 渲染为 pdf。
  2. 使用--natbib论据。bibtex缺点:渲染成 pdf 时需要额外的步骤。

更新:您还可以link-citations: true在 YAML 中提供选项(自pandoc v1.16)并保留 pandoc 语法以供引用。

于 2015-10-20T10:20:18.780 回答
9

使用 PDF 在 Rmd 中进行链接引用的 YAML 示例

---
title: "Introduction to data mining – Assignment"
author: "Your Name"
date: "Date"
output: 
  pdf_document: default
bibliography: <references>.bib
csl: <your_csl_file>.csl
link-citations: yes
linkcolor: blue
---

在文本引用中。

Here is my quote @AuthorYear
于 2018-11-23T15:10:37.750 回答