Hello Aivar!

* Aivar Annamaa <[email protected]> [29.08.2013 17:40]:
> Hi!
> 
> I'd like to divide my book into 3 parts each containing several chapters. 
> Also, I'd like to keep separate chapters in separate files (and ideally 
> also part openers in their own files).
> 
> Looks like reST always interprets first heading in a file as top-level 
> heading. *Is there a way to explicitly define the level of the 
> heading?*Otherwise my chapter headings turn to part headings, unless I keep 
> all 
> chapters of a part in same rst file.

Perhaps you can try the following document structure:

---

maindir/
        index.rst
        part1/index.rst
        part1/chapter1.rst
        part1/chapter2.rst
        part2/index.rst 
        part2/chapter3.rst
        part2/chapter4.rst
        part3/index.rst
        part3/chapter5.rst
        part3/chapter6.rst
        ...
                        
---

The main index.rst file should contain a toctree like

---

.. toctree::
    :maxdepth: 2

        part1/index.rst
        part2/index.rst
        part3/index.rst
        ...
        
---

Each part*/index.rst file should contain a toctree like

---

.. toctree::
    :maxdepth: 2

        chapter1.rst
        chapter2.rst
        ...

In this way, the parts/chapters/sections can be nested recursively to any depth.
If one chapter grows too large, create a new folder at the respective directory,
move the chapter-foo.rst file to chapter-foo/index.rst and change the toctree of
the index.rst file in the upper directory. 

Hope this helps...


Bernhard

Attachment: signature.asc
Description: Digital signature

Reply via email to