gpt4 book ai didi

RMarkdown 似乎无法在 Tabs 中生成 Tabs

转载 作者:行者123 更新时间:2023-12-02 20:29:06 27 4
gpt4 key购买 nike

我正在尝试使用 RMarkdown 制作静态网页。我想定义一个 UI,它有第一层选项卡,然后是第一层下面的选项卡。我已经在 RMarkdown: Tabbed and Untabbed headings 调查过类似的问题.但这个答案对我的事业没有帮助。请在下面找到我想要实现的选项卡结构。

| Results
* Discussion of Results

| Quarterly Results
* This content pertains to Quarterly Results

| By Product
* Quarterly Performance by Products

| By Region
* Quarterly Performance by Region

* Final Words about Quarterly Results

| Yearly Results
* This content pertains to Yearly Results

| By Product
* Yearly Performance by Products

| By Region
* Yearly Performance by Region

* Final Words about Yearly Results

这是我使用的 .Rmd 格式的脚本。但是我能够实现的输出看起来像这样 Current Scenario .我希望在区域选项卡之外以及季度结果和年度结果中分别显示Final Words about Quarterly ResultsFinal Words about Yearly Results

---
output:
html_document:
theme: paper
highlight: tango
number_sections: false
toc: false
toc_float: false
---
# Result Discussion {.tabset}
We will discuss results here

## Quarterly Results {.tabset}
This content pertains to Quarterly Results

### By Product

Quarterly perfomance by Products

### By Region

Quarterly perfomance by Region


Final Words about Quarterly Results

## Yearly Results {.tabset}
This content pertains to Yearly Results

### By Product

Yearly perfomance by Products

### By Region

Yearly perfomance by Region

Final Words about Yearly Results

最佳答案

问题在于最后一段(Final Words about Quarterly ResultsFinal Words about Yearly Results)属于最后的第 3 级部分而不是父级别 2 部分。
您必须手动控制呈现的 HTML 的分段以获得您想要的内容。

使用 pandoc < 2.0,唯一的方法是插入原始 HTML:

---
output:
html_document:
theme: paper
highlight: tango
number_sections: false
toc: false
toc_float: false
---
# Result Discussion {.tabset}
We will discuss results here

## Quarterly Results {.tabset}
This content pertains to Quarterly Results

<div id="quarterly-product" class="section level3">
### By Product

Quarterly perfomance by Products
</div>

<div id="quarterly-region" class="section level3">
### By Region

Quarterly perfomance by Region
</div>

Final Words about Quarterly Results


## Yearly Results {.tabset}
This content pertains to Yearly Results

<div id="yearly-product" class="section level3">
### By Product

Yearly perfomance by Products
</div>

<div id="yearly-region" class="section level3">
### By Region

Yearly perfomance by Region
</div>

Final Words about Yearly Results

如果您使用pandoc 2.0 或更高版本,您可以使用fenced divs :

---
output:
html_document:
theme: paper
highlight: tango
number_sections: false
toc: false
toc_float: false
---
# Result Discussion {.tabset}
We will discuss results here

## Quarterly Results {.tabset}
This content pertains to Quarterly Results

::: {#quarterly-product .section .level3}
### By Product

Quarterly perfomance by Products
:::

::: {#quarterly-region .section .level3}
### By Region

Quarterly perfomance by Region
:::

Final Words about Quarterly Results


## Yearly Results {.tabset}
This content pertains to Yearly Results

::: {#yearly-product .section .level3}
### By Product

Yearly perfomance by Products
:::

::: {#yearly-region .section .level3}
### By Region

Yearly perfomance by Region
:::

Final Words about Yearly Results

关于RMarkdown 似乎无法在 Tabs 中生成 Tabs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49276336/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com