You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the conf.py there is LaTeX hack which is described as
% In the parameters section, place a newline after the Parameters
% header
It was modified by myself 3 years ago in #15028 to fix some bug in the very old LaTeX package used and address a compatibility with a change in Sphinx.
At Sphinx 5.0.0, there was some change so that basically the numpy style was adopted but with a different implementation upstream (sphinx-doc/sphinx#9999). It was checked this would not break numpy. Some other changes happened at Sphinx 5.1.0 (sphinx-doc/sphinx#10087) which may impact this. Perhaps already sphinx-doc/sphinx#8997 from Sphinx 4.0.0 is relevant.
Anyway, currently the hack from numpy seems to be superfluous and a bit detrimental, adding to my taste too much vertical whitespace:
Here is output if removing this hack entirely from conf.py:
Idea or request for content:
I would advise to remove the hack entirely if and when Sphinx will be pinned to >=5.0.0. I checked the above screenshots with or without the patch would be the same with Sphinx 5.0.0 as with the 6.1.0 they were produced with originally. I did not test with Sphinx 4.0.0 due to some problem with the Python 3.10.9 environment where I have currently installed numpy and scipy.
i.e. do
-% In the parameters section, place a newline after the Parameters-% header-\usepackage{xcolor}-\usepackage{expdlist}-\let\latexdescription=\description-\def\description{\latexdescription{}{} \breaklabel}-% but expdlist old LaTeX package requires fixes:-% 1) remove extra space-\usepackage{etoolbox}-\makeatletter-\patchcmd\@item{{\@breaklabel} }{{\@breaklabel}}{}{}-\makeatother-% 2) fix bug in expdlist's way of breaking the line after long item label-\makeatletter-\def\breaklabel{%- \def\@breaklabel{%- \leavevmode\par- % now a hack because Sphinx inserts \leavevmode after term node- \def\leavevmode{\def\leavevmode{\unhbox\voidb@x}}%- }%-}-\makeatother
The \usepackage{xcolor} can be removed although unrelated because Sphinx loads xcolor automatically if available (since many years).
As far as I tested briefly, this does not cause breakage if used with numpy's hack into LaTeX description lists, but the hack of their project should be removed entirely, as it causes bad extraneous vertical whitespace.
So actually I was aware of that but may have entirely forgotten to trigger the alarm here ;-)
The text was updated successfully, but these errors were encountered:
#22952)
This removes an old LaTeX hack if Sphinx is at 5.0.0+. The hack served to insert a newline after each parameter name before its description and is unneeded as Sphinx 5+ does it (otherwise) and it now causes extra vertical whitespace.
If one day in future NumPy pins Sphinx to be at least 5.0.0, the whole thing will become removable.
Closes#22941
EDIT: this also removes \usepackage{xcolor}. Sphinx for many many years uses xcolor if it is available.
Uh oh!
There was an error while loading. Please reload this page.
Issue with current documentation:
In the
conf.py
there is LaTeX hack which is described asIt was modified by myself 3 years ago in #15028 to fix some bug in the very old LaTeX package used and address a compatibility with a change in Sphinx.
At Sphinx 5.0.0, there was some change so that basically the
numpy
style was adopted but with a different implementation upstream (sphinx-doc/sphinx#9999). It was checked this would not breaknumpy
. Some other changes happened at Sphinx 5.1.0 (sphinx-doc/sphinx#10087) which may impact this. Perhaps already sphinx-doc/sphinx#8997 from Sphinx 4.0.0 is relevant.Anyway, currently the hack from

numpy
seems to be superfluous and a bit detrimental, adding to my taste too much vertical whitespace:Here is output if removing this hack entirely from

conf.py
:Idea or request for content:
I would advise to remove the hack entirely if and when Sphinx will be pinned to
>=5.0.0
. I checked the above screenshots with or without the patch would be the same with Sphinx5.0.0
as with the6.1.0
they were produced with originally. I did not test with Sphinx4.0.0
due to some problem with the Python 3.10.9 environment where I have currently installed numpy and scipy.i.e. do
The
\usepackage{xcolor}
can be removed although unrelated because Sphinx loadsxcolor
automatically if available (since many years).Ah well about more than a year ago I commented at sphinx-doc/sphinx#9999 (comment)
So actually I was aware of that but may have entirely forgotten to trigger the alarm here ;-)
The text was updated successfully, but these errors were encountered: