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(
|
||||
docname, toctree_only,
|
||||
appendices=((docclass != 'howto') and self.config.latex_appendices or []))
|
||||
doctree['tocdepth'] = tocdepth
|
||||
self.post_process_images(doctree)
|
||||
self.info("writing... ", nonl=1)
|
||||
doctree.settings = docsettings
|
||||
@ -114,7 +115,6 @@ class LaTeXBuilder(Builder):
|
||||
doctree.settings.contentsname = self.get_contentsname(docname)
|
||||
doctree.settings.docname = docname
|
||||
doctree.settings.docclass = docclass
|
||||
doctree.settings.tocdepth = tocdepth
|
||||
docwriter.write(doctree, destination)
|
||||
self.info("done")
|
||||
|
||||
|
@ -359,13 +359,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
if self.elements['extraclassoptions']:
|
||||
self.elements['classoptions'] += ',' + \
|
||||
self.elements['extraclassoptions']
|
||||
if document.settings.tocdepth:
|
||||
if document.get('tocdepth'):
|
||||
if document.settings.docclass == 'howto':
|
||||
self.elements['tocdepth'] = ('\\setcounter{tocdepth}{%d}' %
|
||||
document.settings.tocdepth)
|
||||
document['tocdepth'])
|
||||
else:
|
||||
self.elements['tocdepth'] = ('\\setcounter{tocdepth}{%d}' %
|
||||
(document.settings.tocdepth - 1))
|
||||
(document['tocdepth'] - 1))
|
||||
|
||||
self.highlighter = highlighting.PygmentsBridge(
|
||||
'latex',
|
||||
|
Loading…
Reference in New Issue
Block a user