Rmarkdown删除了引文超链接

Nic*_*ick 6 latex r citations r-markdown

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

看看产生的乳胶文件,我可以在pre-amble中看到\ usepackage {hyperref},但引用如下:

rmd input:    @sharpe
latex output:  sharpe (1999)
Run Code Online (Sandbox Code Playgroud)

因此,它以pdf格式生成非动态引文.

我期望的乳胶输出是:\ citet {sharpe},它以pdf格式生成超链接引文.

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

tcr*_*ius 8

使用 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
---
Run Code Online (Sandbox Code Playgroud)

在文本报价中。

Here is my quote @AuthorYear
Run Code Online (Sandbox Code Playgroud)


Thi*_*rry 7

默认情况下,pandoc将执行引用的呈现.我看到两种选择.

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

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

  • `link-citations: true` 似乎不起作用。冷你更具体地说明它应该如何输入 YAML 标头? (3认同)
  • @MichaelChirico 尝试类似```--- output: pdf_document bibliography: Main_Document.bib link-citations: true ---``` (2认同)