Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious space in default parameter values that are negative numbers in HTML output. #729

Closed
WarrenWeckesser opened this issue Jun 14, 2022 · 2 comments

Comments

@WarrenWeckesser
Copy link

For several projects, I've noticed a problem in the HTML output of functions that have a parameter with a default value that is a negative number. In the rendered HTML, there is a spurious space between the minus sign and the first digit. A typical example is axis=-1 being rendered as axis=- 1. This issue was originally raised with SciPy.

Here are links to examples in several projects:

SciPy:

NumPy:

Pandas:

Matplotlib:

Jax:

I wasn't able to find an existing issue for this here or in the Sphinx issues.

I don't know which versions of Sphinx were used in all those projects, so I don't know if the problem still exists in the latest version of Sphinx. Also, it looks like all those projects except Jax use the PyData Sphinx theme, and Jax uses the book theme which, according to @choldgraf, inherits from the pydata them, so it is possible that the problem is with the pydata theme.

I originally created a Sphinx issue. I'll close that, and reopen it if it turns out the issue is in Sphinx and not in the pydata theme.

@choldgraf
Copy link
Collaborator

So my initial assumption was that this was a theme issue, though after investigation it looks like the space is in the HTML itself:

sphinx-doc/sphinx#10550 (comment)

It might be a Sphinx thing after all, but I'm not sure

@WarrenWeckesser
Copy link
Author

It turns out this was a Sphinx issue. Thanks for looking into it, @choldgraf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants