Commit Graph
100 Commits
Author SHA1 Message Date
jfbu 581216e50e Update CHANGES 2016-09-02 10:09:56 +02:00
jfbu 71b9f00d31 Fix #2873: code-block overflow in latex (due to commas)
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.
2016-09-02 09:48:33 +02:00
jfbu 7db8141238 Amend merged PR#2736 to maintain strict stability of pdf title page
This maintains for the time being the diverging behaviour between
engines regarding the top of title page, as discussed at
https://github.com/sphinx-doc/sphinx/pull/2736#issuecomment-230140016
2016-07-03 10:49:05 +02:00
Jean-François B 532a804a66 Merge pull request #2736 from jfbu/fixunderfullhbox
Fix #2735: latexpdf ``Underfull \hbox`` warnings from title page
2016-07-02 12:46:39 +02:00
jfbu 0ecfa8e8e9 Fix #2735: latexpdf `Underfull \hbox` warnings from title page
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.
2016-07-02 10:56:59 +02:00
jfbu 7796a553d3 Update CHANGES for PR#2726 2016-07-02 07:41:43 +02:00
Jean-François B 8a79144e26 Merge pull request #2726 from jfbu/fixmultirow
Fix #2723: extra spaces in latex pdf output from multirow cell
2016-07-02 07:39:47 +02:00
jfbu 35214d4518 Fix #2733: `make latexpdf` generates lots of hyperref warnings 2016-07-01 19:18:27 +02:00
jfbu b25dc5ef4c Fix #2723: extra spaces in latex pdf output from multirow cell
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.
2016-06-30 18:11:54 +02:00
jfbu f30a8d5a36 fix a mark-up typo in doc/install.rst 2016-06-30 11:10:58 +02:00
jfbu 2a1826022d Update to CHANGES 2016-06-30 00:03:06 +02:00
jfbu 45ddb6387c Add a missing word in CHANGES and fix minor other issues there 2016-06-24 19:18:56 +02:00
jfbu 84ed2c394a Merge branch 'jfbu_fixspaceafterinlineliteral' into stable 2016-06-24 15:33:58 +02:00
jfbu b6daf6be56 fix latex, since 1.4.4 inline literal text is followed by spurious space
ref: a51681b use of ``\scantokens`` has a quirk with adding a space in
some cases which we fix by inserting a ``\relax`` at the end of the
argument.
2016-06-24 15:26:50 +02:00
jfbu 8feb92dd2d Update CHANGES for PR #2672 2016-06-22 18:33:43 +02:00
Jean-François B 0802e5499a Merge pull request #2672 from jfbu/jfbu_fixincludegraphics
Fix #2671: image directive may lead to inconsistent spacing in pdf
2016-06-22 18:25:46 +02:00
Jean-François B 58100c2856 Merge pull request #2697 from jfbu/jfbu_reusefloatpackage
Fix #2679: (latex) load package float for 'H' value of 'figure_align'
2016-06-20 07:51:28 +02:00
jfbu 3650663bb3 Fix #2679: (latex) load package float for 'H' value of 'figure_align' 2016-06-19 20:57:38 +02:00
jfbu beeeb56c27 latex `\noindent` for non-inline images, not only if top level 2016-06-19 11:04:45 +02:00
jfbu 6929d546c8 Hard-wrap some long lines in CHANGES
Seems longer lines are more frequent since 1.4. I hard-wrapped at 80
chars the ones I committed which sometimes exceeded 100 chars. Other
long lines remain (one has 108 chars).
2016-06-18 12:22:18 +02:00
Jean-François B a358f309da Merge pull request #2664 from jfbu/jfbu_safertestforundefined
latex: let sphinx.sty use own \spx@ifundefined for some tests.

the first commit is more aggressive, I leave it in commit history in case it could be useful in future.
2016-06-18 11:57:17 +02:00
jfbu 664e24cf86 Fix #2671: image directive may lead to inconsistent spacing in pdf 2016-06-17 10:08:31 +02:00
jfbu 44bd987314 latex: let sphinx.sty use own \spx@ifundefined for some tests 2016-06-16 18:35:01 +02:00
jfbu b78d9fec2f latex: let sphinx.sty use own \spx@ifundefined safer test 2016-06-16 18:34:09 +02:00
Jean-François B 4cf78e608e Merge pull request #2675 from jfbu/jfbu_macroswithprefix
Fix #2629. Add new config option latex_keep_old_macro_names
2016-06-15 09:31:47 +02:00
jfbu f16ce14954 Make sphinxShadowBox customizable via three lengths with public names 2016-06-15 08:54:52 +02:00
jfbu 5510653d6e Fix #2629. Add new config option `latex_keep_old_macro_names`
The cause of the issue was a clash about ``\titleref`` macro being already
defined in memoir class context. To avoid similar problems, this makes
the text styling macros

  ``\strong``, ``\code``, ``\bfcode``, ``\email``, ``\tablecontinued``,
  ``\titleref``, ``\menuselection``, ``\accelerator``, ``\crossref``,
  ``\termref``, ``\optional``,

also available with ``\sphinx`` prefix, with a conf.py boolean option to
let sphinx.sty only define ``\sphinx``-prefixed macros. As default value
is False, backwards compatibility is maintained.

On this occasion, some internal non-public macros have been renamed with
prefix ``\spx@``. The command

    find . -name '*.sty' -exec grep -l \\\\spx@ {} \;

has been executed in TeXLive 2015 and 2016 installations to check no
package defines macros starting with ``\spx@``.

Some internal macros having public names (because they are written by
latex.py into the body of the latex document) have been renamed to have
``\sphinx`` prefix. The macros in sphinx.sty starting with \py@, or \DU,
or \PYG have not been modified. Similarly ``\release``, ``\version``,
``\releasename``, etc... have not been renamed.
2016-06-15 08:53:24 +02:00
jfbu 8608387585 Fix #2676: (latex) Error with verbatim text in captions
Was caused by PR#2627 due to fragile ``\@noligs`` added to ``\code``.
2016-06-14 10:06:11 +02:00
jfbu a62292cd3a Update CHANGES for PR #2651 2016-06-11 16:54:22 +02:00
Jean-François B 7fd7d29b2a Merge pull request #2651 from jfbu/latex_avoidtoodeeplynestedI
Fix #777 (part Ia): Latex output "too deeply nested"
2016-06-11 16:46:57 +02:00
jfbu 518dad93e3 Fix mark-up in CHANGES 2016-06-10 22:27:11 +02:00
jfbu dba3d66d22 Update CHANGES for PR #2638 2016-06-10 19:02:00 +02:00
Jean-François B e17aadf944 Merge pull request #2638 from jfbu/latex_fixpdfframes
Fix #2635. To avoid pdf viewer issue, draw code frames latest.
2016-06-10 18:58:13 +02:00
jfbu 4a0b28397b Fix #777 (part Ia): Latex output "too deeply nested"
Allow code-blocks at maximal nesting depth of lists/quotes in LaTeX
(which by default is 6), by patching fancyvrb's original Verbatim way of
checking list depth which resulted in a loss of 1 possible level.

Memo 1: latex can have by default a maximum of 4 nested enumerated
lists, 4 nested labeled lists, and in total 6 nested lists. This
includes quoted blocks as they use the `\list` macro.

Memo 2: fancyvrb's rationale for using the \@list... macros (in its
\FV@ListNesting) is to set vertical positioning. To set a Verbatim at
level N it uses vertical parameters for list level N+1, hence can't work
at max level. But in Sphinx, this happens inside a \vbox for framing,
hence the vertical positioning set by fancyvrb turns out to be inoperant
anyhow. The execution of \@list<level> also sets the \leftmargin, but
fancyvrb resets it to zero later (#1=\z@ in \FV@ListNesting). To sum up,
fancyvrb's \FV@ListNesting does nothing but has the after effect to
raise an error if the code-block is at level equal to max - 1.

The effect of this commit is to make inoperant fancyvrb's check of
nesting depth, hence now the code-block can appear at maximal depth.

This is second commit improving in Sphinx the maximal depth for
code-blocks in nested lists or quote blocks. It used to be 4 (with
LaTeX's defaults for lists), it is now at 6 (or at the max depth
allowed by the document class).
2016-06-10 14:21:12 +02:00
jfbu e94d853bd8 Fix CHANGES 2016-06-10 09:48:14 +02:00
jfbu e3bd7daf49 Merge branch 'latex_avoidtoodeeplynestedI' into stable (ref #777)
This is \list --> \trivlist replacement in Sphinx wrapper of original
Verbatim from package fancyvrb. This gains one level for allowed
location of a code-block in nested lists/quotes.
2016-06-10 09:44:09 +02:00
jfbu 7d3bddd4e3 Convert text into links at bottom of tutorial.rst and top of config.rst 2016-06-09 15:34:59 +02:00
jfbu b2be59441e Fix #777 (part I): Latex output "too deeply nested"
Use \trivlist in Sphinx Verbatim.
2016-06-09 08:23:03 +02:00
jfbu e3232958e0 Fix #2632 (again).
This is a better way as it also handles the case of warning directive as
first in item of a labeled list.
2016-06-08 11:11:42 +02:00
jfbu 951e258fe9 Fix #2632 (cont.). Allow code-block in warning in quoted block.
Move \@newlistfalse from 18eb553b to earlier location, else LaTeX's \par
will created obsecure "missing item error" if Verbatim code-block is
enclosed in warning notice, and warning notice is in quote block ...
2016-06-08 09:04:53 +02:00
jfbu a266dd3aa9 Update CHANGES for PR #2627 2016-06-08 08:28:40 +02:00
Jean-François B a51681b327 Merge pull request #2627 from jfbu/latex_inlinecodeusestraightquotes
LaTeX use straight quotes also in inline code
2016-06-08 08:27:26 +02:00
jfbu b8017b0d01 Replace a \xdef by a \gdef in sphinx.sty 2016-06-08 08:25:05 +02:00
jfbu e9fb82f51b Update CHANGES for PR #2641 2016-06-08 08:23:50 +02:00
Jean-François B 5ba32933ae Merge pull request #2641 from jfbu/latex_fixcodeblockinwarning
Fix #2640: 1.4.2 LaTeX crashes if code-block inside warning directive
2016-06-08 08:22:52 +02:00
jfbu 6abbcb34e2 Update CHANGES for PR #2626 2016-06-08 08:21:02 +02:00
Jean-François B f689186e58 Merge pull request #2626 from jfbu/latex_fixopenany
Fix #2622: Latex produces empty pages after title and table of contents
2016-06-08 08:20:10 +02:00
jfbu cea3474ccc Fix #2640: 1.4.2 LaTeX crashes if code-block inside warning directive
The subtle cause of the bug was that original Verbatim environment was
used inside a minipage environment, and fancyvrb's code for checking
when \end{Verbatim} is reached does not work if \@currenvir is minipage.
2016-06-07 22:56:13 +02:00
jfbu d4a9997a48 Fix a \begin{\minipage} typo in sphinx.sty from 1.4.2 (ref: 68becb1) 2016-06-07 20:39:28 +02:00
jfbu af7d561ce4 Fix #2635. To avoid pdf viewer issue, draw code frames latest.
As latest Sphinx controls Verbatim up to finest details, it got possible
to arrange for framing to be drawn _after_ the code lines. This provides
work-around for issue with some pdf viewer at some resolutions on some
devices.
2016-06-07 12:44:40 +02:00
jfbu 18eb553b26 Fix #2632: Warning directives fail in quote environment latex build 2016-06-06 23:46:58 +02:00
jfbu b5261d560c Fix #2630: Latex sphinx.sty Notice Enviroment formatting problem 2016-06-06 23:11:52 +02:00
jfbu 9af0583f22 Fix #2622 (done): correctly obey openany option
Clean sphinxmanual.cls of superfluous unneeded code. And also avoid
skipping blank pages if openany for bibliography and index.
2016-06-06 18:37:52 +02:00
jfbu aa31bae17a Fix #2622 (cont.): obey openany option
This cleans up comments from sphinxmanual.cls.

Memo: the logic behind the earlier sphinxmanual.cls is obscure, besides
the fact that it didn't work correctly if conf.py used openany option.
The parent commit corrected the implementation, but not the logic.

Were it not for the log message about added blank page, there would be
no need to patch \tableofcontents, because by default it will use
\chapter* which does the right thing. Similarly after the end of
abstract, a \chapter or \part (or \tableofcontents, once abstract is
properly handled by LaTeX writer (*)), currently one seems to be
contrived to use raw directive and the abstract is then after
\tableofcontents) will do the right thing in case of openany. Also the
\maketitle wrongly ended with \cleardoublepage, which was corrected in parent
commit, but better would be that it does nothing. Indeed it is not
logical for \maketitle, abstract or \tableofcontents to worry about what
comes next. Anything which comes next should be a \part or \chapter
which will do the right thing.

(*) currently one seems to be contrived to use raw directive and the
abstract is then after \tableofcontents) will do the right thing in case
of openany.
2016-06-06 17:47:14 +02:00
jfbu f38665b58c Display correctly the Builtin themes in the PDF build of Sphinx doc
Add longtable as class, which will allow pagebreaks in pdf output.
2016-06-06 14:42:58 +02:00
jfbu 82758b13ba LaTeX use straight quotes also in inline code
Was already the case in code-blocks, but not for ``'inline'`` mark-up.
2016-06-06 14:06:13 +02:00
jfbu 78589b05ab Fix #2622: Latex produces empty pages after title and table of contents
The 'openany' option was not correctly obeyed.
2016-06-06 11:11:43 +02:00
jfbu ff8d4709d8 LaTeX: remove use of \ifthenelse macro from sphinx.sty
Simpler \ifdefined is already available without package.
2016-06-05 21:34:25 +02:00
jfbu d8912c166a Fix #2593 (cont.): delay to begin document storage of original \caption 2016-06-05 14:21:21 +09:00
jfbu 96e30b0d0e Fix #2593 (continued): allow figure captions in LaTeX tabulary tables 2016-06-05 14:21:21 +09:00
jfbu 0753a4a378 Revert "Update documentation for 'amsmath' key in latex_elements"
This reverts commit c5824bd1cd.
2016-06-04 18:39:25 +02:00
jfbu c5824bd1cd Update documentation for 'amsmath' key in latex_elements 2016-06-04 14:48:37 +02:00
jfbu 401302df48 LaTeX: load amstext in sphinx.sty even if not using amsmath
Needed in particular for:

- use of \iffirstchoice@ at commit 9d82cad (PR #2297)

- use of \text at commit 488ee52 addressing issue #2501
2016-06-04 10:23:12 +02:00
jfbu e95f6a9510 Prefix LaTeX tabular and tabulary with \noindent (ref: #2614) 2016-06-03 08:20:47 +02:00
Jean-François B f147df3fa0 Merge pull request #2601 from jfbu/latex_datefont
set font for date in latex pdf output to be same as for title
2016-05-31 09:17:28 +02:00
jfbu f6297558e8 Merge branch 'stable' into latex_datefont 2016-05-31 08:55:52 +02:00
jfbu 8ea5a908d9 Remove extra \rm from fix #2540 commit 2016-05-30 22:32:52 +02:00
jfbu 942dc80c99 Fix #2540: date on latex front page use different font
modified:   sphinx/texinputs/sphinxhowto.cls
	modified:   sphinx/texinputs/sphinxmanual.cls
2016-05-30 20:59:21 +02:00
jfbu cf2ff7594f Fix formatting typo in CHANGES 2016-05-24 22:52:09 +02:00
jfbu 2484efc855 Update CHANGES for PR #2551 2016-05-24 22:35:36 +02:00
Jean-François B 613c10c502 Merge pull request #2542 from jfbu/latex_fixbookmarks
Fix #2517: wrong bookmark encoding in PDF if using LuaLaTeX
2016-05-18 08:39:00 +02:00
jfbu 66bf27584b Update CHANGES for PR#2542 2016-05-18 08:22:21 +02:00
jfbu 0f0d505818 Fix #2517: wrong bookmark encoding in PDF if using LuaLaTeX 2016-05-18 08:20:46 +02:00
jfbu 3fb644b929 Extend pdflatex config in sphinx.sty to subparagraphs
This addresses #2547. As the two Sphinx classes set secnumdepth to 2 by
default, the label for paragraphs with the numbering is still skipped by
default. But if user increases secnumdepth to 4 or higher it will show,
contrarily to earlier situation. Also formerly paragraph headings used
\small, which looks wrong because the body text did not use \small.

And subparagraphs were not at all configured with \titleformat, thus did
not use same font as other headings.
2016-05-16 20:55:15 +02:00
Jean-François B 5ecbbec79d Merge pull request #2524 from jfbu/latex_fix2523
Fix #2523: LaTeX raises error for labeled code-block
2016-05-03 15:05:17 +02:00
jfbu e093846dcc Fix #2523: LaTeX raises error for labeled code-block
Was caused because produced latex source may not have blank line before
\begin{Verbatim}. Solved by adding a \par to sphinx.sty.
2016-05-03 14:49:52 +02:00
Jean-François B 06e2928ef0 Merge pull request #2509 from jfbu/latex_fixcomment
This better documents in sphinx.sty vertical spacing above code-blocks.
2016-05-01 08:21:06 +02:00
Jean-François B 57149d378f Merge pull request #2508 from jfbu/latex_frenchlistscompatibility
Fix #2507: French lists in LaTeX-PDF output cause vertical space problems
2016-05-01 08:19:46 +02:00
jfbu 0da097136d Fix and make more precise obsolete comment in sphinx.sty 2016-04-30 18:39:41 +02:00
jfbu 66fdb340f7 Fix #2507: French lists in LaTeX-PDF output cause vertical space problems
modified:   sphinx/texinputs/sphinx.sty
2016-04-30 17:47:04 +02:00
Jean-François B d0d2636c39 Merge pull request #2498 from jfbu/latex_less_space_above_codecaptions 2016-04-27 16:13:57 +02:00
jfbu 83f230799d Update CHANGES (ref: #2460) 2016-04-27 15:50:27 +02:00
Jean-François B df93a0e4ce Merge pull request #2493 from jfbu/latex_luatex85
Move luatex85 loading check from sphinx.sty to sphinx{howto,manual}.cls
2016-04-26 18:04:28 +02:00
jfbu 5833dfc60f Move luatex85 loading check from sphinx.sty to sphinx{howto,manual}.cls 2016-04-26 15:24:00 +02:00
jfbu b2b8fa41a5 Fix #2460: too much white space on top of captioned literal blocks in PDF output
the standard \abovecaptionskip should be enough.
2016-04-25 18:40:13 +02:00
Jean-François B 84191470f3 Merge pull request #2343 from jfbu/codeautolinebreakV3
Allow linebreaks in latex(pdf) codeblocks
2016-04-25 18:11:26 +02:00
jfbu 39e768e15b Update CHANGES after PR#2343 2016-04-25 17:56:50 +02:00
jfbu ac7d7b5f3a Fix #2304: auto line breaks in latexpdf codeblocks
Also related to #1534. Convert code lines into flushleft paragraphs,
thus allowing linebreaks at spaces, and use pre-existing Pygments
mark-up to also allow line breaks at (type 1) characters {, <, #, %, $,
' and " and (type 2) _, }, ^, &, >, -, ~, ., ;, :, ?, !, / and the
comma. Characters of type 1 go to next line in case of break, those of
type 2 stay on same line.

 - no new LaTeX package is used, but current use of fancyverb modified.

 - code line numbering is not affected (extra lines are not numbered.

 - spacing of top line and last line with respect of frame is improved.

 - near bottom of page the wrapping of lines longer than text width,
   which formerly continued into right margin, can produce one or more
   extra lines at bottom of page. It looks impossible without extensive
   rewrite of fancyvrb.sty or the switch to an altogether different
   LaTeX package doing source code formatting to allow page breaks
   there.
2016-04-25 17:30:29 +02:00
Jean-François B eabfd5e514 Merge pull request #2459 from jfbu/pdfvariablewidthcodeblocks
Make framing and captions of PDF literal code-blocks obey indentation
2016-04-25 16:52:19 +02:00
jfbu d3f73e7585 Make framing and captions of PDF literal code-blocks obey indentation
Thus, html and pdf look more similar.
2016-04-25 16:35:32 +02:00
jfbu d8b4ce585d fix a latex issue of vertical space
modified:   sphinx/texinputs/sphinx.sty
2016-04-20 13:59:37 +02:00
jfbu 75992bc831 Update CHANGES for PR #2453 2016-04-20 12:49:43 +02:00
jfbu 701749491e Merge branch 'stable' into fixpdfunbreakabletopicboxes 2016-04-20 12:48:30 +02:00
jfbu 68becb118e Fix #2446: latex(pdf) sets local tables of contents in unbreakable boxes
Allow page breaks in topic contents (e.g. local tables of contents) from
replacing \shadowbox of non anymore used package framebox by a custom
framed package environment.

Formerly, topic boxes extended into right margin; put only the shadow in
margin, locate the right frame exactly at the margin.

Use framed.sty also for framing admonitions of the warning type. Make
vertical spacing more coherent with the one for hint type notices.
Handle case with warning notices getting nested; the inner ones use a
minipage, only the outer one allows pagebreaks.
2016-04-20 12:28:39 +02:00
jfbu 5c823a770c Load compatibility patch for LuaTeX 0.85+
See http://ctan.org/pkg/luatex85 for more info. Old packages relying on
pdf naming of primitives will break under LuaTeX 0.85+, which will be
generally available starting with TeXLive 2016 release.

	modified:   sphinx/texinputs/sphinx.sty
2016-04-18 12:37:15 +02:00
jfbu 2bbeeffd94 Fix a vertical space in indented code-blocks for latexpdf
Add a missing \setlength\parsep{0pt} in Verbatim. There was a little
extra white space below top frame for indented code-blocks because of
that.

	modified:   sphinx/texinputs/sphinx.sty
2016-04-17 22:11:50 +02:00
jfbu bdba5655b9 Fix typo in comment after renaming.
Sorry.

	modified:   sphinx/texinputs/sphinx.sty
2016-04-14 18:23:33 +02:00
jfbu 4e69311599 Make more robust Verbatim code for PDF. No more redefines \fbox.
Although the definition was made locally, it meant that for example
macros of type \PYG... could not use internally \fbox whose meaning
had been modified. New code never modifies \fbox or \XC@fbox.

	modified:   sphinx/texinputs/sphinx.sty
2016-04-14 18:14:44 +02:00
jfbu 53cc2aa8a8 Fix #2447: VerbatimBorderColor wrongly used also for captions of PDF
On this opportunity the code and comments in sphinx.sty from commit
9d82cad (LaTeX captions of literal blocks now glued to framed verbatim)
have been re-organized, uses less macros. Only functional difference
should be the fix of #2447.

	modified:   sphinx/texinputs/sphinx.sty
2016-04-14 10:46:42 +02:00
jfbu 673222f20a Added Tests for latex(pdf) links to captioned or named literal blocks
As conf.py has now numfig = True, needed to modify accordingly test for
links in html output.

This topic branch fixes #2405, #2414, and also makes for latex(pdf)
functional hyperlinks to named references, but only for literal blocks
(code-block or literalinclude).

	modified:   tests/roots/test-directive-code/caption.rst
	modified:   tests/roots/test-directive-code/conf.py
	new file:   tests/roots/test-directive-code/namedblocks.rst
	modified:   tests/test_directive_code.py
2016-04-10 20:45:59 +02:00