mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use document['tocdepth'] instead of document.setting.tocdepth
This commit is contained in:
parent
acea9900b5
commit
924f65d737
@ -106,6 +106,7 @@ class LaTeXBuilder(Builder):
|
|||||||
doctree = self.assemble_doctree(
|
doctree = self.assemble_doctree(
|
||||||
docname, toctree_only,
|
docname, toctree_only,
|
||||||
appendices=((docclass != 'howto') and self.config.latex_appendices or []))
|
appendices=((docclass != 'howto') and self.config.latex_appendices or []))
|
||||||
|
doctree['tocdepth'] = tocdepth
|
||||||
self.post_process_images(doctree)
|
self.post_process_images(doctree)
|
||||||
self.info("writing... ", nonl=1)
|
self.info("writing... ", nonl=1)
|
||||||
doctree.settings = docsettings
|
doctree.settings = docsettings
|
||||||
@ -114,7 +115,6 @@ class LaTeXBuilder(Builder):
|
|||||||
doctree.settings.contentsname = self.get_contentsname(docname)
|
doctree.settings.contentsname = self.get_contentsname(docname)
|
||||||
doctree.settings.docname = docname
|
doctree.settings.docname = docname
|
||||||
doctree.settings.docclass = docclass
|
doctree.settings.docclass = docclass
|
||||||
doctree.settings.tocdepth = tocdepth
|
|
||||||
docwriter.write(doctree, destination)
|
docwriter.write(doctree, destination)
|
||||||
self.info("done")
|
self.info("done")
|
||||||
|
|
||||||
|
@ -359,13 +359,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
if self.elements['extraclassoptions']:
|
if self.elements['extraclassoptions']:
|
||||||
self.elements['classoptions'] += ',' + \
|
self.elements['classoptions'] += ',' + \
|
||||||
self.elements['extraclassoptions']
|
self.elements['extraclassoptions']
|
||||||
if document.settings.tocdepth:
|
if document.get('tocdepth'):
|
||||||
if document.settings.docclass == 'howto':
|
if document.settings.docclass == 'howto':
|
||||||
self.elements['tocdepth'] = ('\\setcounter{tocdepth}{%d}' %
|
self.elements['tocdepth'] = ('\\setcounter{tocdepth}{%d}' %
|
||||||
document.settings.tocdepth)
|
document['tocdepth'])
|
||||||
else:
|
else:
|
||||||
self.elements['tocdepth'] = ('\\setcounter{tocdepth}{%d}' %
|
self.elements['tocdepth'] = ('\\setcounter{tocdepth}{%d}' %
|
||||||
(document.settings.tocdepth - 1))
|
(document['tocdepth'] - 1))
|
||||||
|
|
||||||
self.highlighter = highlighting.PygmentsBridge(
|
self.highlighter = highlighting.PygmentsBridge(
|
||||||
'latex',
|
'latex',
|
||||||
|
Loading…
Reference in New Issue
Block a user