Hi jeff,

Sorry for confusing.

At Sphinx-1.3.5, I fixed a behavior that :maxdepth: option of toctree 
directive does not effect to the depth of ToC in LaTeX. Then Sphinx 
automatically set up the \tocdepth counter if :maxdepth: option is given at 
*first* toctree definition in your document.

In addition, the feature set the value of "maxdepth - 1" to the counter if 
the docclass is manual. Because sphinx uses \chapter as a top level 
sectioning unit. It is treated as tocdepth=0 in LaTeX.

BTW, there is a bug that the counter could not be overrided by 
user-preambles in Sphinx-1.3.5.
It was fixed at stable HEAD branch. it will be released in next release.
https://github.com/sphinx-doc/sphinx/issues/2358

Does this help you?

Thanks,

2016年3月1日火曜日 7時50分05秒 UTC+9 Jeff McKenna:
>
> I am still trying to understand the logic.  In our case, here is part of 
> conf.py:
>
>   latex_documents = [
>     ('documentation', 'MapServer.tex', ur'MapServer Documentation',
>      ur'The MapServer Team', 'manual', False),
>   ]
>
>   latex_elements = {
>     'preamble': '\setcounter{tocdepth}{3}'
>   }
>
> So I assume that the new :maxdepth: values are to be set in our 
> "documentation.txt" file.  Problem is that we set :maxdepth: there for 
> various sections, to a value of 2 (we want a maxdepth of 2 for html, and a 
> maxdepth of 3 for latex/pdf).
>
> Here is how our documentation.txt (the master document) looks:
>
>   Introduction
>   ----------------
>
>   .. toctree::
>     :maxdepth: 2
>
>   Tutorial
>   ----------
>
>   .. toctree::
>     :maxdepth: 2
>
>   Installation
>   ---------------
>
>   .. toctree::
>     :maxdepth: 2
>
>
> So how do we configure this so that we have a maxdepth of 3 for latex 
> output, and keep maxdepth of 2 for regular html output?
>
> For previous versions <1.3.5 we would just set the preamble in conf.py for 
> latex output's tocdepth.
>
> Very confusing :)
>
> -jeff
>
>
>
> On Monday, February 29, 2016 at 1:50:16 PM UTC-4, Jeff McKenna wrote:
>>
>> Hi Takeshi-san, 
>>
>> I am a little confused.  What I/we've always done to set the TOC depth 
>> for the latex (PDF) builds was to use the preamble, set in conf.py, so 
>> it applies all throughout.   Are you saying that in conf.py we should 
>> set :maxdepth: now? 
>>
>> We already set :maxdepth: throughout our many rst files, yet no matter 
>> where we set this, the resulting .tex file always states 
>> "\setcounter{tocdepth}{1}".  However, what we need is a "master" setting 
>> in the conf.py file, to set the "tocdepth" counter for latex. 
>>
>> Can you please explain how to set the tocdepth in the conf.py file? 
>>
>> Sorry for my questions. 
>>
>> Thanks, 
>>
>> -jeff 
>>
>>
>>
>>
>>
>> On 2016-02-29 11:32 AM, Komiya Takeshi wrote: 
>> > Hi, 
>> > 
>> > Sorry for inconvinience. 
>> > 
>> > Since 1.3.5, LaTeX writer supports :maxdepth: option for toctree 
>> directive. 
>> > It sets up `tocdepth` counter if :maxdepth: found. 
>> > So please set up  your :maxdepth: option. 
>> > 
>> > BTW, it seems worse that the `tocdepth` counter is defined after 
>> > latex_elements['preamble']. 
>> > I'll fix it in next version. 
>> > 
>> > Thanks, 
>> > 
>> > 2016年2月27日土曜日 7時32分35秒 UTC+9 Jeff McKenna: 
>> > 
>> >     Hi everyone, 
>> > 
>> >     Using 1.3.5 it seems that when generating latex the resulting 
>> >     tocdepth is always set to a "1".   Here is part of my conf.py: 
>> > 
>> >        latex_elements = { 
>> >          'preamble': '\setcounter{tocdepth}{3}' 
>> >        } 
>> > 
>> >     And the resulting *.tex file seems to set that value, and also a 
>> >     value after the title: 
>> > 
>> >        \setcounter{tocdepth}{3} 
>> > 
>> >        \title{MapServer Documentation} 
>> >        \date{February 26, 2016} 
>> >        \release{7.0.1} 
>> >        \author{The MapServer Team} 
>> >        \newcommand{\sphinxlogo}{\includegraphics{banner-large.png}\par} 
>> >        \renewcommand{\releasename}{Release} 
>> >        \setcounter{tocdepth}{1} 
>> >        \makeindex 
>> > 
>> >     Is anyone else hitting this problem? 
>> > 
>> >     Thanks, 
>> > 
>> >     -jeff 
>> >     mapserver.org <http://mapserver.org> 
>> > 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> > Groups "sphinx-users" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> > an email to [email protected] <javascript:> 
>> > <mailto:[email protected] <javascript:>>. 
>> > To post to this group, send email to [email protected] 
>> <javascript:> 
>> > <mailto:[email protected] <javascript:>>. 
>> > Visit this group at https://groups.google.com/group/sphinx-users. 
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to