Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/application.py')
-rw-r--r--sphinx/application.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/sphinx/application.py b/sphinx/application.py
index b02fb4d60..bd23c86e7 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -968,12 +968,14 @@ class Sphinx:
self.add_css_file(filename, **attributes)
- def add_latex_package(self, packagename: str, options: str = None) -> None:
+ def add_latex_package(self, packagename: str, options: str = None,
+ after_hyperref: bool = False) -> None:
r"""Register a package to include in the LaTeX source code.
Add *packagename* to the list of packages that LaTeX source code will
include. If you provide *options*, it will be taken to `\usepackage`
- declaration.
+ declaration. If you set *after_hyperref* truthy, the package will be
+ loaded after ``hyperref`` package.
.. code-block:: python
@@ -983,8 +985,11 @@ class Sphinx:
# => \usepackage[foo,bar]{mypackage}
.. versionadded:: 1.3
+ .. versionadded:: 3.1
+
+ *after_hyperref* option.
"""
- self.registry.add_latex_package(packagename, options)
+ self.registry.add_latex_package(packagename, options, after_hyperref)
def add_lexer(self, alias: str, lexer: Union[Lexer, "Type[Lexer]"]) -> None:
"""Register a new lexer for source code.