在Rmarkdown中的R chunk之后缩进的子弹点

时间:2018-06-04 11:39:57

标签: r r-markdown

有没有办法在Rmarkdown(带HTML输出)的R块之后继续使用缩进项目符号点的列表?当我尝试这个时:

## R Markdown

1. First item in list
    + run this R code:  
    ```{r cars}
    # code...
    ```
    + Continuing a list at the same level after an R chunk works.
2. Second item
```{r}
# example code
```
    + Continuing a list at an increased level of indentation doesn't work.

我明白了:
enter image description here

1 个答案:

答案 0 :(得分:4)

你应该相对于它所属的列表项缩进任何代码块,即第一个和第二个代码块:

## R Markdown

1. First item in list
    + run this R code:  
        ```{r cars}
        # code...
        ```
        and look at the output
    + Continuing a list at the same level after an R chunk works.
2. Second item
    ```{r}
    # example code
    ```
    + Continuing a list at an increased level of indentation does work.

这样,除了正确处理新的列表项之外,在代码块工作之后继续列表项:

enter image description here