avoid space after thousands separator in math mode











up vote
15
down vote

favorite
3












In math mode, LaTeX inserts a small space after a comma. This looks nice in $a,b,c$, for example. But I don't like the way it looks when using a comma as a thousands separator, e.g., $x = 100,000$. (There is no space after the comma when writing 100,000 outside of math mode.) Is there an easy way to avoid this? Some symbol I should be using instead of comma?










share|improve this question




















  • 3




    siunitx lets you configure all of this $x = num{e5}$ or $x = num{100000}$, and you can easily configure all the output.
    – Manuel
    Apr 8 '16 at 1:01






  • 3




    $100{,}000$ will accomplish it.
    – Steven B. Segletes
    Apr 8 '16 at 1:29










  • Yes, that does it, @StevenB.Segletes. Submit it up as an answer and I'll accept it.
    – grendelsdad
    Apr 8 '16 at 1:33















up vote
15
down vote

favorite
3












In math mode, LaTeX inserts a small space after a comma. This looks nice in $a,b,c$, for example. But I don't like the way it looks when using a comma as a thousands separator, e.g., $x = 100,000$. (There is no space after the comma when writing 100,000 outside of math mode.) Is there an easy way to avoid this? Some symbol I should be using instead of comma?










share|improve this question




















  • 3




    siunitx lets you configure all of this $x = num{e5}$ or $x = num{100000}$, and you can easily configure all the output.
    – Manuel
    Apr 8 '16 at 1:01






  • 3




    $100{,}000$ will accomplish it.
    – Steven B. Segletes
    Apr 8 '16 at 1:29










  • Yes, that does it, @StevenB.Segletes. Submit it up as an answer and I'll accept it.
    – grendelsdad
    Apr 8 '16 at 1:33













up vote
15
down vote

favorite
3









up vote
15
down vote

favorite
3






3





In math mode, LaTeX inserts a small space after a comma. This looks nice in $a,b,c$, for example. But I don't like the way it looks when using a comma as a thousands separator, e.g., $x = 100,000$. (There is no space after the comma when writing 100,000 outside of math mode.) Is there an easy way to avoid this? Some symbol I should be using instead of comma?










share|improve this question















In math mode, LaTeX inserts a small space after a comma. This looks nice in $a,b,c$, for example. But I don't like the way it looks when using a comma as a thousands separator, e.g., $x = 100,000$. (There is no space after the comma when writing 100,000 outside of math mode.) Is there an easy way to avoid this? Some symbol I should be using instead of comma?







math-mode spacing punctuation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago









MountainDrew

32




32










asked Apr 8 '16 at 0:55









grendelsdad

9491921




9491921








  • 3




    siunitx lets you configure all of this $x = num{e5}$ or $x = num{100000}$, and you can easily configure all the output.
    – Manuel
    Apr 8 '16 at 1:01






  • 3




    $100{,}000$ will accomplish it.
    – Steven B. Segletes
    Apr 8 '16 at 1:29










  • Yes, that does it, @StevenB.Segletes. Submit it up as an answer and I'll accept it.
    – grendelsdad
    Apr 8 '16 at 1:33














  • 3




    siunitx lets you configure all of this $x = num{e5}$ or $x = num{100000}$, and you can easily configure all the output.
    – Manuel
    Apr 8 '16 at 1:01






  • 3




    $100{,}000$ will accomplish it.
    – Steven B. Segletes
    Apr 8 '16 at 1:29










  • Yes, that does it, @StevenB.Segletes. Submit it up as an answer and I'll accept it.
    – grendelsdad
    Apr 8 '16 at 1:33








3




3




siunitx lets you configure all of this $x = num{e5}$ or $x = num{100000}$, and you can easily configure all the output.
– Manuel
Apr 8 '16 at 1:01




siunitx lets you configure all of this $x = num{e5}$ or $x = num{100000}$, and you can easily configure all the output.
– Manuel
Apr 8 '16 at 1:01




3




3




$100{,}000$ will accomplish it.
– Steven B. Segletes
Apr 8 '16 at 1:29




$100{,}000$ will accomplish it.
– Steven B. Segletes
Apr 8 '16 at 1:29












Yes, that does it, @StevenB.Segletes. Submit it up as an answer and I'll accept it.
– grendelsdad
Apr 8 '16 at 1:33




Yes, that does it, @StevenB.Segletes. Submit it up as an answer and I'll accept it.
– grendelsdad
Apr 8 '16 at 1:33










2 Answers
2






active

oldest

votes

















up vote
19
down vote



accepted










There are different classes of mathematical symbols in LaTeX, as discussed in this question: What is the difference between mathbin vs. mathrel?



Depending on the class of a math symbol, surrounding space will be modified in predictable, relevant ways. The comma is of the type mathpunct (mathematic punctuation) which, when surrounded by math atoms, inserts a small amount of space after itself, in what would be a typical use of punctuation grammar.



The way to override the natural behavior of a symbol class is to isolate it from surrounding math, typically done by embracing the symbol in its own group, as in {,}. In this way, the comma is made unaware of the existence of surrounding math and therefore does not insert the customary space associated with its use.



Thus, to the specific question of the OP, the use of $x =100{,}000$ will insert the comma without the customary space associated with mathematical punctuation.



Just for completeness, one should note that one can do the opposite, as well; that is, inserting customary space even in the absence of surrounding math. One does that by inserting empty math groups adjacent to the symbol. In the case of a comma, ,{} is sufficient to trigger the insertion of the space, even if there are no surrounding (non-empty) math atoms.






share|improve this answer






























    up vote
    7
    down vote













    You can use the icomma package. But you must then ensure that you input a space after a comma if you want a space:



    documentclass{article}
    usepackage{icomma}
    begin{document}

    $(a, b, c) = f(x, y) $

    $(a,b,c) = f(x,y) $ %wrong

    $100,000$

    end{document}


    enter image description here






    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%2f303110%2favoid-space-after-thousands-separator-in-math-mode%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      19
      down vote



      accepted










      There are different classes of mathematical symbols in LaTeX, as discussed in this question: What is the difference between mathbin vs. mathrel?



      Depending on the class of a math symbol, surrounding space will be modified in predictable, relevant ways. The comma is of the type mathpunct (mathematic punctuation) which, when surrounded by math atoms, inserts a small amount of space after itself, in what would be a typical use of punctuation grammar.



      The way to override the natural behavior of a symbol class is to isolate it from surrounding math, typically done by embracing the symbol in its own group, as in {,}. In this way, the comma is made unaware of the existence of surrounding math and therefore does not insert the customary space associated with its use.



      Thus, to the specific question of the OP, the use of $x =100{,}000$ will insert the comma without the customary space associated with mathematical punctuation.



      Just for completeness, one should note that one can do the opposite, as well; that is, inserting customary space even in the absence of surrounding math. One does that by inserting empty math groups adjacent to the symbol. In the case of a comma, ,{} is sufficient to trigger the insertion of the space, even if there are no surrounding (non-empty) math atoms.






      share|improve this answer



























        up vote
        19
        down vote



        accepted










        There are different classes of mathematical symbols in LaTeX, as discussed in this question: What is the difference between mathbin vs. mathrel?



        Depending on the class of a math symbol, surrounding space will be modified in predictable, relevant ways. The comma is of the type mathpunct (mathematic punctuation) which, when surrounded by math atoms, inserts a small amount of space after itself, in what would be a typical use of punctuation grammar.



        The way to override the natural behavior of a symbol class is to isolate it from surrounding math, typically done by embracing the symbol in its own group, as in {,}. In this way, the comma is made unaware of the existence of surrounding math and therefore does not insert the customary space associated with its use.



        Thus, to the specific question of the OP, the use of $x =100{,}000$ will insert the comma without the customary space associated with mathematical punctuation.



        Just for completeness, one should note that one can do the opposite, as well; that is, inserting customary space even in the absence of surrounding math. One does that by inserting empty math groups adjacent to the symbol. In the case of a comma, ,{} is sufficient to trigger the insertion of the space, even if there are no surrounding (non-empty) math atoms.






        share|improve this answer

























          up vote
          19
          down vote



          accepted







          up vote
          19
          down vote



          accepted






          There are different classes of mathematical symbols in LaTeX, as discussed in this question: What is the difference between mathbin vs. mathrel?



          Depending on the class of a math symbol, surrounding space will be modified in predictable, relevant ways. The comma is of the type mathpunct (mathematic punctuation) which, when surrounded by math atoms, inserts a small amount of space after itself, in what would be a typical use of punctuation grammar.



          The way to override the natural behavior of a symbol class is to isolate it from surrounding math, typically done by embracing the symbol in its own group, as in {,}. In this way, the comma is made unaware of the existence of surrounding math and therefore does not insert the customary space associated with its use.



          Thus, to the specific question of the OP, the use of $x =100{,}000$ will insert the comma without the customary space associated with mathematical punctuation.



          Just for completeness, one should note that one can do the opposite, as well; that is, inserting customary space even in the absence of surrounding math. One does that by inserting empty math groups adjacent to the symbol. In the case of a comma, ,{} is sufficient to trigger the insertion of the space, even if there are no surrounding (non-empty) math atoms.






          share|improve this answer














          There are different classes of mathematical symbols in LaTeX, as discussed in this question: What is the difference between mathbin vs. mathrel?



          Depending on the class of a math symbol, surrounding space will be modified in predictable, relevant ways. The comma is of the type mathpunct (mathematic punctuation) which, when surrounded by math atoms, inserts a small amount of space after itself, in what would be a typical use of punctuation grammar.



          The way to override the natural behavior of a symbol class is to isolate it from surrounding math, typically done by embracing the symbol in its own group, as in {,}. In this way, the comma is made unaware of the existence of surrounding math and therefore does not insert the customary space associated with its use.



          Thus, to the specific question of the OP, the use of $x =100{,}000$ will insert the comma without the customary space associated with mathematical punctuation.



          Just for completeness, one should note that one can do the opposite, as well; that is, inserting customary space even in the absence of surrounding math. One does that by inserting empty math groups adjacent to the symbol. In the case of a comma, ,{} is sufficient to trigger the insertion of the space, even if there are no surrounding (non-empty) math atoms.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 '17 at 12:35









          Community

          1




          1










          answered Apr 8 '16 at 4:25









          Steven B. Segletes

          151k9191398




          151k9191398






















              up vote
              7
              down vote













              You can use the icomma package. But you must then ensure that you input a space after a comma if you want a space:



              documentclass{article}
              usepackage{icomma}
              begin{document}

              $(a, b, c) = f(x, y) $

              $(a,b,c) = f(x,y) $ %wrong

              $100,000$

              end{document}


              enter image description here






              share|improve this answer

























                up vote
                7
                down vote













                You can use the icomma package. But you must then ensure that you input a space after a comma if you want a space:



                documentclass{article}
                usepackage{icomma}
                begin{document}

                $(a, b, c) = f(x, y) $

                $(a,b,c) = f(x,y) $ %wrong

                $100,000$

                end{document}


                enter image description here






                share|improve this answer























                  up vote
                  7
                  down vote










                  up vote
                  7
                  down vote









                  You can use the icomma package. But you must then ensure that you input a space after a comma if you want a space:



                  documentclass{article}
                  usepackage{icomma}
                  begin{document}

                  $(a, b, c) = f(x, y) $

                  $(a,b,c) = f(x,y) $ %wrong

                  $100,000$

                  end{document}


                  enter image description here






                  share|improve this answer












                  You can use the icomma package. But you must then ensure that you input a space after a comma if you want a space:



                  documentclass{article}
                  usepackage{icomma}
                  begin{document}

                  $(a, b, c) = f(x, y) $

                  $(a,b,c) = f(x,y) $ %wrong

                  $100,000$

                  end{document}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 8 '16 at 6:46









                  Ulrike Fischer

                  183k7288664




                  183k7288664






























                      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%2f303110%2favoid-space-after-thousands-separator-in-math-mode%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

                      Entries order in /etc/network/interfaces

                      新発田市

                      Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)