任何帮助将不胜感激!!谢谢. 解决方案 只需在某处添加您的链接并引用 #header...返回顶部</a>Similar to the question asked here I am trying to insert anchors in a long document so that users can easily navigate to the TOC of the document.My code is as follows:---title: "Sample Document"output: html_document: toc: true theme: united---<a id="top"></a># First SectionThen I add [Go to Top](#top) wherever I want a link to go to the top of the document.The problem I am having is that on clicking Go to Top, the page scrolls up such that First Section is at the top, not the Table of Contents (which is what I want). So the users have to scroll up again to go to TOC.Is there any way to scroll back to the very top of the document, so that TOC is seen again on the page.I tried to to put <a id="top"></a> before ---, but that does not work.Any help would be much appreciated!! Thanks. 解决方案 Just add you link somewhere and refers to #header...<a href="#header">back to top</a> 这篇关于文档顶部的 R Markdown 锚点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-29 18:46
查看更多