Hyperlink in HTML Presentation Using R Markdown

Hope I marked this correctly - I would like to create an HTML presentation using Markdown in R Studio. What I would like to do is create hyperlinks that will jump to the specified page when clicking in a straight linear progression of most presentations. For example:

---
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.  

      

Is it possible? I tried searching, but I can only find out how to connect to external sites (i.e.[link to google](www.google.com)

+3


source to share


2 answers


Perhaps, although the result is not perfect:

[Slide 4](#4)

      

ioslides opens links in new windows by default, so links won't work in RStudio preview and will create new browser tabs at runtime.



It's much easier if you don't care about the cleanliness of the markdown - a little HTML and JavaScript goes a long way:

<a href="javascript:slidedeck.loadSlide(4)">Slide 4</a>

      

+6


source


R Markdown creates slides that can be quoted by title; this should work:



## 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](#/my-second-slide) - clicking this would jump to slide 2

[Slide 3](#/my-third-slide) - clicking this would jump to slide 3

## My second slide

Text for slide 2

## My third slide

      

+1


source







All Articles