diff --git a/doc/config.rst b/doc/config.rst index cdf7eae1a..adc1892cb 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1720,8 +1720,13 @@ These options influence LaTeX output. See further :doc:`latex`. the "Bjarne" style uses numbers spelled out in English). Other "fncychap" styles you can try are "Lenny", "Glenn", "Conny", "Rejne" and "Bjornstrup". You can also set this to ``''`` to disable fncychap. + ``'packages'`` + Extra user specified ``\\usepackage{}`` commands, default empty, + executed *after* the loading of :file:`sphinx.sty` and *before* the + loading of "hyperref". ``'preamble'`` - Additional preamble content, default empty. See :doc:`latex`. + Additional preamble content, default empty. Executed *after* + the loading of "hyperref" package. See :doc:`latex`. ``'postamble'`` Additional postamble content (before the indices), default empty. ``'figure_align'`` diff --git a/sphinx/templates/latex/content.tex_t b/sphinx/templates/latex/content.tex_t index 1e0028503..6a3fb444d 100644 --- a/sphinx/templates/latex/content.tex_t +++ b/sphinx/templates/latex/content.tex_t @@ -20,6 +20,7 @@ \usepackage{multirow} \usepackage{eqparbox} <%= usepackages %> +<%= packages %> <%= hyperref %> <%= contentsname %> <%= numfig_format %> diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index a47864443..e46285300 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -278,6 +278,7 @@ class LaTeXTranslator(nodes.NodeVisitor): 'fontpkg': '\\usepackage{times}', 'fncychap': '\\usepackage[Bjarne]{fncychap}', 'longtable': '\\usepackage{longtable}', + 'packages': '', 'hyperref': ('% Include hyperref last.\n' '\\usepackage[colorlinks,breaklinks,%\n' ' '