docxbuilder icon indicating copy to clipboard operation
docxbuilder copied to clipboard

Problem ТОС generation

Open abel-msk opened this issue 6 years ago • 1 comments

Hi. Very useful extension, but I got the problem with TOC.

In generated docx document there is not any entry in the toc table (except the toc header). I try to update TOC in the Ms Word and got the error 'No table of contents entries found.' with popup (see image) Screenshot 2019-08-11 at 21 21 02 This say - I have not any title with heading style. But it is incorrect. My document has many headers in their body. Screenshot 2019-08-11 at 20 56 51

I Use Word for macos
Screenshot 2019-08-11 at 21 25 34

It seems some toc generations error on macos.
If I delete this TOC and generate new one inside MSWord, toc generated correctly.

This is generated docx document

abel-msk avatar Aug 11 '19 18:08 abel-msk

Maybe, this is because the headers are arranged outside toctree directive. Docxbuilder includes headers only included by toctree directive into TOC (This is same behaviour as HTML builder). For example, TOC generated from bellow code will not include "Title1", but include "Title2" and "Title3".

index.rst:

.. toctree:

   contents

Title1
======

contents.rst:

Title2
======

Title3
======

Could you move the contents outside toctree into other file, and include the file by toctree directive?

amedama41 avatar Aug 12 '19 04:08 amedama41