From f84effecf82c5037de8224e56fe160de2484db54 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 17 Sep 2016 21:06:25 +0900 Subject: [PATCH] Fix #2877: Rename ``latex_elements['footer']`` to ``latex_elements['postpreamble']`` --- CHANGES | 2 ++ doc/config.rst | 5 +++++ sphinx/builders/latex.py | 9 +++++++++ sphinx/templates/latex/content.tex_t | 2 +- sphinx/writers/latex.py | 2 +- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 74f3fb8b55..7f05cd05b2 100644 --- a/CHANGES +++ b/CHANGES @@ -48,6 +48,8 @@ Incompatible changes Use `Sphinx.set_translator()` API instead. * Drop python 2.6 and 3.3 support * Drop epub3 builder's ``epub3_page_progression_direction`` option (use ``epub3_writing_mode``). +* #2877: Rename ``latex_elements['footer']`` to + ``latex_elements['postpreamble']`` Features added -------------- diff --git a/doc/config.rst b/doc/config.rst index 7fc91031fc..b93c08cf2c 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1686,6 +1686,8 @@ These options influence LaTeX output. See further :doc:`latex`. .. versionadded:: 1.4 ``'preamble'`` Additional preamble content, default empty. See :doc:`latex`. + ``'postamble'`` + Additional postamble content (before the indices), default empty. ``'figure_align'`` Latex figure float alignment, default 'htbp' (here, top, bottom, page). Whenever an image doesn't fit into the current page, it will be @@ -1697,6 +1699,9 @@ These options influence LaTeX output. See further :doc:`latex`. ``'footer'`` Additional footer content (before the indices), default empty. + .. deprecated:: 1.5 + User ``'postamble'`` key instead. + * Keys that don't need be overridden unless in special cases are: ``'inputenc'`` diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py index 51d361d5e4..0ef0d70d48 100644 --- a/sphinx/builders/latex.py +++ b/sphinx/builders/latex.py @@ -258,6 +258,15 @@ def validate_config_values(app): app.warn("latex_font_size is deprecated. Use latex_elements['pointsize'] instead.") app.config.latex_elements['pointsize'] = app.config.latex_font_size + if 'footer' in app.config.latex_elements: + if 'postamble' in app.config.latex_elements: + app.warn("latex_elements['footer'] conflicts with " + "latex_elements['postamble'], ignored.") + else: + app.warn("latex_elements['footer'] is deprecated. " + "Use latex_elements['preamble'] instead.") + app.config.latex_elements['postamble'] = app.config.latex_elements['footer'] + def setup(app): app.add_builder(LaTeXBuilder) diff --git a/sphinx/templates/latex/content.tex_t b/sphinx/templates/latex/content.tex_t index cac9109454..bb246ff6bb 100644 --- a/sphinx/templates/latex/content.tex_t +++ b/sphinx/templates/latex/content.tex_t @@ -34,7 +34,7 @@ \renewcommand{\releasename}{<%= releasename %>} <%= makeindex %> <%= body %> -<%= footer %> +<%= postamble %> <%= indices %> \renewcommand{\indexname}{<%= indexname %>} <%= printindex %> diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index cdcb7eb0be..8c2fe20abb 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -290,7 +290,7 @@ class LaTeXTranslator(nodes.NodeVisitor): 'shorthandoff': '', 'maketitle': '\\maketitle', 'tableofcontents': '\\tableofcontents', - 'footer': '', + 'postamble': '', 'printindex': '\\printindex', 'transition': '\n\n\\bigskip\\hrule{}\\bigskip\n\n', 'figure_align': 'htbp',