Fix #2245: Add `latex_elements["passoptionstopackages"]` option to call PassOptionsToPackages in early stage of preambles

This commit is contained in:
Takeshi KOMIYA
2016-02-23 00:14:03 +09:00
parent 968f072c42
commit 84fb1b7617
4 changed files with 9 additions and 1 deletions
+2
View File
@@ -10,6 +10,8 @@ Features added
longtables.
* Select an image by similarity if multiple images are globbed by ``.. image:: filename.*``
* #1921: Support figure substitutions by :confval:`language` and :confval:`figure_language_filename`
* #2245: Add ``latex_elements["passoptionstopackages"]`` option to call PassOptionsToPackages
in early stage of preambles.
Bugs fixed
----------
+4
View File
@@ -1545,6 +1545,10 @@ These options influence LaTeX output.
the "Bjarne" style uses numbers spelled out in English). Other
"fncychap" styles you can try include "Lenny", "Glenn", "Conny" and
"Rejne". You can also set this to ``''`` to disable fncychap.
``'passoptionstopackages'``
"PassOptionsToPackage" call, default empty.
.. versionadded:: 1.4
``'preamble'``
Additional preamble content, default empty.
``'figure_align'``
+1 -1
View File
@@ -22,7 +22,7 @@
%The xcolor package draws better fcolorboxes
%around verbatim code
\IfFileExists{xcolor.sty}{
\RequirePackage[xcdraw]{xcolor}
\RequirePackage{xcolor}
}{
\RequirePackage{color}
}
+2
View File
@@ -34,6 +34,7 @@ from sphinx.util.smartypants import educate_quotes_latex
HEADER = r'''%% Generated by Sphinx.
\def\sphinxdocclass{%(docclass)s}
\documentclass[%(papersize)s,%(pointsize)s%(classoptions)s]{%(wrapperclass)s}
%(passoptionstopackages)s
%(inputenc)s
%(utf8extra)s
%(cmappkg)s
@@ -271,6 +272,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
'pointsize': '10pt',
'classoptions': '',
'extraclassoptions': '',
'passoptionstopackages': '',
'inputenc': '\\usepackage[utf8]{inputenc}',
'utf8extra': ('\\ifdefined\\DeclareUnicodeCharacter\n'
' \\DeclareUnicodeCharacter{00A0}{\\nobreakspace}\n'