Commit Graph
100 Commits
Author SHA1 Message Date
Jean-François B d36b0984fc Merge pull request #3010 from jfbu/fixcodeinparsedliteral
Fix #3009: Bad rendering of parsed-literals in LaTeX
2016-10-06 19:27:46 +02:00
jfbu 89487d02fe Update CHANGES for PR#3010 2016-10-06 19:27:20 +02:00
jfbu 446729dccf Improve wording in sphinx.sty and spare a few code lines at its end. 2016-10-06 19:26:32 +02:00
jfbu 44f595a63f Fix #3009: Bad rendering of parsed-literals in LaTeX
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.
2016-10-06 19:26:32 +02:00
jfbu d6d6a8e0d8 Update CHANGES for PR#2997 2016-10-02 09:31:36 +02:00
Jean-François B 07e599a83a Merge pull request #2997 from jfbu/fixitalianshorthandoff
Fix #2810: Problems with pdflatex in an Italian document
2016-10-02 09:28:41 +02:00
jfbu 85b954714c Fix #2810: Problems with pdflatex in an Italian document
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
2016-10-01 17:44:46 +02:00
jfbu 24dc3e601d Reset verbatim nolig list only in case of wrapping of codelines 2016-09-07 23:54:53 +02:00
jfbu 0464c52bce latex: code blocks linebreaks easier customized
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``.
2016-09-07 23:31:34 +02:00
jfbu 1d7c82b3bb Merge branch 'stable' into master
Conflicts (fixed)::
	sphinx/texinputs/sphinx.sty
2016-09-07 23:18:09 +02:00
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
Jean-François B 75ed2e6e4f Merge pull request #2721 from jfbu/makeVerbatimfontcustomizable
latex, make use of ``\small`` for code listings customizable
2016-06-30 11:22:49 +02:00
jfbu 067d3cabf0 latex, make use of `\small` for code listings customizable 2016-06-30 11:20:30 +02:00
jfbu f30a8d5a36 fix a mark-up typo in doc/install.rst 2016-06-30 11:10:58 +02:00
jfbu 446e93aca7 fix a typo in CHANGES 2016-06-30 00:08:40 +02:00
jfbu 2a1826022d Update to CHANGES 2016-06-30 00:03:06 +02:00
jfbu a20533540b Add a sentence in doc/config.rst on `'pxunit'` key 2016-06-29 20:55:07 +02:00
jfbu d76e9d48a5 Update doc/rest.rst 2016-06-26 23:13:32 +09:00
jfbu 6caf0b2a88 latex, add comment on the possibility of `\listof{literalblock}{foo}`
Memo: this command produces a list of the code listings in the document
(with chosen title foo), analogous to ``\listoffigures``, and it comes
from LaTeX package float.sty.
2016-06-25 18:50:24 +02:00
jfbu 830ffc7738 latex, load float package before wrapfig package
This should not change anything for Sphinx produced documents without
extra custom use of float package by user, and is recommended by wrapfig
doc for good functioning.
2016-06-25 18:26:25 +02:00
Jean-François B 2273be9c37 Merge pull request #2711 from jfbu/latex_allowpx2
latex, allow image dimensions using px unit (96px=1in)
2016-06-25 13:00:23 +02:00
jfbu fc2202fd2a latex, replace `'pixelsize' by more precise 'pxunit'` name 2016-06-25 10:32:48 +02:00
jfbu f6b0ae903d latex, allow image dimensions using px unit (96px=1in)
New key ``'pixelsize'`` in ``latex_elements`` dictionary.
2016-06-24 20:36:35 +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 5bd76815ff Added an item about sphinxVerbatim to doc/latex.rst 2016-06-22 22:30:58 +02:00
jfbu 4919406f94 Fix a comment in sphinx.sty 2016-06-22 19:26:11 +02:00
jfbu 3bce72f49b Update a comment in latex.py 2016-06-22 19:12:08 +02:00
jfbu 77ea9daf43 Fix comments in sphinx.sty after merge of 'stable' 2016-06-22 18:56:02 +02:00
jfbu 9002966085 Merge branch 'stable' 2016-06-22 18:42:13 +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
jfbu a4296a04d1 A bit of refactoring of latex entries in CHANGES for 1.5 2016-06-22 16:15:05 +02:00
Jean-François B 3e99ec91a2 Merge pull request #2704 from jfbu/jfbu_verbatim20
latex: customizable literal blocks
2016-06-22 16:14:26 +02:00
jfbu f1cc694af7 latex: customizable literal blocks
- new dimensions ``\sphinxverbatimsep`` and ``\sphinxverbatimborder``
  configure the frame width and its separation from contents,

- new ``\ifsphinxverbatimwithframe`` and ``\ifsphinxverbatimwrapslines``
  to customize behaviour of sphinxVerbatim or define wrapper
  environments, such as sphinxVerbatimNoFrame and sphinxVerbatimintable,

- the latter is used in table cells, in place of OriginalVerbatim, thus
  allowing to handle captions for code-blocks in tables (issue #2706).

On this occasion, a bit of refactoring in sphinx Verbatim code,
particularly the caption is typeset in advance to its insertion in
non-breakable from code location (this avoids using the amstext
``\iffirstchoice@`` conditional), and the sphinxVerbatim is usable
without any optional argument (but currently option is always present
and contains at least ``commandchars=\\\{\}`` to activate syntax
highlighting).
2016-06-22 15:57:03 +02:00
Jean-François B 188e669ee1 Merge pull request #2708 from jfbu/jfbu_fixtabularcolspecs
Fix #2707: (latex) the column width is badly computed for tabular
2016-06-22 09:54:44 +02:00
jfbu 4ab9854483 Update CHANGES for PR#2708 2016-06-22 09:36:10 +02:00
Jean-François B 49dd55ed1b Merge pull request #2701 from jfbu/jfbu_restoreUsageOfOriginalVerbatim
latex #2698: restore usage of OriginalVerbatim name for ``<1.5`` compat
2016-06-22 09:20:02 +02:00
jfbu c88193e3df fix flake8 violation 2016-06-21 23:25:06 +02:00
jfbu 8e45f54d07 Fix #2707: output more compact `*{N}{p{...}}` notation 2016-06-21 23:19:56 +02:00
jfbu 303f163b0a Fix #2707: (latex) the column width is badly computed for tabular
MEMO: the used formula is correct as long as package array is loaded.
Package array (which modifies how the width of vertical rules is counted
in the total width of the tabular) is a dependency of packages tabulary,
and eqparbox, and possibly others which are currently loaded by
sphinx.sty. Even if usage of package tabulary is dropped in future
version of sphinx.sty, there would still remain the dependency on array
via eqparbox, and the formula configured in latex.py will remain
correct.
2016-06-21 23:02:43 +02:00
jfbu 65653db479 latex #2698: restore usage of OriginalVerbatim name for `<1.5` compat 2016-06-20 11:49:08 +02:00
Jean-François B 452c8b162c Merge pull request #2685 from jfbu/jfbu_customizablenotices
latex: fully customizable notices/admonitions
2016-06-20 09:44:43 +02:00
jfbu 12ade10d55 New latex.rst for extended documentation of LaTeX's customizing. 2016-06-20 09:23:41 +02:00
jfbu e5db9da45d latex: fully customizable notices/admonitions
The refactoring maintains backwards compatibility for the non-customized
usage: but macros such as ``\py@noticesstart@note`` have been removed
and any customization by extension or user will be without effect.
However the ``notice`` environment is still used, hence customization or
modified usage of it will work as before.

The LaTeX writer now uses ``sphinxadmonition``. Currently it is a
wrapper of ``notice`` environment. At some future release ``>1.5`` of
Sphinx it is planned to remove definition of ``notice`` environment, and
rename it directly to ``sphinxadmonition``. In the transition period
both will work, but at end of transition period extensions using only
``notice`` will stop working and those using ``sphinxadmonition`` will
require at least Sphinx ``1.5``.
2016-06-20 09:06:28 +02:00
Jean-François B 033ef35273 Merge pull request #2660 from jfbu/jfbu_removenewfloatdependency
Remove use of latex package newfloat
2016-06-20 07:54:44 +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 01f1696d9b Remove usage by sphinx.sty of latex package newfloat.sty 2016-06-19 16:22:49 +02:00
jfbu 50dbfec05b Remove commented-out lines in latex.py used for review of #2691
Functionality is now at bottom of sphinx.sty. For case of
``\sphinxstylesidebarsubtitle`` from b3d8961, there should probably be a
``\par`` before the ``\smallskip`` but current code is exact transfer of
original from latex.py to sphinx.sty.
2016-06-19 14:35:47 +02:00
jfbu beeeb56c27 latex `\noindent` for non-inline images, not only if top level 2016-06-19 11:04:45 +02:00
jfbu c7c07db86b Fix #2694: LaTeX error because of \sphinxstyleliteralintitle 2016-06-18 15:32:50 +02:00
jfbu 4be797ccd3 Merge branch 'stable' 2016-06-18 12:23:20 +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 80a1ad5a5a Fix typo in CHANGES 2016-06-18 10:09:51 +02:00
Jean-François B 1daa065503 Merge pull request #2691 from jfbu/jfbu_enhancelatexcustomizability
Enhance latex text styling customizability
2016-06-18 10:08:42 +02:00
jfbu b3d8961ca8 Enhance latex text styling customizability 2016-06-17 19:48:52 +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
jfbu d4cdfc148b Fix typo in CHANGES 2016-06-16 16:09:05 +02:00
jfbu c2d417a032 Rename SphinxVerbatim to sphinxVerbatim for latex output 2016-06-15 18:34:00 +02:00
jfbu 2cec5a25b2 Merge branch 'stable'
Conflicts:
	sphinx/domains/cpp.py
	sphinx/texinputs/sphinx.sty
	tests/test_build_latex.py
2016-06-15 18:29:58 +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
Jean-François B 8043f6406f Merge pull request #2652 from jfbu/jfbu_sphinxverbatim
latex: keep Verbatim under same name, use SphinxVerbatim for own
2016-06-11 17:20:01 +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 d4d93e781d Give sphinx.sty a more accurate latex version date as latex package 2016-06-10 20:13:23 +02:00
jfbu 70213c78f7 Sync shipped tabulary with upstream one.
The update incorporates
\changes{v0.10}{2014/06/21}
      {support \cs{cellcolor} see
	  http://tex.stackexchange.com/a/185851/1090}
from tabulary commented source.

Memo: Sphinx ships a custom tabulary to fix a footnote issue, in
relation with package footnote:

   sphinx.sty does \makesavenoteenv{tabulary} but this needs also
   a patch inside tabulary package

It would be better, as package footnote has some bugs, for Sphinx to
ship with package footnotehyper which fixes theses bugs and can easily
be extended to ensure the compatibility with tabulary. This would be
better than shipping a custom tabulary.
2016-06-10 20:07:44 +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 f9880bfcc8 latex: keep original Verbatim under same name, use SphinxVerbatim for own 2016-06-10 18:48:33 +02:00
jfbu de070a3ca8 Merge branch 'stable' 2016-06-10 18:35:51 +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 6f9ae8d84b Remove ifthen dependency from sphinx.sty and update CHANGES 2016-06-08 11:48:04 +02:00
jfbu c51282530c Merge branch 'stable' 2016-06-08 11:38:33 +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