【问题标题】:r - rmarkdown - yaml - Is it possible to include inline, internal document hyperlink in title?r - rmarkdown - yaml - 是否可以在标题中包含内联的内部文档超链接?
【发布时间】:2020-06-16 19:55:45
【问题描述】:

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

以下是我想要做的:

---
title: blah {#one1} and so on {#two2}
...
---


# Bibliography

1. Reference note to [explain](#one1) in title

2. Reference note to [explain](#two2) in title

谢谢。

【问题讨论】:

    标签: r yaml r-markdown


    【解决方案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>
    

    【讨论】:

    • 非常感谢您提供这两种解决方案。我测试了第一个解决方案,效果很好。
    猜你喜欢
    • 2018-04-04
    • 2021-08-20
    • 1970-01-01
    • 1970-01-01
    • 2018-06-30
    • 2018-12-20
    • 1970-01-01
    • 2013-04-18
    • 2016-03-07
    相关资源
    最近更新 更多