首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RMarkdown似乎不能在Tabs中产生Tabs

RMarkdown似乎不能在Tabs中产生Tabs
EN

Stack Overflow用户
提问于 2018-03-14 11:16:17
回答 2查看 4.2K关注 0票数 2

我正在尝试使用RMarkdown制作一个静态网页。我想要定义一个UI,它有第一层标签,然后在第一层下面有标签。我已经在RMarkdown:选项卡标题和未选项卡标题研究了一个类似的问题。但这个答案无助于我的事业。请在选项卡结构下面找到我想要的。

代码语言:javascript
复制
| 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格式的脚本。但是我能够实现的输出看起来像这个当前情景。我希望将Final Words about Quarterly ResultsFinal Words about Yearly Results分别放在“区域”选项卡和季度结果和年度结果中。

代码语言:javascript
复制
---
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
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-03-14 21:46:46

问题来自这样一个事实,即最后几段(Final Words about Quarterly ResultsFinal Words about Yearly Results)属于最后一级3节,而不是父级2节。

您必须手动控制呈现的HTML的分段以获得所需的内容。

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

代码语言:javascript
复制
---
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或更高版本的,则可以使用divs

代码语言:javascript
复制
---
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
票数 5
EN

Stack Overflow用户

发布于 2018-03-14 15:36:55

你是说像这样?

代码语言:javascript
复制
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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49276336

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档