5

I inherited an existing RST document with the following structure:

DocTitle
========

Heading2
--------

Heading1
========

Note that Heading1 is a larger heading than Heading2. Due to the fact that I am now adding this document to a TOC, I want it to be properly indented. That means changing the title to a new heading, such as the following:

DocTitle
########

Heading2
--------

Heading1
========

The problem is that the above makes Heading2 larger than Heading1. Is there some way to define a heading style without adding an actual heading to the page? For example, I want to do something like:

DocTitle
########

.. hidden::
   Heading1
   ========

Heading2
--------

Heading1
========

Is there any way to achieve this result in an RST file?

Related question: Skipping heading levels in reStructuredText

The answer to that question is "no", but I wonder if there is a way to define a heading that is hidden from the resulting output.

mzjn
  • 48,958
  • 13
  • 128
  • 248
Jeff G
  • 4,470
  • 2
  • 41
  • 76
  • 4
    Perhaps `rubric` is what you are looking for? http://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-rubric – mzjn Jun 26 '18 at 04:43

0 Answers0