【问题标题】:indented bullet point after R chunk in RmarkdownRmarkdown中R块后缩进的项目符号
【发布时间】:2018-06-04 11:39:57
【问题描述】:

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

## 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.

我明白了:

【问题讨论】:

  • 为什么不缩进第二个代码块?如果你愿意,它会按照我认为你想要的方式呈现。
  • @KevinArseneau -- 会是一个很好的答案。该建议确实会以适当的缩进继续列表。
  • 一般来说,我希望能够在代码块之后增加缩进的原因是我可以制作关于代码块本身的 cmets。所以我真正想要的是比代码块缩进更多的项目符号。

标签: r r-markdown


【解决方案1】:

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

## 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.

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

【讨论】:

    猜你喜欢
    • 2014-12-27
    • 1970-01-01
    • 1970-01-01
    • 2018-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多