diff --git a/doc/config.rst b/doc/config.rst index d541c6077..399cc3b84 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -442,8 +442,12 @@ These options influence LaTeX output. here.) * *targetname*: file name of the LaTeX file in the output directory. * *title*: LaTeX document title. Can be empty to use the title of the - *startdoc*. - * *author*: Author for the LaTeX document. + *startdoc*. This is inserted as LaTeX markup, so special characters like a + 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" documents will get appendices. Also, howtos will have a simpler title page. diff --git a/sphinx/latexwriter.py b/sphinx/latexwriter.py index 824549f0b..8a8299b72 100644 --- a/sphinx/latexwriter.py +++ b/sphinx/latexwriter.py @@ -337,7 +337,9 @@ class LaTeXTranslator(nodes.NodeVisitor): if len(node.children) != 1 and not isinstance(node.children[0], nodes.Text): self.builder.warn('document title is not a single Text node') 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 raise nodes.SkipNode elif isinstance(node.parent, nodes.section):