我希望我已经正确标记了它 - 我想在 R Studio 中使用 Markdown 创建一个 HTML 演示文稿。我想要做的是创建超链接,当点击时会跳转到指定的页面,而不是大多数演示文稿的直线进展。例如:
---
title: "Presentation"
output: ioslides_presentation
---
## Slide 1
This is the first slide. I'd like to be able to insert hyperlinks to a different page within the slide. For example:
[Slide 2](hyperlink to slide 2) - clicking this would jump to slide 2
[Slide 3](hyperlink to slide 3) - clicking this would jump to slide 3
[Slide 4](hyperlink to slide 4) - clicking this would jump to slide 4
## Slide 2
Text for slide 2
## Slide 3
More text for slide 3
## Slide 4
Even more text for slide 4.
这可能吗?我试过四处搜索,但只能找到如何链接到外部站点(即
[link to google](www.google.com)
最佳答案
这是可能的,尽管结果并不完美:
[Slide 4](#4)
ioslides 默认在新窗口中打开链接,因此链接在 RStudio 预览中不起作用,并将在运行时创建新的浏览器选项卡。
如果你不关心 Markdown 的纯度,那就容易多了——一点点 HTML 和 JavaScript 会有很长的路要走:
<a href="javascript:slidedeck.loadSlide(4)">Slide 4</a>
关于html - 使用 R Markdown 在 HTML 演示文稿中超链接,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26807477/