restructuredtext - reStructuredText 中的小节

标签 restructuredtext

我正在尝试在 reStructuredText 中编写文档,但目前遇到了问题。

我希望文档有一个标题,这将被居中,然后紧接着我想要一个小节。

我尝试执行以下操作

##############
Title
##############

+++++++++
Subtitle
+++++++++
content

但是当我将其转换为 PDF 时,它会使标题和副标题都居中。

最佳答案

来自重构文本 quick start guide标题和副标题指定如下(强调我的):

To indicate the document title in reStructuredText, use a unique adornment style at the beginning of the document. To indicate the document subtitle, use another unique adornment style immediately after the document title.



所以在问题的其余示例中,Subtitle由于 Subtitle 周围使用的装饰样式,因此被格式化为子标题而不是节标题未在文档中的任何其他地方使用。在下文中,此装饰用于两个部分标题,因此不是唯一的,也不会被视为副标题:
##############
Document Title
##############

+++++++++++++++
Section 1 Title
+++++++++++++++

Section 1 content...

+++++++++++++++
Section 2 Title
+++++++++++++++

Section 2 content...

玩玩http://www.tele3.cz/jbar/rest/rest.html这使您可以快速尝试一些简单的 reStructuredText 并测试诸如副标题与部分标题之类的内容。

编辑 :或者,您可以在标题和章节标题之间放置一些文本(例如摘要)。

附言我倾向于使用标题上方和下方的装饰来指示文档标题和副标题,并在标题下方使用单个装饰来指示(子)节标题。这使得很容易看到我打算成为我的标题/副标题。例如:
==============
Document title
==============
-----------------
Document subtitle
-----------------

Section
=======

Sub-section
-----------
etc.

关于restructuredtext - reStructuredText 中的小节,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9593694/

相关文章:

python-sphinx - 重组文本中的不同字体大小

reStructuredText 工具支持

csv - 由 rst 的 sphinx latexpdf 生成的 pdf 中的丑陋破损表格

python - RestructuredText 中的文字 "*"

python - 让 Emacs 使用 rst-mode 编辑 Python 文档字符串

restructuredtext - 如何在 reStructuredText 中给文本加下划线?

python - 嵌套列表的父元素是粗体?

html - 元素符号列表狮身人面像的自定义字符

python - reStructuredText/Sphinx 中的图像网格

markdown - 如何将.rst文件转换为.md?