On Jan 6, 1:52 pm, Tsf <tsferre...@gmail.com> wrote:
> I have the sameproblemof the first chapter inLaTeX. Was it ever
> solved?
>
> -- Tsf

I see this problem too, with files 'index.rst', 'chapter1.rst' and
'chapter2.rst' of the following form:

.. --- begin index.rst ---
.. toctree::
   :maxdepth: 2

   chapter1
   chapter2
.. --- end index.rst ---


.. --- begin chapter1.rst ---
Chapter 1
=========

Chapter 1 section 1
-------------------

Contents for first section of first chapter.

Chapter 1 section 2
-------------------

Contents for second section of first chapter.
.. --- end chapter1.rst ---


.. --- begin chapter2.rst ---
Chapter 2
=========

Chapter 2 section 1
-------------------

Contents for first section of second chapter.

Chapter 2 section 2
-------------------

Contents for second section of second chapter.
.. --- end chapter2.rst ---

The output ends up with three chapters, headed 'Chapter 1 section 1',
'Chapter 1 section 2', and 'Chapter 2', the last chapter having the
expected two subsections.

This looks like an oddity of Sphinx's LatexTranslator class.  The
'visit_section' method in that class looks like:

    def visit_section(self, node):
        if not self.this_is_the_title:
            self.sectionlevel += 1
        ...

When the first chapter title is visited, self.this_is_the_title is
true, so the section level isn't increased.  I assume this is related
to the bit in the Sphinx documentation ('Options for LaTeX output')
that says "title: LaTeX document title. Can be empty to use the title
of the startdoc."

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to