【问题标题】:R Markdown: Empty line between list itemsR Markdown:列表项之间的空行
【发布时间】:2018-05-28 23:13:54
【问题描述】:

我在 R Markdown 中遇到过一些事情,这让我有些困惑。在使用有序列表时,我有时会遇到列表项之间没有添加空行的情况。这发生在列表的第二级之后并返回到第一级项目。如果下面的示例在 Markdown 中是“编织”的,则在 2. 的最后一个子点和 3. 点之间不会添加空行。

1. This is a thing

2. This is another thing
    + This is some subpoint thing
    + This, too, is something

3. This thing should have an empty line above it. It does, when compiled as pdf, it doesn't in html.

我尝试了两个空格,\newline 在不同的位置,但没有任何工作正常。我敢肯定,我只是错过了一些简单的事情......

谢谢大家!

【问题讨论】:

    标签: r rstudio r-markdown


    【解决方案1】:

    这似乎是默认 html 输出中使用的 CSS 的结果,其中 margin-bottom 设置为 0 用于子列表。您可以使用 CSS 覆盖它,例如:

    <style>
    ol ul {
        margin-bottom: 10px;
    }
    </style>
    
    1. This is a thing
    
    2. This is another thing
        + This is some subpoint thing
        + This, too, is something
    
    3. This thing should have an empty line above it. It does, when compiled as pdf, it doesn't in html
    

    【讨论】:

    • 太好了,做到了!谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-26
    • 1970-01-01
    • 1970-01-01
    • 2020-09-25
    • 2020-06-11
    • 1970-01-01
    相关资源
    最近更新 更多