Is there a way to link to tabbed sections in rmarkdown?
P粉541551230
P粉541551230 2023-12-20 18:55:04
0
2
529

I want to create an internal link to a section in an rmarkdown document, but the section is a tab and the standard linking method doesn't seem to work.

The standard method is:

---
title: "Untitled"
output: html_document
---

# Section to link to

text and more 

# Next section

See [this section](#section-to-link-to)

Works!

In my case, the section I want to link to is part of a tab set:

---
title: "Untitled"
output: html_document
---

# Section {.tabset}

## Subsection to link to

text and more 

## Next subsection

text and more

# Next section

See [this section](#subsection-to-link-to)

Doesn't work :(

EDIT: To be clear - my question is not how to create tab sets, or how to create internal links/anchors, but intersection: how to create internal links to tabbed sections. The output should look like this:

I've tried some alternative anchoring methods (such as naming the section to link to and using that name in the link). But there is no joy. The link is highlighted in the output, indicating that it should work, but when clicked it does not.

I haven't found anything that says you can't link tabbed sections, so I'm asking here if there is a way, or if there just isn't a way.

Thanks!

P粉541551230
P粉541551230

reply all(2)
P粉277464743

I just followed this answer. If you want to link a larger section (Section) you can use: #section.

Code:

---
title: "Untitled"
output: html_document
---

# Section {.tabset}

## Subsection to link to

text and more 

## Next subsection

text and more

# Next section

See [this section](#section)

This seems to work

To link to the subsection, as you mentioned, you would use: [this section](#subsection-to-link-to).

Code:

---
title: "Untitled"
output: html_document
---

# Section {.tabset}

## Subsection to link to

text and more 

## Next subsection

text and more

# Next section

See [this section](#subsection-to-link-to)

This seems to work
P粉006847750

This appears to be a bug marked as unfixable. Not supported by design, see issue on GitHub.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template