How to make H1 (#) tags into tabs in RMarkdown?

I want a layout where the H1 sections are the tabs. Is there a way to do that?

Example:

---
title: "The Actual Title"
output:
  html_notebook:
    number_sections: yes
    toc: yes
    code_folding: hide
---

# Heading 1
Stuff including lots of subheadings

# Heading 2
Stuff including lots of subheadings

# Heading 3
Stuff including lots of subheadings

Output:

            _____________
Heading 1  |  Heading 2  |  Heading 3 

Just for completeness this is also posted on SO

Please take a look into our cross posting policy

Does this answer your question? https://bookdown.org/yihui/rmarkdown/html-document.html#tabbed-sections

@apreshill -- the issue is that the headings BELOW the tabset headings become tabs. So if I put

# Heading 1 {.tabset}

Then only the sub headings (##) become tabs.

I hear ya. Only one person even responded, and they felt they did not have an answer.

BTW @apreshill, Hi! I'm at OHSU again.

1 Like

Why it has to be H1? If you leave an empty H1 you can get the effect you want but with H2.

# {.tabset}

## Heading 1
Stuff including lots of subheadings

## Heading 2
Stuff including lots of subheadings

@andresrcs That's what I chose to do as a hack, but it still looks hacky.

haha HI! I am not OHSU anymore!

I see your dilemma- I think the solution probably involves a custom css to override the size- sorry :frowning:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.