0

I have this front matter on an Rmd page, with an anchor "top" after it:

---
title: "Runnymede"
weight: 500
output:
  blogdown::html_page:
    toc: true
    toc_depth: 1
    number_sections: true
---

<a name="top"></a> 

So when I click a 'back to top' link further down the page, the table of contents is not seen as it is still above where the anchor is on the page. Is there a way to anchor above the table of contents? Thank you.

Dave S
  • 43
  • 7

1 Answers1

1

Sorry, just found the answer to this: R markdown anchor at the top of document

Exact answer is slightly different though:

  1. An anchor link can work with any ID
  2. ID for table of contents is TOC (in above case)
  3. so markdown for a link to go back to top of page and see the table of contents is [Back to top](#TOC)
Dave S
  • 43
  • 7