ReStructuredText numbered headers
Asked Answered
R

1

18

Is there a way in rst to have automatic header numbering ? That is something like:

#. Some Section
===============
...
#. Some Subsection
------------------
...
#. Another Subsection
---------------------
...
#. Another Section
==================
...

that would be rendered as:

1. Some Section

...

1.1 Some Subsection

...

1.2 Another Subsection

...

2. Another Section

...

Ressieressler answered 2/3, 2010 at 9:51 Comment(0)
J
23

According to the docutils manual, you can use the sectnum directive: http://docutils.sourceforge.net/0.7/docs/ref/rst/directives.html#automatic-section-numbering

So you can add something like this in the very first line(s):

.. sectnum::

HTH

Jutland answered 2/3, 2010 at 9:58 Comment(3)
Duh, how did I miss it ? Thanks!Ressieressler
Is there a way to skip the top level so it stills appears as a general title and not as "1 General Title"?Adjuvant
Answer to myself: #49010658Adjuvant

© 2022 - 2024 — McMap. All rights reserved.