Number chapters and sections when PDF output (rst2pdf) with Sphinx

Normally, when numbering chapters and sections, if you write them as follows, the reverse lookup dictionary of "Sphinx-Users.jp": I want to number chapters and sections -users.jp/reverse-dict/writing/numbering.html).

.. toctree::
   :maxdepth: 2
   :numbered:

If you output it in HTML or ePub, it will be numbered if you add it, but if you output it in PDF using rst2pdf, it will not be numbered.

After changing the above part as follows, the number is added even if it is output as PDF.

.. section-numbering::

I tried to output HTML in this state, but it was numbered properly.

When outputting as PDF, ".. section-numbering ::" may be better. It seems that we need to try various things.

Reference page

Recommended Posts

Number chapters and sections when PDF output (rst2pdf) with Sphinx
Output PDF with Django
Output PDF with WeasyPrint
Memo about Sphinx Part 2 (PDF output using rst2pdf extension)
How to output a document in pdf format with Sphinx