Skip to content

mathtext kerning around comma #5799

Closed

Description

@anntzer

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.)

Activity

  1. mdboom commented on Jan 5, 2016

    @mdboom
    Member

    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.

  2. anntzer commented on Jan 5, 2016

    @anntzer
    ContributorAuthor

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

  3. added a commit that references this issue on Jan 8, 2016
    9927298
  4. zblz commented on Jan 8, 2016

    @zblz
    Member

    @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.

  5. added a commit that references this issue on Jan 8, 2016
    1f156be
  6. added this to the milestone on Jan 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions