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

mathtext kerning around comma #5799

Closed
anntzer opened this issue Jan 5, 2016 · 3 comments · Fixed by #5813
Closed

mathtext kerning around comma #5799

anntzer opened this issue Jan 5, 2016 · 3 comments · Fixed by #5813
Assignees
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Jan 5, 2016

When using a comma as thousands separator in tex, one should wrap it in braces to avoid a spurious space after it (http://www.tex.ac.uk/FAQ-dec_comma.html). See below the difference between "$1{,}234{,}567" and "1,234,567$" with text.usetext=True.
tex
Unfortunately, mathtext doesn't implement this detail (text.usetex=False).
mathtext

(It doesn't look that bad on these zoomed images but I think the difference is more visible if you draw them e.g. using xlabel.)

(Yes, this qualifies as a major nitpick.)

@mdboom
Copy link
Member

mdboom commented Jan 5, 2016

I agree it should be fixed. Adding the {,} where using comma as a thousands separator seems to be the easy part. Making mathtext obey the braces may or may not be a large project.

Cc: @zblz due to his recent interest in mathtext.

@anntzer
Copy link
Contributor Author

anntzer commented Jan 5, 2016

"easy" modulo localization :/ (a quick look suggests there's "," -> "{,}", "." -> "{.}" and " " -> ",")

@zblz
Copy link
Member

zblz commented Jan 8, 2016

@anntzer, @mdboom: I gave it a shot in #5813. It is a quick fix, and spaces inside the brackets will still cause it to typeset a space after.

zblz added a commit to zblz/matplotlib that referenced this issue Jan 8, 2016
@QuLogic QuLogic added this to the next major release (2.0) milestone Jan 13, 2016
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

Successfully merging a pull request may close this issue.

5 participants