r-rmarkdown-yaml-是否可以在标题中包含内联的内部文档超链接?

时间:2020-06-16 19:55:45

标签: r yaml r-markdown

是否可以在RMarkdown文档的YAML标题栏中包含内联(内部文档)超链接?还是有R包允许这样做?

以下是我要执行的操作:

Container

谢谢。

1 个答案:

答案 0 :(得分:1)

标题被解析为markdown,因此您可以使用常规markdown链接语法来获取所需的行为。

---
title: 'There is a link in this title...[LINK](#anchor)'
author: "Jason Punyon"
date: "6/16/2020"
output: html_document
---

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

# Bibliography

<p id='anchor'>Here's where I went!</p>

您还可以手动将链接放入...

---
title: 'There is a link in this title...<a href="#anchor">LINK</a>'
author: "Jason Punyon"
date: "6/16/2020"
output: html_document
---

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

# Bibliography

<p id='anchor'>Here's where I went!</p>