2

I'm generating a PDF document With Sphinx using latex.

======================
RX-loader instructions
======================

Program
=======

However this generates

0.1 RX-loader instructions
0.1.1 Program

How do I make the numbering start with 1?

Edit: My index.rst looks like this

#######################
RX-loader documentation
#######################

.. toctree::
   :maxdepth: 2

   rx-loader

My problem seems to be that the numbering takes "RX-loader documentation" as chapter 0 and always writes the chapters the section numbers.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Kjeld Flarup
  • 1,471
  • 10
  • 15
  • Try and use a different markdown strategy (see [Headers](https://pythonhosted.org/an_example_pypi_project/sphinx.html#headers)); it seems like the double `===` is mistaken for a single one, resulting in it being a `\section` rather than a `\chapter`. – Werner Mar 11 '19 at 16:47
  • I tried to replace === with *** but still with the same result. – Kjeld Flarup Mar 12 '19 at 09:59
  • If you followed exactly the suggestion in the linked post and it didn't solve your problem, I don't know what else to suggest. – Werner Mar 12 '19 at 15:24
  • Well I gave up, and changed to asciidoc. I do not like that asciidoctor uses Ruby, but it solved my task. – Kjeld Flarup Mar 13 '19 at 21:06

2 Answers2

0

The following might be a dirty trick but it results in the desired pdf behaviour on Sphinx 1.6.7 (In html the first line must be removed):

Filler text
======================
RX-loader instructions
======================

Program 1
---------
Program 2
---------

Output:

enter image description here

SuperKogito
  • 2,998
  • 3
  • 16
  • 37
0

In the configuration file, add a preamble to the latex_elements dictionary, like this:

latex_elements = {
'preamble': r'''
    \counterwithout{section}{chapter}
    '''
}