【问题标题】:Properly indent paragraphs within list items when using bookdown使用 bookdown 时正确缩进列表项中的段落
【发布时间】:2019-01-12 03:37:32
【问题描述】:

如何在 bookdown 列表中正确缩进段落?我想在空行之后开始一个新段落,如下例所示。此示例在 bookdown 之外使用时适用于 RMarkdown,但在与 bookdown 包一起使用时会崩溃。


  1. 第一个有序列表项

    您可以在列表项中正确缩进段落。请注意上面的空白行和前导空格(至少一个,但我们将在这里使用三个来对齐原始 Markdown)。

  2. 另一个项目

    • 无序子列表。
  3. 实际数字无关紧要,只是一个数字
    1. 有序子列表
  4. 还有另一个项目。

【问题讨论】:

  • 您能否格式化您的帖子以使您的输入可见?现在 SO 的 markdown 解释器干扰了。
  • 嗨拉尔夫,我真的不知道该怎么做。我要求的是如何使 bookdown 中的文本看起来像上面的文本(查看第 1 项后的空白行,然后是正确缩进的新段落)。您只需要在段落开头之前留一个空行,并且新段落中的第一行在 Rmarkdown 中以三个空格开头。但在 bookdown 中不起作用。

标签: r r-markdown bookdown


【解决方案1】:

如果我将以下代码呈现为 pdf,那么我会得到上面列出的输出。注意间距和空白。数字后面有两个空格(对于 4 的完整缩进)。项目符号后面有三个空格。

1.  First ordered list item

    You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).

2.  Another item

    *   Unordered sub-list.

3.  Actual numbers don't matter, just that it's a number

    1.  Ordered sub-list

4.  And another item.

结果是这样的

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-07
    • 2021-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-26
    • 1970-01-01
    相关资源
    最近更新 更多