Rmarkdown删除引用超链接 [英] Rmarkdown removes citation hyperlink

查看:786
本文介绍了Rmarkdown删除引用超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

when using Rmarkdown to build a pdf with citations included, it removes the hyperlinks of the citations by default.

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

Looking at the latex file produced, I can see \usepackage{hyperref} in the pre-amble, but the citations look as follows:

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

因此它会在pdf中产生非动态引文.

Thus it produces a non-dynamic citation in pdf.

我期望的乳胶输出为:\ citet {sharpe},它将以pdf格式产生超链接引用.

The latex output that I would expect is: \citet{sharpe}, which produces hyperlinked citation in pdf.

有什么主意为什么会这样写出我的bibtex输入以及如何使其超链接?

Any ideas why it writes out my bibtex inputs like this and how I can make it hyperlinked?

推荐答案

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

By default pandoc will do the rendering of the citations. I see two alternatives.

  1. 在Rmd中使用\citet{sharpe}而不是@sharpe.缺点:您只能将Rmd渲染为pdf.
  2. 使用--natbib参数.缺点:将其呈现为pdf时,您需要执行额外的bibtex步骤.
  1. Use \citet{sharpe} in the Rmd instead of @sharpe. Downside: you can only render the Rmd into pdf.
  2. Use the --natbib argument. Downside: You need an extra bibtex step when rendering into pdf.

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

Update: You can also provide the option link-citations: true in your YAML (since pandoc v1.16) and keep the pandoc syntax for citations.

这篇关于Rmarkdown删除引用超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆