siunitx syntax issue “,” versus “,” for thousands separator
up vote
2
down vote
favorite
This question includes a solution but I really want to know why it works and why what "should" work doesn't I think my MWE says is all:
documentclass[12pt]{article}
usepackage{siunitx}
% TeX Live 2015 (Ubuntu 18.04)
% siunitx Ver 2.6m
sisetup{
group-digits=integer,
group-minimum-digits={3},
group-separator={,} % NOT ","
}
begin{document}
After looking at a number of examples (and the
documentation) I could not got what I wanted
(3,000). If group-separator is set to verb:{,}:
the thousands separator is a space. But if set to
"," it works.
begin{tabular}{ccc}
Code in document & & Typeset as\
hline
verb:num{3000}: & num{3000} & 3,000\
verb:$num{3000}$: & $num{3000}$ & 3,000\
verb:num{$3000$}: & does not work\
end{tabular}
end{document}
siunitx
add a comment |
up vote
2
down vote
favorite
This question includes a solution but I really want to know why it works and why what "should" work doesn't I think my MWE says is all:
documentclass[12pt]{article}
usepackage{siunitx}
% TeX Live 2015 (Ubuntu 18.04)
% siunitx Ver 2.6m
sisetup{
group-digits=integer,
group-minimum-digits={3},
group-separator={,} % NOT ","
}
begin{document}
After looking at a number of examples (and the
documentation) I could not got what I wanted
(3,000). If group-separator is set to verb:{,}:
the thousands separator is a space. But if set to
"," it works.
begin{tabular}{ccc}
Code in document & & Typeset as\
hline
verb:num{3000}: & num{3000} & 3,000\
verb:$num{3000}$: & $num{3000}$ & 3,000\
verb:num{$3000$}: & does not work\
end{tabular}
end{document}
siunitx
,
is a thin space in LaTeX, if you use it, you get a space, not a comma. What's the problem with using the comma directly?
– gusbrs
3 hours ago
1
Withgroup-separator={,}
you get a comma; withgroup-separator={,}
you get,
, which is a thin space.
– egreg
3 hours ago
I don't really understand the issue? Is it that you triedgroup-seperator=,
andgroup-separator={,}
and it only worked with the latter? Sincegroup-separator=,
also worked, but didn't show a,
(because,
is a thin space)...?
– Werner
3 hours ago
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
This question includes a solution but I really want to know why it works and why what "should" work doesn't I think my MWE says is all:
documentclass[12pt]{article}
usepackage{siunitx}
% TeX Live 2015 (Ubuntu 18.04)
% siunitx Ver 2.6m
sisetup{
group-digits=integer,
group-minimum-digits={3},
group-separator={,} % NOT ","
}
begin{document}
After looking at a number of examples (and the
documentation) I could not got what I wanted
(3,000). If group-separator is set to verb:{,}:
the thousands separator is a space. But if set to
"," it works.
begin{tabular}{ccc}
Code in document & & Typeset as\
hline
verb:num{3000}: & num{3000} & 3,000\
verb:$num{3000}$: & $num{3000}$ & 3,000\
verb:num{$3000$}: & does not work\
end{tabular}
end{document}
siunitx
This question includes a solution but I really want to know why it works and why what "should" work doesn't I think my MWE says is all:
documentclass[12pt]{article}
usepackage{siunitx}
% TeX Live 2015 (Ubuntu 18.04)
% siunitx Ver 2.6m
sisetup{
group-digits=integer,
group-minimum-digits={3},
group-separator={,} % NOT ","
}
begin{document}
After looking at a number of examples (and the
documentation) I could not got what I wanted
(3,000). If group-separator is set to verb:{,}:
the thousands separator is a space. But if set to
"," it works.
begin{tabular}{ccc}
Code in document & & Typeset as\
hline
verb:num{3000}: & num{3000} & 3,000\
verb:$num{3000}$: & $num{3000}$ & 3,000\
verb:num{$3000$}: & does not work\
end{tabular}
end{document}
siunitx
siunitx
edited 3 hours ago
samcarter
83.6k794267
83.6k794267
asked 3 hours ago
Randall Wigle
363
363
,
is a thin space in LaTeX, if you use it, you get a space, not a comma. What's the problem with using the comma directly?
– gusbrs
3 hours ago
1
Withgroup-separator={,}
you get a comma; withgroup-separator={,}
you get,
, which is a thin space.
– egreg
3 hours ago
I don't really understand the issue? Is it that you triedgroup-seperator=,
andgroup-separator={,}
and it only worked with the latter? Sincegroup-separator=,
also worked, but didn't show a,
(because,
is a thin space)...?
– Werner
3 hours ago
add a comment |
,
is a thin space in LaTeX, if you use it, you get a space, not a comma. What's the problem with using the comma directly?
– gusbrs
3 hours ago
1
Withgroup-separator={,}
you get a comma; withgroup-separator={,}
you get,
, which is a thin space.
– egreg
3 hours ago
I don't really understand the issue? Is it that you triedgroup-seperator=,
andgroup-separator={,}
and it only worked with the latter? Sincegroup-separator=,
also worked, but didn't show a,
(because,
is a thin space)...?
– Werner
3 hours ago
,
is a thin space in LaTeX, if you use it, you get a space, not a comma. What's the problem with using the comma directly?– gusbrs
3 hours ago
,
is a thin space in LaTeX, if you use it, you get a space, not a comma. What's the problem with using the comma directly?– gusbrs
3 hours ago
1
1
With
group-separator={,}
you get a comma; with group-separator={,}
you get ,
, which is a thin space.– egreg
3 hours ago
With
group-separator={,}
you get a comma; with group-separator={,}
you get ,
, which is a thin space.– egreg
3 hours ago
I don't really understand the issue? Is it that you tried
group-seperator=,
and group-separator={,}
and it only worked with the latter? Since group-separator=,
also worked, but didn't show a ,
(because ,
is a thin space)...?– Werner
3 hours ago
I don't really understand the issue? Is it that you tried
group-seperator=,
and group-separator={,}
and it only worked with the latter? Since group-separator=,
also worked, but didn't show a ,
(because ,
is a thin space)...?– Werner
3 hours ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
The token ,
is not an “escaped comma”, but a command on its own, which means “insert a thin space (one sixth of an em). With
group-separator={whatever}
the separation between groups is set to whatever
. Thus with
group-separator={,}
you'll get a comma, but with
group-separator={,}
you'll get a thin space.
The braces are only mandatory with the comma, otherwise the option parser would get confused.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
The token ,
is not an “escaped comma”, but a command on its own, which means “insert a thin space (one sixth of an em). With
group-separator={whatever}
the separation between groups is set to whatever
. Thus with
group-separator={,}
you'll get a comma, but with
group-separator={,}
you'll get a thin space.
The braces are only mandatory with the comma, otherwise the option parser would get confused.
add a comment |
up vote
3
down vote
The token ,
is not an “escaped comma”, but a command on its own, which means “insert a thin space (one sixth of an em). With
group-separator={whatever}
the separation between groups is set to whatever
. Thus with
group-separator={,}
you'll get a comma, but with
group-separator={,}
you'll get a thin space.
The braces are only mandatory with the comma, otherwise the option parser would get confused.
add a comment |
up vote
3
down vote
up vote
3
down vote
The token ,
is not an “escaped comma”, but a command on its own, which means “insert a thin space (one sixth of an em). With
group-separator={whatever}
the separation between groups is set to whatever
. Thus with
group-separator={,}
you'll get a comma, but with
group-separator={,}
you'll get a thin space.
The braces are only mandatory with the comma, otherwise the option parser would get confused.
The token ,
is not an “escaped comma”, but a command on its own, which means “insert a thin space (one sixth of an em). With
group-separator={whatever}
the separation between groups is set to whatever
. Thus with
group-separator={,}
you'll get a comma, but with
group-separator={,}
you'll get a thin space.
The braces are only mandatory with the comma, otherwise the option parser would get confused.
answered 3 hours ago
egreg
703k8618753154
703k8618753154
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f464221%2fsiunitx-syntax-issue-versus-for-thousands-separator%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
,
is a thin space in LaTeX, if you use it, you get a space, not a comma. What's the problem with using the comma directly?– gusbrs
3 hours ago
1
With
group-separator={,}
you get a comma; withgroup-separator={,}
you get,
, which is a thin space.– egreg
3 hours ago
I don't really understand the issue? Is it that you tried
group-seperator=,
andgroup-separator={,}
and it only worked with the latter? Sincegroup-separator=,
also worked, but didn't show a,
(because,
is a thin space)...?– Werner
3 hours ago