【问题标题】:Best way to align center a paragraph with RestructuredText?将段落与 RestructuredText 对齐的最佳方法?
【发布时间】:2013-02-11 19:07:34
【问题描述】:

使用 restructuredText for pdf (rst2pdf) 使段落在页面中心对齐的最佳方法是什么?

【问题讨论】:

标签: alignment restructuredtext


【解决方案1】:

您可以使用以下内容:

.. class:: center

This paragraph will be centered.

【讨论】:

【解决方案2】:

如果你想在 rst2html.py (Docutils 0.12) 上使用中心标签(如上所述),你应该通过添加以下行来创建一个 css 文件,即 mystyle.css:

.center {text-align: center;}

要将您的 rst 文件,即 myrst.rst 转换为 html 文件,请使用以下命令

rst2html myrst.rst myrst.html --stylesheet=mystyle.css,html4css1.css

通过使用这种方法,下面的代码运行良好。

.. class:: center

This paragraph will be centered.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-03
    • 1970-01-01
    • 1970-01-01
    • 2020-02-25
    • 2018-06-02
    • 1970-01-01
    • 2017-05-29
    • 1970-01-01
    相关资源
    最近更新 更多