0

I have an R markdown file like the following:

- [Introduction](#Introduction)
- [Section One](#Section One)
- [Section Two](#Section Two)

I then have the names of the sections like so:

Introduction

(R code and text)

Section One

etc

When I knit my file then it creates visible links that underline when I hover over them. However, when I click on them it does not take me to the appropriate section in the Rmarkdown page.

Does anyone know how to do that?

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Alex
  • 627
  • 3
  • 12
  • 32
  • 1
    Does this answer your question? [How to add table of contents in Rmarkdown?](https://stackoverflow.com/questions/23957278/how-to-add-table-of-contents-in-rmarkdown) – Samuel Dec 15 '20 at 17:26

1 Answers1

1

Found the answer here: Internal links in rmarkdown don't work

Essentially, in the contents page it is like this:

- [Introduction](#Introduction)

and

- [Section One](#s1)

And then in the actual section it is like:

# Introduction {#Introduction}

# Section One {#s1}
Alex
  • 627
  • 3
  • 12
  • 32