【问题标题】:How to create an automatic nested list and sub-lists with letters and/or Roman numerals in R-markdown?如何在 R-markdown 中创建带有字母和/或罗马数字的自动嵌套列表和子列表?
【发布时间】:2019-07-11 17:01:43
【问题描述】:

我正在尝试生成一个包含数字、字母和罗马数字的嵌套列表。 R-Markdown 备忘单显示

  1. 有序列表
  2. 项目 2
    • 子项 1
    • 分项2

但是,这会生成一个带有无序项目符号的子列表。取而代之的是,我需要带有字母的子列表和带有罗马数字的子列表,如下所示:

1. What geoms would you use to draw the followings?
   a. A line chart
      i) `geom_line()`
   b. A boxplot
      ii) `geom_boxplot()`

有没有办法做到这一点?谢谢,

【问题讨论】:

  • 您的问题不清楚。如果是“不输入”,你想使用什么样的输入?
  • 我的意思是没有指定它的顺序。例如,您只需键入 \item,LaTeX 将按顺序生成项目符号以进行枚举。您无需输入 a、b、c 或 i、ii、iii。

标签: r markdown r-markdown


【解决方案1】:

幸运的是,我在另一个R-Markdown cheatsheet 中找到了我的问题的答案。重点是在子列表项之前放置4个空格2个缩进8个空格4个缩进在子子列表项之前。以下是我在 R-Markdown 中的代码:

1. What geoms would you use to draw the followings?
    a. A line chart
        i. `geom_bar()`
        i. `geom_line()`
    a. A boxplot  
        i. `geom_boxplot()`
        i. box
    a. A histogram: `geom_histogram()`
    a. An area chart: `geom_area()`

输出是这样的:

1. What geoms would you use to draw the followings?
    a. A line chart
        i. `geom_bar()`
        ii. `geom_line()`
    b. A boxplot  
        iii. `geom_boxplot()`
        iv. box
    c. A histogram: `geom_histogram()`
    d. An area chart: `geom_area()`

【讨论】:

    猜你喜欢
    • 2018-03-13
    • 2022-11-01
    • 1970-01-01
    • 2019-01-14
    • 2023-01-27
    • 1970-01-01
    • 1970-01-01
    • 2018-01-11
    • 1970-01-01
    相关资源
    最近更新 更多