mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add a caveat about LaTeX titles and authors, and properly escape
a title that comes from the document itself.
This commit is contained in:
parent
23d578da81
commit
efd474b296
@ -442,8 +442,12 @@ These options influence LaTeX output.
|
|||||||
here.)
|
here.)
|
||||||
* *targetname*: file name of the LaTeX file in the output directory.
|
* *targetname*: file name of the LaTeX file in the output directory.
|
||||||
* *title*: LaTeX document title. Can be empty to use the title of the
|
* *title*: LaTeX document title. Can be empty to use the title of the
|
||||||
*startdoc*.
|
*startdoc*. This is inserted as LaTeX markup, so special characters like a
|
||||||
* *author*: Author for the LaTeX document.
|
backslash or ampersand must be represented by the proper LaTeX commands if
|
||||||
|
they are to be inserted literally.
|
||||||
|
* *author*: Author for the LaTeX document. The same LaTeX markup caveat as
|
||||||
|
for *title* applies. Use ``\and`` to separate multiple authors, as in:
|
||||||
|
``'John \and Sarah'``.
|
||||||
* *documentclass*: Must be one of ``'manual'`` or ``'howto'``. Only "manual"
|
* *documentclass*: Must be one of ``'manual'`` or ``'howto'``. Only "manual"
|
||||||
documents will get appendices. Also, howtos will have a simpler title
|
documents will get appendices. Also, howtos will have a simpler title
|
||||||
page.
|
page.
|
||||||
|
@ -337,7 +337,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
if len(node.children) != 1 and not isinstance(node.children[0], nodes.Text):
|
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.builder.warn('document title is not a single Text node')
|
||||||
if not self.elements['title']:
|
if not self.elements['title']:
|
||||||
self.elements['title'] = node.astext()
|
# text needs to be escaped since it is inserted into
|
||||||
|
# the output literally
|
||||||
|
self.elements['title'] = node.astext().translate(tex_escape_map)
|
||||||
self.this_is_the_title = 0
|
self.this_is_the_title = 0
|
||||||
raise nodes.SkipNode
|
raise nodes.SkipNode
|
||||||
elif isinstance(node.parent, nodes.section):
|
elif isinstance(node.parent, nodes.section):
|
||||||
|
Loading…
Reference in New Issue
Block a user