Trying to control which tabs are available in a quarto document. The following shows what I am attempting but does not work as tabs are not actually created.
---
title: "Tab Test"
format: html
editor: visual
---
```{r}
#| echo: false
#| include: false
# Tab control
Tab1 <- TRUE
Tab2 <- FALSE
Tab3 <- TRUE
Start the tabs
{.tabset .tabset-pills}
#| echo: false
#| include: true
#| eval: !expr Tab1
#| results: asis
# Print the tab
cat('### Tab1\n\n')
cat('Content for Tab1.\n\n')
#| echo: false
#| include: true
#| eval: !expr Tab2
#| results: asis
# Print the tab
cat('### Tab2 \n')
cat('Content for Tab2.\n\n')
#| echo: false
#| include: true
#| eval: !expr Tab3
#| results: asis
# Print the tab
cat('### Tab3\n\n')
cat('Content for Tab3.\n\n')
cat('\n')
This is the output. Hard to see without the html, but I get headers but they are not active tabs.
Tab Test
Start the tabs
Tab1
Content for Tab1.
Tab3
Content for Tab3.
cderv
August 29, 2024, 9:01am
2
Hi. Sorry for the delay.
Did you solve your problem ?
Can you edit your post to correctly format the .qmd source part ?
Formatting Code: the Basics
All code or console output you include in your posts should be formatted properly. Luckily, this is very easy to do! Just use the code formatting button at the top of the post editing box:
[image]
Select some code
Click the </> button!
The code formatting button automatically adds special Markdown formatting symbols to whatever you selected. If you check the preview pane to the right of your post, you'll see that the forum software now outputs nicely formatted code .
[04]
The code formatting button is pretty smart! It can tell the difference between snippets of code that are part of a sentence and blocks of code that stand alone. S…
Also for tabs with computation content, you can probably write the ###
header output of the chunk,
system
Closed
November 27, 2024, 9:02am
3
This topic was automatically closed 90 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.