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}









share|improve this question
























  • , 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; 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















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}









share|improve this question
























  • , 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; 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













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}









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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




    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


















  • , 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; 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
















, 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










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.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    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

























    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.






    share|improve this answer

























      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.






      share|improve this answer























        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        egreg

        703k8618753154




        703k8618753154






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks