summaryrefslogtreecommitdiff
path: root/sphinx/writers
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-12-26 02:04:13 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-12-27 22:46:16 +0900
commit3ddbd73f495014a72d7afdd25714801d08239de5 (patch)
tree568aecd4c6b33c3172d946328db45ec6503e6eb3 /sphinx/writers
parentfe11e2bce4b76c4b770a9e49c5192f934efb3e81 (diff)
downloadsphinx-git-3ddbd73f495014a72d7afdd25714801d08239de5.tar.gz
refactor: latex: Deprecate settings.* attributes based on latex_documents
Diffstat (limited to 'sphinx/writers')
-rw-r--r--sphinx/writers/latex.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 3eee3eb02..89ee63e8f 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -322,12 +322,12 @@ class LaTeXTranslator(SphinxTranslator):
self.elements = self.builder.context.copy()
# but some have other interface in config file
- self.elements['wrapperclass'] = self.format_docclass(self.settings.docclass)
+ self.elements['wrapperclass'] = self.format_docclass(document.get('docclass'))
# we assume LaTeX class provides \chapter command except in case
# of non-Japanese 'howto' case
self.sectionnames = LATEXSECTIONNAMES[:]
- if self.settings.docclass == 'howto':
+ if document.get('docclass') == 'howto':
docclass = self.config.latex_docclass.get('howto', 'article')
if docclass[0] == 'j': # Japanese class...
pass
@@ -429,7 +429,7 @@ class LaTeXTranslator(SphinxTranslator):
# tocdepth = 1: show parts, chapters and sections
# tocdepth = 2: show parts, chapters, sections and subsections
# ...
- tocdepth = self.document['tocdepth'] + self.top_sectionlevel - 2
+ tocdepth = self.document.get('tocdepth', 999) + self.top_sectionlevel - 2
if len(self.sectionnames) < len(LATEXSECTIONNAMES) and \
self.top_sectionlevel > 0:
tocdepth += 1 # because top_sectionlevel is shifted by -1
@@ -447,7 +447,7 @@ class LaTeXTranslator(SphinxTranslator):
self.elements['secnumdepth'] = '\\setcounter{secnumdepth}{%d}' %\
minsecnumdepth
- contentsname = self.settings.contentsname
+ contentsname = document.get('contentsname')
if contentsname:
self.elements['contentsname'] = self.babel_renewcommand('\\contentsname',
contentsname)