Skip to content

Support for comma as decimal separator in math mode #3464

@nopria

Description

@nopria

Problem description

In many countries, the comma is used as the decimal separator (e.g., 3,14).
In MathJax, when using , in math mode, a thin space is automatically inserted after the comma because it is treated as punctuation (\mathpunct) in TeX.

This makes it impossible to display numbers with commas as decimals correctly, without modifying thousands of formulas to use 3{,}14 or similar unadvisable workarounds.

Expected behavior

It should be possible to treat commas between digits as decimal separators, without adding extra space, ideally via a configuration option or macro, so that formulas like 3,14 render naturally.

Current behavior

  • The thin space is always inserted after , in math mode.
  • Workarounds require modifying the formulas themselves (3{,}14) or using CSS hacks, which are not robust.

Environment

  • MathJax 3 latest versions
  • Browser rendering

Proposal

  • Provide a configuration option to treat commas between digits as “mathord” automatically.
  • Or provide a built-in macro to render decimal commas correctly without extra spacing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code ExampleContains an illustrative code example, solution, or work-aroundFeature Request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions