Search code examples
restructuredtexthtml-heading

Skip header size order


I want to put headers in unordered way. This is how you can do it in markdown:

h1

h3

#h1
###h3 
##h2

This way h3 is not the following size (h2) but two sizez smaller (h3). How to do it with rst?


Solution

  • From docutil's documentation on Sections:

    Rather than imposing a fixed number and order of section title adornment styles, the order enforced will be the order as encountered. The first style encountered will be an outermost title (like HTML H1), the second style will be a subtitle, the third will be a subsubtitle, and so on.

    ...

    ...a document must be consistent in its use of section titles: once a hierarchy of title styles is established, sections must use that hierarchy.

    So you cannot do this directly with reStructuredText. You will get a SEVERE: Title level inconsistent: warning.