Indeed, LaTeX's handling of package options is not robust when options
contain LaTeX macros; thus we pass all the user customization to
``\sphinxsetup``, not as package options to "sphinx.sty".
Also, make parameters for long code line breaking (ref #2343, 1.4.2)
accessible as sub-keys of 'sphinxpackageoptions'. The space reserved for
the continuation character has been modified for coherence and
compatibility with use in footnotes. In fact it did not use the correct
font for the dimension computation. The documentation explains how to
recover former value.
The standard classes have a severe cap on maximal nesting of list-like
environments (a total of six levels, and four for each of enumerate and
itemize). This commit defines a new key ``'maxlistdepth'``. _Only_ if it
is set (i.e. non-empty) will sphinx.sty do some hack to lift the LaTeX
limitations and extend the maximal list depth to the desired value.
A ``\sphinxBeforeFootnote`` macro is inserted by footnote environment
and ``\footnotemark`` command. Its default is to remove the space before
the footnote mark. Formerly, footnotes from explicit mark-up were
preceded by a space allowing a linebreak, but automatically generated
footnotes had no such space.
Allow code-blocks in footnotes for LaTeX PDF output.
This is done via using a ``footnote environment``, provided by LaTeX
package footnotehyper which replaces old problematic package footnote.
No need to ship a custom tabulary anymore.
The footnote markers are silently removed from the table of contents and
do not end in the PDF bookmarks (the old code in ``sphinx.sty`` copying
``footmisc.sty`` was not satisfactory and has been deleted and replaced
by use of better ``\sphinxfootnotemark``.) Footnotes can be used also in
captions of literal blocks.
The ``\pagenumbering{alph}`` trick has the inconvenient that it is
mandatory to reset later the page numbering to arabic else errors will
arise as soon as the document has more than 26 pages. This resetting is
done by Sphinx code for ``\tableofcontents`` now called
``\sphinxtableofcontents`` but not by original ``\tableofcontents``.
Thus, user putting ``\tableofcontents`` in ``'tableofcontents'`` key
would get errors now without that fix.
The titlepage environment creates a group and clears the page before
exiting, thus this solution is quite analogous to the one recommended by
hyperref author at http://tex.stackexchange.com/a/333219/4686.
Notice that as an after effect ``Contents`` or ``Python Module Index``
will appear (by default) in bold, and larger than formerly (it was a
bug of Sphinx that they were not styled).
I am leaving the `\py@HeaderFamily` in the `sphinx.sty` patch to the
Bjarne `fncychap.sty` style for backwards compatibility. And as it does
`\bfseries` by default I left only the size changing commands in the
`fncychap` customization of Bjarne style.
Also, the `\@makechapterhead` re-definition obeys `\mainmatter` etc...
This reverts the ``\scantokens`` added (commit 86083875) to ``\code``
(aka ``\sphinxcode``), in case it is encountered inside a parsed-literal
directive. Indeed strange interference arise then. The problem would
occur in Verbatim too, but I think ``\sphinxcode`` is not encountered
there.
Depending on the version of the italian module for LaTeX Babel, the
double-quote character may have been or not declared as a babel
shorthand. The babel ``\shorthandoff`` macro emits an error which aborts
compilation if the character isn't a shorthand. This commits wraps the
macro in a conditional to test if the character is active or not.
modified: sphinx/writers/latex.py
Via re-definable ``\sphinxbreaksbeforelist`` and ``\sphinxbreaksafterlist``,
latex user can specify (using ``'preamble'`` key for example) if broken
code lines are split before or after the said character when code blocks
are wrapped. Punctuation characters use active catcodes and are
configurable via further macros ``\sphinxbreaksbeforeactivelist`` and
``\sphinxbreaksafteractivelist``. The defaults in ``sphinx.sty`` can be
modified by imitation in user document preamble.
n.b.: ``\sphinxbreaksatpunct`` has been renamed to ``\sphinxbreaksviaactive``.
The potential linebreaks at commas in code lines were not inserted due
to latex kernel macro ``\@noligs`` which is issued by fancyvrb.sty
during its line processing. From the default `` `<>,'- ``, only the
backtick is left to be handled by ``\@noligs`` because the others are
either already replaced by a macro by Pygments, or (only the comma) made
active by sphinx.sty to insert potential linebreaks.
This came from the spurious space tokens following a fullwidth rule at
top of ``\maketitle`` in ``sphinxhowto.cls`` and ``sphinxmanual.cls``.
The ``\newline\null\par`` incantation recreates the extra empty line
which originated in these spurious space tokens, but it avoids the
Underfull latex warning. Nothing is changed to layout from this fix.
Adds some ``\relax``/``\unskip`` and removes spaces from ``visit_entry``
generated latex code. Earlier, multirow cell inherited one extra space
token at begin and one at end, making left or right alignment with other
cells fail because the native LaTeX space removal mechanism for table
cells could not apply there.
Memo: the ``\eqparbox`` part of ``visit_entry`` from e41f831f is left
untouched; separate analysis required.