I cannot number the headings of this document

I have created a Writer (odt) document with the Docutils tool (https://docutils.sourceforge.io/) and I cannot number the headings.
Document attached.
Regards.
programacion.odt (19.2 KB)

You complain but you didn’t explain what you did and what you intended. So, just guessing.

I have absolutely no idea what DocUtils can do and how (no 2-minute introduction documentation). So I analysed your sample document.

  1. It looks pretty correctly styled BUT all styles have been redefined as rststyle-xxx.
    This is perfectly legitimate as long as some feature configuration are respected, which is not the case.

  2. There is an abuse of sections without any necessity.
    Sections in Writer are needed to temporarily change geometric properties of a page style, mainly the number of columns.
    What complicate the matter here are nested sections which always create problems when there is no need to.

  3. The style customisation introduces conflicts with built-in features.

Let’s get back to your question proper.

Headings are styled rststyle-headingx as substitutes for Heading x, but there are two major differences.

  • rststyle-heading1 has been associated with list style Numbering 123 which has no relation with chapter numbering. Such an association is in conflict with any possible link with chapter numbering.

    • Fix: either use built-in Heading 1 (more generally Heading n) instead of rststyle-heading1 (resp. rststyle-headingn) and enable numbering in Tools>Chapter Numbering (as you did it)
      or change the level to style configuration in Tools>Chapter Numbering, Numbering tab, Paragraph style drop down menu for each level.
    • Important: remove the Numbering 123 list style association.
  • All other rststyle-headingn have no list style association which is good.

  • Styles rststyle-rubric and rststyle-table-title have been made descendants of Heading 3 but claim to be level 1 styles.

    • This is not forbidden but will create confusion when you try to customise your styles.

Your document has a simple structure. For your peace of mind, write it directly into Writer using the standard built-in styles unless, of course, you intend to pipe the reStructuredText source into some other tool. It looks to me that Docutils tries to replace everything with its own stuff in an excessive way. You’ll have a hard time if you try to improve formatting directly in Writer because way too many styles are involved:

  • usually 10 paragraph styles (plus Heading n) already give an extremely rich layout; you have nearly 100 which is impossible to tame
  • equally 10 character styles are enough; you have 15 which is acceptable
  • 2 frames styles are good
  • 3 page styles may be a little poor for an elaborate technical document; for a summary note, it is good
  • 15 list styles are way too many; I doubt you really need 15 different list look; usually 2-3 are good

One last warning: your font faces are taken in the Nimbus family. It is no longer supported by LO and substitution fonts will be used (unless you installed explicitly a copy on your computer). A good replacement is TeX Gyre.

Thank you very much for the very complete answer.
I have changed the fonts to “Liberation” ones and I have removed the Numbering 123 from the headings.
Unfortunately I can’t remove the styles because they are the ones automatically used by Docutils tool to transform a document into ReStructuredText format in other formats, such as ODT. The same with the multiple sections created automaticaly by Docutils.

I am trying to number the Headings with the tool Tools>Chapter Numbering, Numbering, but the text does not respond to the command.

I upload the document again just in case I was doing something wrong.

programacion.odt (19.5 KB)

Thanks.

You’re close to it. All you have to do now is to play with Tools>Chapter Numbering, Numbering tag. Review each Level by selecting it. Then change parameter Paragraph Style: to change it from Heading n to rststyle-heading n from the drop-down menu. Your numbering will appear.

As I already advised you, for such “simple” documents, work directly in Writer. Writer can export to a variety of formats (PDF, ePub, XML, RTF) and you’ll gain comfort in composing the document. Unless, of course, reStructuredText is an in-house constraint.

3 Likes

It works!!!. The solution was very simple but I was confused. Thanks a lot.