Skip to content

Comma as a decimal separator #3744

Answered by edemaine
J-Duelund asked this question in Q&A
Discussion options

You must be logged in to vote

You could use \def,{{\char`,}} or the setting {macros: {",": "{\\char`,}"}} to permanently redefine , to {,}. But this makes it hard to form lists.

icomma.sty's behavior is to add spacing when the comma is followed by a space. I believe this is implemented by the following setting:

{macros: {",": (context) => context.future()?.text === " " ? "{\\char`,}" : "\\char`,"}

I don't think this can currently be expressed via \def, but hopefully this suffices for your purposes.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@J-Duelund
Comment options

Answer selected by J-Duelund
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants