防止在reStructuredText中将节标题转换为字幕转换 [英] Prevent section heading to subtitle transformation in reStructuredText
问题描述
在reStructuredText中,标题和下层标题作为副标题被读取:
In reStructuredText, a heading followed by a lower-level heading is read as a subtitle:
Section 1
=========
Subtitle
--------
但是,如果我实际上希望小节标题紧跟在小节标题之后,该怎么办?根据文档,空注释用于终止先前的构造" ,但这似乎不适用于此,因为
However, what if I actually want a subsection heading to follow immediately after a section heading? According to the the docs, an empty comment "serves to terminate a preceding construct", but this doesn't seem to apply here, as
Section 1
=========
..
Section 2
---------
仍然变成 Section 1 的标题,后跟副标题 Section 2 ,例如,rst2latex
和pandoc
.
still gets turned into a heading for Section 1, followed by a subtitle Section 2 by, for example, rst2latex
and pandoc
.
是否有另一种方法可以防止在没有在本节和本节标题之间写任何实际文本的情况下进行字幕化"?
Is there another way to prevent "subtitlisation" without writing any actual text between the section and subsection headings?
推荐答案
没关系,我知道了.反斜杠后接空格将起作用:
Nevermind, I figured it out. A backslash followed by a space will work:
Section 1
=========
\
Section 2
--------
我从简单表上的提示中获得了这个想法规范中的a>:
要在简单表中开始新行,但在处理后的输出的第一列中没有文本,请使用以下其中一个:
To start a new row in a simple table without text in the first column in the processed output, use one of these:
- 空注释(".."),可以从处理后的输出中将其忽略(请参见下面的评论)
- 反斜杠转义("\")后跟一个空格(请参见
- an empty comment (".."), which may be omitted from the processed output (see Comments below)
- a backslash escape ("\") followed by a space (see Escaping Mechanism above)
恕我直言,这不是很一致:第二种方法可用于分解标题和副标题,而第一种方法则不能,正如我在问题中所述.
IMHO this isn't very consistent: The second method works for breaking up title and subtitle, whereas the first one doesn't, as I stated in my question.
这篇关于防止在reStructuredText中将节标题转换为字幕转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!