new `'packages' key to latex_elements`

serves to load packages after ``sphinx.sty`` itself and before hyperref.
This commit is contained in:
jfbu 2016-10-13 22:41:37 +02:00
parent 9cdf4fe00f
commit 9972d729ab
3 changed files with 8 additions and 1 deletions

View File

@ -1720,8 +1720,13 @@ These options influence LaTeX output. See further :doc:`latex`.
the "Bjarne" style uses numbers spelled out in English). Other the "Bjarne" style uses numbers spelled out in English). Other
"fncychap" styles you can try are "Lenny", "Glenn", "Conny", "Rejne" and "fncychap" styles you can try are "Lenny", "Glenn", "Conny", "Rejne" and
"Bjornstrup". You can also set this to ``''`` to disable fncychap. "Bjornstrup". You can also set this to ``''`` to disable fncychap.
``'packages'``
Extra user specified ``\\usepackage{<foo>}`` commands, default empty,
executed *after* the loading of :file:`sphinx.sty` and *before* the
loading of "hyperref".
``'preamble'`` ``'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'`` ``'postamble'``
Additional postamble content (before the indices), default empty. Additional postamble content (before the indices), default empty.
``'figure_align'`` ``'figure_align'``

View File

@ -20,6 +20,7 @@
\usepackage{multirow} \usepackage{multirow}
\usepackage{eqparbox} \usepackage{eqparbox}
<%= usepackages %> <%= usepackages %>
<%= packages %>
<%= hyperref %> <%= hyperref %>
<%= contentsname %> <%= contentsname %>
<%= numfig_format %> <%= numfig_format %>

View File

@ -278,6 +278,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
'fontpkg': '\\usepackage{times}', 'fontpkg': '\\usepackage{times}',
'fncychap': '\\usepackage[Bjarne]{fncychap}', 'fncychap': '\\usepackage[Bjarne]{fncychap}',
'longtable': '\\usepackage{longtable}', 'longtable': '\\usepackage{longtable}',
'packages': '',
'hyperref': ('% Include hyperref last.\n' 'hyperref': ('% Include hyperref last.\n'
'\\usepackage[colorlinks,breaklinks,%\n' '\\usepackage[colorlinks,breaklinks,%\n'
' ' ' '