I have come across a number of mentions of MultiMarkdown's support for internal links / named anchors but I am unable to find a single example of how to actually do it.
So, what is the syntax for denoting the named anchor, and what is the syntax for linking to it the same as linking to any other URLs (only using #foo instead of http://....
)?
The usual way to include citations in an R Markdown document is to put references in a plain text file with the extension . bib, in BibTex format. Then reference the path to this file in index. Rmd's YAML header with bibliography: example.
Alternatively referred to as a bookmark, in-page link, and jump link, a named anchor is an anchor that links to a location on a page. For example, "#top" is a named anchor that allows the reader to return to the top of the page. For example, a visitor at the bottom of a page could click a link to scroll to the top.
In standard Markdown, place an anchor <a name="abcd"></a>
where you want to link to and refer to it on the same page by [link text](#abcd)
.
(This uses name=
and not id=
, for reasons explained in this answer.)
Remote references can use [link text](http://...#abcd)
of course.
This works like a dream, provided you have control over the source and target texts. The anchor can even appear in a heading, thus:
### <a name="head1234"></a>A Heading in this SO entry!
produces:
and we can even link to it so:
and we can even [link](#head1234) to it so:
(On SO, the link doesn't work because the anchor is stripped.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With