emacs org export HTML:自定义段落与列表边距

emacs org export HTML: custom paragraph vs list margins

遵循 简单的解决方案,我使用 margin-leftmargin-right 以更易于阅读的格式获取导出的 HTML 页面,两侧边距更大:

#+HTML_HEAD_EXTRA: <style>*{margin-left: 2em}*{margin-right: 2em}</style>

所以页面看起来像:

        This is a very long sentence as an 
        example of reading friendly large
        margins in the exported HTML document
        of my org file.

而不是:

This is a very long sentence as an example of not-reading friendly small margins
in the exported HTML document of my org file.

段落看起来确实更好。但是,现在的问题是增加的边距会影响 TOC 和正文中的所有列表项。像这样的东西:

- List item 1
          - Subitem 1.1
          - Subitem 1.2
                   - Subsubitem 1.2.1
- List Item 2
          - Subitem 2.1
          - Subitem 2.2

我更想看到的地方:

- List item 1
  - Subitem 1.1
  - Subitem 1.2
    - Subsubitem 1.2.1
- List Item 2
  - Subitem 2.1
  - Subitem 2.2

现在是否可以只为文本段落设置自定义边距,而不影响列表?什么是一种巧妙的方法?

您可以使用下面的css

#+HTML_HEAD_EXTRA:<style> *{margin-left: 2em;margin-right: 2em}    ul, ol, li, a {margin: 0;} </style>

#+HTML_HEAD_EXTRA:<style> p{margin-left: 2em;margin-right: 2em} </style>