mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Actually honor the "title" value in latex_documents, if present.
This commit is contained in:
parent
f2ff0419bd
commit
fab35de6a8
@ -717,6 +717,7 @@ class LaTeXBuilder(Builder):
|
||||
self.info("writing... ", nonl=1)
|
||||
doctree.settings = docsettings
|
||||
doctree.settings.author = author
|
||||
doctree.settings.title = title
|
||||
doctree.settings.docname = docname
|
||||
doctree.settings.docclass = docclass
|
||||
docwriter.write(doctree, destination)
|
||||
|
@ -102,7 +102,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
'preamble': builder.config.latex_preamble,
|
||||
'author': document.settings.author,
|
||||
'docname': document.settings.docname,
|
||||
'title': None, # is determined later
|
||||
# if empty, the title is set to the first section title
|
||||
'title': document.settings.title,
|
||||
'release': builder.config.release,
|
||||
'date': date,
|
||||
}
|
||||
@ -208,7 +209,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
elif self.this_is_the_title:
|
||||
if len(node.children) != 1 and not isinstance(node.children[0], nodes.Text):
|
||||
self.builder.warn('document title is not a single Text node')
|
||||
self.options['title'] = node.astext()
|
||||
if not self.options['title']:
|
||||
self.options['title'] = node.astext()
|
||||
self.this_is_the_title = 0
|
||||
raise nodes.SkipNode
|
||||
elif isinstance(node.parent, nodes.section):
|
||||
|
Loading…
Reference in New Issue
Block a user