Typesetting an integer interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How can I see the “implementation” of the LaTeX command?How to properly typeset math intervalsvertical spacing in multiline gather with amsmathExtra space between number and variable in math modeCorrectly typesetting a relationUsing the parskip package, I find the space between subtitles uglyToo much space below figuresDecrease horizontal space in moderncv's cvdoubleitemTypesetting longitude or latitude followed by a commaZero space between bars of the same interval in pgfplots ybar interval plotsLarge Brackets Make Line Breaks too SmallTypesetting Hermann-Mauguin notation correctlyHow to increase Chinese character space?

The Nth Gryphon Number

Why do early math courses focus on the cross sections of a cone and not on other 3D objects?

Can a sorcerer use careful spell on himself?

Would it be easier to apply for a UK visa if there is a host family to sponsor for you in going there?

What makes a man succeed?

The test team as an enemy of development? And how can this be avoided?

Project Euler #1 in C++

What does Turing mean by this statement?

Putting class ranking in CV, but against dept guidelines

Random body shuffle every night—can we still function?

How were pictures turned from film to a big picture in a picture frame before digital scanning?

Is there hard evidence that the grant peer review system performs significantly better than random?

Deconstruction is ambiguous

1-probability to calculate two events in a row

How do I find out the mythology and history of my Fortress?

Draw 4 of the same figure in the same tikzpicture

Amount of permutations on an NxNxN Rubik's Cube

How much damage would a cupful of neutron star matter do to the Earth?

How often does castling occur in grandmaster games?

A term for a woman complaining about things/begging in a cute/childish way

Lagrange four-squares theorem --- deterministic complexity

Maximum summed subsequences with non-adjacent items

Do I really need to have a message in a novel to appeal to readers?

What is the meaning of 'breadth' in breadth first search?



Typesetting an integer interval



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How can I see the “implementation” of the LaTeX command?How to properly typeset math intervalsvertical spacing in multiline gather with amsmathExtra space between number and variable in math modeCorrectly typesetting a relationUsing the parskip package, I find the space between subtitles uglyToo much space below figuresDecrease horizontal space in moderncv's cvdoubleitemTypesetting longitude or latitude followed by a commaZero space between bars of the same interval in pgfplots ybar interval plotsLarge Brackets Make Line Breaks too SmallTypesetting Hermann-Mauguin notation correctlyHow to increase Chinese character space?










12















I am trying to typeset a integer interval like this: [0..m-1]



However, the space between 0,., and m - 1 are too small. Is there a package to improve this?










share|improve this question






















  • $[0 dots m-1]$?

    – Rmano
    Apr 16 '16 at 19:00






  • 3





    @Rmano It must be two dots.

    – Henricus V.
    Apr 16 '16 at 19:01















12















I am trying to typeset a integer interval like this: [0..m-1]



However, the space between 0,., and m - 1 are too small. Is there a package to improve this?










share|improve this question






















  • $[0 dots m-1]$?

    – Rmano
    Apr 16 '16 at 19:00






  • 3





    @Rmano It must be two dots.

    – Henricus V.
    Apr 16 '16 at 19:01













12












12








12


3






I am trying to typeset a integer interval like this: [0..m-1]



However, the space between 0,., and m - 1 are too small. Is there a package to improve this?










share|improve this question














I am trying to typeset a integer interval like this: [0..m-1]



However, the space between 0,., and m - 1 are too small. Is there a package to improve this?







spacing






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 16 '16 at 18:35









Henricus V.Henricus V.

448412




448412












  • $[0 dots m-1]$?

    – Rmano
    Apr 16 '16 at 19:00






  • 3





    @Rmano It must be two dots.

    – Henricus V.
    Apr 16 '16 at 19:01

















  • $[0 dots m-1]$?

    – Rmano
    Apr 16 '16 at 19:00






  • 3





    @Rmano It must be two dots.

    – Henricus V.
    Apr 16 '16 at 19:01
















$[0 dots m-1]$?

– Rmano
Apr 16 '16 at 19:00





$[0 dots m-1]$?

– Rmano
Apr 16 '16 at 19:00




3




3





@Rmano It must be two dots.

– Henricus V.
Apr 16 '16 at 19:01





@Rmano It must be two dots.

– Henricus V.
Apr 16 '16 at 19:01










5 Answers
5






active

oldest

votes


















13














Let's see how I can make a command that is like a dots but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:



[romano:~] % texdef -t latex dots 
dots:
macro:->protect dots
dots :
long macro:->ifmmode mathellipsis else textellipsis fi

[romano:~] % texdef -t latex mathellipsis
mathellipsis:
macro:->mathinner ldotp ldotp ldotp


and finally:



 newcommandtwodotsmathinner ldotp ldotp


which results in:



twodots macro



(This is just for math mode, but you can easily extend it for text too, mimicking the dots definition)






share|improve this answer
































    9














    I like the two dots, too. My usual code is



    [amathrel.,.nobreak b]


    of course hidden in a macro.



    documentclassarticle
    usepackageamsmath

    newcommandisepmathrel.,.nobreak

    begindocument

    $[0isep m-1]$

    enddocument


    enter image description here



    A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.



    documentclassarticle
    usepackageamsmath,mleftright
    usepackagexparse

    ExplSyntaxOn
    NewDocumentCommandintervalO>SplitArgument1,m

    group_begin:
    keys_set:nn calcolo/interval o, #1
    bool_if:NTF l_calcolo_interval_auto_bool
    mleftl_calcolo_interval_left_tl
    mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
    calcolo_interval_set:nn #2
    bool_if:NTF l_calcolo_interval_auto_bool
    mrightl_calcolo_interval_right_tl
    mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
    group_end:

    cs_new_protected:Nn calcolo_interval_set:nn

    #1 mathrel.,.nobreak #2

    keys_define:nn calcolo/interval

    size .code:n =
    tl_if_eq:nnTF #1 *
    bool_set_true:N l_calcolo_interval_auto_bool
    tl_set:Nn l_calcolo_interval_size_tl #1 ,
    o .code:n =
    tl_set:Nn l_calcolo_interval_left_tl (
    tl_set:Nn l_calcolo_interval_right_tl ) ,
    oo .code:n =
    tl_set:Nn l_calcolo_interval_left_tl (
    tl_set:Nn l_calcolo_interval_right_tl ) ,
    c .code:n =
    tl_set:Nn l_calcolo_interval_left_tl [
    tl_set:Nn l_calcolo_interval_right_tl ] ,
    cc .code:n =
    tl_set:Nn l_calcolo_interval_left_tl [
    tl_set:Nn l_calcolo_interval_right_tl ] ,
    oc .code:n =
    tl_set:Nn l_calcolo_interval_left_tl (
    tl_set:Nn l_calcolo_interval_right_tl ] ,
    co .code:n =
    tl_set:Nn l_calcolo_interval_left_tl [
    tl_set:Nn l_calcolo_interval_right_tl ) ,
    o .value_forbidden:n = true,
    oo .value_forbidden:n = true,
    c .value_forbidden:n = true,
    cc .value_forbidden:n = true,
    oc .value_forbidden:n = true,
    co .value_forbidden:n = true,


    tl_new:N l_calcolo_interval_left_tl
    tl_new:N l_calcolo_interval_right_tl
    tl_new:N l_calcolo_interval_size_tl
    bool_new:N l_calcolo_interval_auto_bool
    ExplSyntaxOff


    begindocument

    $intervala,b$

    $interval[c]a,b$

    $interval[co]a,b$

    $interval[oc]a,b$

    $interval[size=Big]a,b$

    bigskip

    $interval[size=*,co]dfracdfrac12dfrac34,b$

    enddocument


    enter image description here






    share|improve this answer
































      4














      Here is a solution with mathtools and xparse. I define a command Iintvlm,n. You need a font which contains the relevant delimiters, llbracket and rrbracket (fourier and stmaryrd) or equivalents (MnSymbol and MdSymbol have lsem and rsem). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …).



      documentclassarticle
      usepackagemathtools, stmaryrd
      usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
      NewDocumentCommandiintvargs>SplitArgument1,m
      iintvargsaux#1 %
      NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2

      begindocument

      [ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]

      enddocument


      enter image description here






      share|improve this answer






























        0














        Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code



        defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
        $
        intv[a..b]
        intvbig[a..b]
        intvBigg[fracab..c]
        $


        If you need left[ .. right] I can add the code.






        share|improve this answer




















        • 2





          nobreak is necessary after mathrel... or TeX would be allowed to put a line break.

          – egreg
          Apr 16 '16 at 21:42











        • Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.

          – Manuel
          Apr 16 '16 at 21:43


















        0














        Use enleadertwodots in the stix package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:



        documentclass[10pt]article
        usepackagestix
        begindocument

        [[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]

        enddocument


        p1



        I found this after scanning through this huge list of symbols in latex.






        share|improve this answer








        New contributor




        ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.




















          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',
          autoActivateHeartbeat: false,
          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%2f304662%2ftypesetting-an-integer-interval%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          13














          Let's see how I can make a command that is like a dots but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:



          [romano:~] % texdef -t latex dots 
          dots:
          macro:->protect dots
          dots :
          long macro:->ifmmode mathellipsis else textellipsis fi

          [romano:~] % texdef -t latex mathellipsis
          mathellipsis:
          macro:->mathinner ldotp ldotp ldotp


          and finally:



           newcommandtwodotsmathinner ldotp ldotp


          which results in:



          twodots macro



          (This is just for math mode, but you can easily extend it for text too, mimicking the dots definition)






          share|improve this answer





























            13














            Let's see how I can make a command that is like a dots but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:



            [romano:~] % texdef -t latex dots 
            dots:
            macro:->protect dots
            dots :
            long macro:->ifmmode mathellipsis else textellipsis fi

            [romano:~] % texdef -t latex mathellipsis
            mathellipsis:
            macro:->mathinner ldotp ldotp ldotp


            and finally:



             newcommandtwodotsmathinner ldotp ldotp


            which results in:



            twodots macro



            (This is just for math mode, but you can easily extend it for text too, mimicking the dots definition)






            share|improve this answer



























              13












              13








              13







              Let's see how I can make a command that is like a dots but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:



              [romano:~] % texdef -t latex dots 
              dots:
              macro:->protect dots
              dots :
              long macro:->ifmmode mathellipsis else textellipsis fi

              [romano:~] % texdef -t latex mathellipsis
              mathellipsis:
              macro:->mathinner ldotp ldotp ldotp


              and finally:



               newcommandtwodotsmathinner ldotp ldotp


              which results in:



              twodots macro



              (This is just for math mode, but you can easily extend it for text too, mimicking the dots definition)






              share|improve this answer















              Let's see how I can make a command that is like a dots but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:



              [romano:~] % texdef -t latex dots 
              dots:
              macro:->protect dots
              dots :
              long macro:->ifmmode mathellipsis else textellipsis fi

              [romano:~] % texdef -t latex mathellipsis
              mathellipsis:
              macro:->mathinner ldotp ldotp ldotp


              and finally:



               newcommandtwodotsmathinner ldotp ldotp


              which results in:



              twodots macro



              (This is just for math mode, but you can easily extend it for text too, mimicking the dots definition)







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Apr 13 '17 at 12:35









              Community

              1




              1










              answered Apr 16 '16 at 19:14









              RmanoRmano

              8,28121648




              8,28121648





















                  9














                  I like the two dots, too. My usual code is



                  [amathrel.,.nobreak b]


                  of course hidden in a macro.



                  documentclassarticle
                  usepackageamsmath

                  newcommandisepmathrel.,.nobreak

                  begindocument

                  $[0isep m-1]$

                  enddocument


                  enter image description here



                  A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.



                  documentclassarticle
                  usepackageamsmath,mleftright
                  usepackagexparse

                  ExplSyntaxOn
                  NewDocumentCommandintervalO>SplitArgument1,m

                  group_begin:
                  keys_set:nn calcolo/interval o, #1
                  bool_if:NTF l_calcolo_interval_auto_bool
                  mleftl_calcolo_interval_left_tl
                  mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
                  calcolo_interval_set:nn #2
                  bool_if:NTF l_calcolo_interval_auto_bool
                  mrightl_calcolo_interval_right_tl
                  mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
                  group_end:

                  cs_new_protected:Nn calcolo_interval_set:nn

                  #1 mathrel.,.nobreak #2

                  keys_define:nn calcolo/interval

                  size .code:n =
                  tl_if_eq:nnTF #1 *
                  bool_set_true:N l_calcolo_interval_auto_bool
                  tl_set:Nn l_calcolo_interval_size_tl #1 ,
                  o .code:n =
                  tl_set:Nn l_calcolo_interval_left_tl (
                  tl_set:Nn l_calcolo_interval_right_tl ) ,
                  oo .code:n =
                  tl_set:Nn l_calcolo_interval_left_tl (
                  tl_set:Nn l_calcolo_interval_right_tl ) ,
                  c .code:n =
                  tl_set:Nn l_calcolo_interval_left_tl [
                  tl_set:Nn l_calcolo_interval_right_tl ] ,
                  cc .code:n =
                  tl_set:Nn l_calcolo_interval_left_tl [
                  tl_set:Nn l_calcolo_interval_right_tl ] ,
                  oc .code:n =
                  tl_set:Nn l_calcolo_interval_left_tl (
                  tl_set:Nn l_calcolo_interval_right_tl ] ,
                  co .code:n =
                  tl_set:Nn l_calcolo_interval_left_tl [
                  tl_set:Nn l_calcolo_interval_right_tl ) ,
                  o .value_forbidden:n = true,
                  oo .value_forbidden:n = true,
                  c .value_forbidden:n = true,
                  cc .value_forbidden:n = true,
                  oc .value_forbidden:n = true,
                  co .value_forbidden:n = true,


                  tl_new:N l_calcolo_interval_left_tl
                  tl_new:N l_calcolo_interval_right_tl
                  tl_new:N l_calcolo_interval_size_tl
                  bool_new:N l_calcolo_interval_auto_bool
                  ExplSyntaxOff


                  begindocument

                  $intervala,b$

                  $interval[c]a,b$

                  $interval[co]a,b$

                  $interval[oc]a,b$

                  $interval[size=Big]a,b$

                  bigskip

                  $interval[size=*,co]dfracdfrac12dfrac34,b$

                  enddocument


                  enter image description here






                  share|improve this answer





























                    9














                    I like the two dots, too. My usual code is



                    [amathrel.,.nobreak b]


                    of course hidden in a macro.



                    documentclassarticle
                    usepackageamsmath

                    newcommandisepmathrel.,.nobreak

                    begindocument

                    $[0isep m-1]$

                    enddocument


                    enter image description here



                    A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.



                    documentclassarticle
                    usepackageamsmath,mleftright
                    usepackagexparse

                    ExplSyntaxOn
                    NewDocumentCommandintervalO>SplitArgument1,m

                    group_begin:
                    keys_set:nn calcolo/interval o, #1
                    bool_if:NTF l_calcolo_interval_auto_bool
                    mleftl_calcolo_interval_left_tl
                    mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
                    calcolo_interval_set:nn #2
                    bool_if:NTF l_calcolo_interval_auto_bool
                    mrightl_calcolo_interval_right_tl
                    mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
                    group_end:

                    cs_new_protected:Nn calcolo_interval_set:nn

                    #1 mathrel.,.nobreak #2

                    keys_define:nn calcolo/interval

                    size .code:n =
                    tl_if_eq:nnTF #1 *
                    bool_set_true:N l_calcolo_interval_auto_bool
                    tl_set:Nn l_calcolo_interval_size_tl #1 ,
                    o .code:n =
                    tl_set:Nn l_calcolo_interval_left_tl (
                    tl_set:Nn l_calcolo_interval_right_tl ) ,
                    oo .code:n =
                    tl_set:Nn l_calcolo_interval_left_tl (
                    tl_set:Nn l_calcolo_interval_right_tl ) ,
                    c .code:n =
                    tl_set:Nn l_calcolo_interval_left_tl [
                    tl_set:Nn l_calcolo_interval_right_tl ] ,
                    cc .code:n =
                    tl_set:Nn l_calcolo_interval_left_tl [
                    tl_set:Nn l_calcolo_interval_right_tl ] ,
                    oc .code:n =
                    tl_set:Nn l_calcolo_interval_left_tl (
                    tl_set:Nn l_calcolo_interval_right_tl ] ,
                    co .code:n =
                    tl_set:Nn l_calcolo_interval_left_tl [
                    tl_set:Nn l_calcolo_interval_right_tl ) ,
                    o .value_forbidden:n = true,
                    oo .value_forbidden:n = true,
                    c .value_forbidden:n = true,
                    cc .value_forbidden:n = true,
                    oc .value_forbidden:n = true,
                    co .value_forbidden:n = true,


                    tl_new:N l_calcolo_interval_left_tl
                    tl_new:N l_calcolo_interval_right_tl
                    tl_new:N l_calcolo_interval_size_tl
                    bool_new:N l_calcolo_interval_auto_bool
                    ExplSyntaxOff


                    begindocument

                    $intervala,b$

                    $interval[c]a,b$

                    $interval[co]a,b$

                    $interval[oc]a,b$

                    $interval[size=Big]a,b$

                    bigskip

                    $interval[size=*,co]dfracdfrac12dfrac34,b$

                    enddocument


                    enter image description here






                    share|improve this answer



























                      9












                      9








                      9







                      I like the two dots, too. My usual code is



                      [amathrel.,.nobreak b]


                      of course hidden in a macro.



                      documentclassarticle
                      usepackageamsmath

                      newcommandisepmathrel.,.nobreak

                      begindocument

                      $[0isep m-1]$

                      enddocument


                      enter image description here



                      A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.



                      documentclassarticle
                      usepackageamsmath,mleftright
                      usepackagexparse

                      ExplSyntaxOn
                      NewDocumentCommandintervalO>SplitArgument1,m

                      group_begin:
                      keys_set:nn calcolo/interval o, #1
                      bool_if:NTF l_calcolo_interval_auto_bool
                      mleftl_calcolo_interval_left_tl
                      mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
                      calcolo_interval_set:nn #2
                      bool_if:NTF l_calcolo_interval_auto_bool
                      mrightl_calcolo_interval_right_tl
                      mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
                      group_end:

                      cs_new_protected:Nn calcolo_interval_set:nn

                      #1 mathrel.,.nobreak #2

                      keys_define:nn calcolo/interval

                      size .code:n =
                      tl_if_eq:nnTF #1 *
                      bool_set_true:N l_calcolo_interval_auto_bool
                      tl_set:Nn l_calcolo_interval_size_tl #1 ,
                      o .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl (
                      tl_set:Nn l_calcolo_interval_right_tl ) ,
                      oo .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl (
                      tl_set:Nn l_calcolo_interval_right_tl ) ,
                      c .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl [
                      tl_set:Nn l_calcolo_interval_right_tl ] ,
                      cc .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl [
                      tl_set:Nn l_calcolo_interval_right_tl ] ,
                      oc .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl (
                      tl_set:Nn l_calcolo_interval_right_tl ] ,
                      co .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl [
                      tl_set:Nn l_calcolo_interval_right_tl ) ,
                      o .value_forbidden:n = true,
                      oo .value_forbidden:n = true,
                      c .value_forbidden:n = true,
                      cc .value_forbidden:n = true,
                      oc .value_forbidden:n = true,
                      co .value_forbidden:n = true,


                      tl_new:N l_calcolo_interval_left_tl
                      tl_new:N l_calcolo_interval_right_tl
                      tl_new:N l_calcolo_interval_size_tl
                      bool_new:N l_calcolo_interval_auto_bool
                      ExplSyntaxOff


                      begindocument

                      $intervala,b$

                      $interval[c]a,b$

                      $interval[co]a,b$

                      $interval[oc]a,b$

                      $interval[size=Big]a,b$

                      bigskip

                      $interval[size=*,co]dfracdfrac12dfrac34,b$

                      enddocument


                      enter image description here






                      share|improve this answer















                      I like the two dots, too. My usual code is



                      [amathrel.,.nobreak b]


                      of course hidden in a macro.



                      documentclassarticle
                      usepackageamsmath

                      newcommandisepmathrel.,.nobreak

                      begindocument

                      $[0isep m-1]$

                      enddocument


                      enter image description here



                      A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.



                      documentclassarticle
                      usepackageamsmath,mleftright
                      usepackagexparse

                      ExplSyntaxOn
                      NewDocumentCommandintervalO>SplitArgument1,m

                      group_begin:
                      keys_set:nn calcolo/interval o, #1
                      bool_if:NTF l_calcolo_interval_auto_bool
                      mleftl_calcolo_interval_left_tl
                      mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
                      calcolo_interval_set:nn #2
                      bool_if:NTF l_calcolo_interval_auto_bool
                      mrightl_calcolo_interval_right_tl
                      mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
                      group_end:

                      cs_new_protected:Nn calcolo_interval_set:nn

                      #1 mathrel.,.nobreak #2

                      keys_define:nn calcolo/interval

                      size .code:n =
                      tl_if_eq:nnTF #1 *
                      bool_set_true:N l_calcolo_interval_auto_bool
                      tl_set:Nn l_calcolo_interval_size_tl #1 ,
                      o .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl (
                      tl_set:Nn l_calcolo_interval_right_tl ) ,
                      oo .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl (
                      tl_set:Nn l_calcolo_interval_right_tl ) ,
                      c .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl [
                      tl_set:Nn l_calcolo_interval_right_tl ] ,
                      cc .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl [
                      tl_set:Nn l_calcolo_interval_right_tl ] ,
                      oc .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl (
                      tl_set:Nn l_calcolo_interval_right_tl ] ,
                      co .code:n =
                      tl_set:Nn l_calcolo_interval_left_tl [
                      tl_set:Nn l_calcolo_interval_right_tl ) ,
                      o .value_forbidden:n = true,
                      oo .value_forbidden:n = true,
                      c .value_forbidden:n = true,
                      cc .value_forbidden:n = true,
                      oc .value_forbidden:n = true,
                      co .value_forbidden:n = true,


                      tl_new:N l_calcolo_interval_left_tl
                      tl_new:N l_calcolo_interval_right_tl
                      tl_new:N l_calcolo_interval_size_tl
                      bool_new:N l_calcolo_interval_auto_bool
                      ExplSyntaxOff


                      begindocument

                      $intervala,b$

                      $interval[c]a,b$

                      $interval[co]a,b$

                      $interval[oc]a,b$

                      $interval[size=Big]a,b$

                      bigskip

                      $interval[size=*,co]dfracdfrac12dfrac34,b$

                      enddocument


                      enter image description here







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Apr 16 '16 at 20:18









                      AboAmmar

                      34.7k32985




                      34.7k32985










                      answered Apr 16 '16 at 19:33









                      egregegreg

                      735k8919343259




                      735k8919343259





















                          4














                          Here is a solution with mathtools and xparse. I define a command Iintvlm,n. You need a font which contains the relevant delimiters, llbracket and rrbracket (fourier and stmaryrd) or equivalents (MnSymbol and MdSymbol have lsem and rsem). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …).



                          documentclassarticle
                          usepackagemathtools, stmaryrd
                          usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
                          NewDocumentCommandiintvargs>SplitArgument1,m
                          iintvargsaux#1 %
                          NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2

                          begindocument

                          [ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]

                          enddocument


                          enter image description here






                          share|improve this answer



























                            4














                            Here is a solution with mathtools and xparse. I define a command Iintvlm,n. You need a font which contains the relevant delimiters, llbracket and rrbracket (fourier and stmaryrd) or equivalents (MnSymbol and MdSymbol have lsem and rsem). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …).



                            documentclassarticle
                            usepackagemathtools, stmaryrd
                            usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
                            NewDocumentCommandiintvargs>SplitArgument1,m
                            iintvargsaux#1 %
                            NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2

                            begindocument

                            [ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]

                            enddocument


                            enter image description here






                            share|improve this answer

























                              4












                              4








                              4







                              Here is a solution with mathtools and xparse. I define a command Iintvlm,n. You need a font which contains the relevant delimiters, llbracket and rrbracket (fourier and stmaryrd) or equivalents (MnSymbol and MdSymbol have lsem and rsem). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …).



                              documentclassarticle
                              usepackagemathtools, stmaryrd
                              usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
                              NewDocumentCommandiintvargs>SplitArgument1,m
                              iintvargsaux#1 %
                              NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2

                              begindocument

                              [ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]

                              enddocument


                              enter image description here






                              share|improve this answer













                              Here is a solution with mathtools and xparse. I define a command Iintvlm,n. You need a font which contains the relevant delimiters, llbracket and rrbracket (fourier and stmaryrd) or equivalents (MnSymbol and MdSymbol have lsem and rsem). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …).



                              documentclassarticle
                              usepackagemathtools, stmaryrd
                              usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
                              NewDocumentCommandiintvargs>SplitArgument1,m
                              iintvargsaux#1 %
                              NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2

                              begindocument

                              [ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]

                              enddocument


                              enter image description here







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Apr 16 '16 at 19:15









                              BernardBernard

                              176k778210




                              176k778210





















                                  0














                                  Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code



                                  defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
                                  $
                                  intv[a..b]
                                  intvbig[a..b]
                                  intvBigg[fracab..c]
                                  $


                                  If you need left[ .. right] I can add the code.






                                  share|improve this answer




















                                  • 2





                                    nobreak is necessary after mathrel... or TeX would be allowed to put a line break.

                                    – egreg
                                    Apr 16 '16 at 21:42











                                  • Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.

                                    – Manuel
                                    Apr 16 '16 at 21:43















                                  0














                                  Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code



                                  defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
                                  $
                                  intv[a..b]
                                  intvbig[a..b]
                                  intvBigg[fracab..c]
                                  $


                                  If you need left[ .. right] I can add the code.






                                  share|improve this answer




















                                  • 2





                                    nobreak is necessary after mathrel... or TeX would be allowed to put a line break.

                                    – egreg
                                    Apr 16 '16 at 21:42











                                  • Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.

                                    – Manuel
                                    Apr 16 '16 at 21:43













                                  0












                                  0








                                  0







                                  Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code



                                  defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
                                  $
                                  intv[a..b]
                                  intvbig[a..b]
                                  intvBigg[fracab..c]
                                  $


                                  If you need left[ .. right] I can add the code.






                                  share|improve this answer















                                  Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code



                                  defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
                                  $
                                  intv[a..b]
                                  intvbig[a..b]
                                  intvBigg[fracab..c]
                                  $


                                  If you need left[ .. right] I can add the code.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Apr 16 '16 at 21:44

























                                  answered Apr 16 '16 at 21:16









                                  ManuelManuel

                                  21.6k847109




                                  21.6k847109







                                  • 2





                                    nobreak is necessary after mathrel... or TeX would be allowed to put a line break.

                                    – egreg
                                    Apr 16 '16 at 21:42











                                  • Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.

                                    – Manuel
                                    Apr 16 '16 at 21:43












                                  • 2





                                    nobreak is necessary after mathrel... or TeX would be allowed to put a line break.

                                    – egreg
                                    Apr 16 '16 at 21:42











                                  • Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.

                                    – Manuel
                                    Apr 16 '16 at 21:43







                                  2




                                  2





                                  nobreak is necessary after mathrel... or TeX would be allowed to put a line break.

                                  – egreg
                                  Apr 16 '16 at 21:42





                                  nobreak is necessary after mathrel... or TeX would be allowed to put a line break.

                                  – egreg
                                  Apr 16 '16 at 21:42













                                  Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.

                                  – Manuel
                                  Apr 16 '16 at 21:43





                                  Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.

                                  – Manuel
                                  Apr 16 '16 at 21:43











                                  0














                                  Use enleadertwodots in the stix package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:



                                  documentclass[10pt]article
                                  usepackagestix
                                  begindocument

                                  [[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]

                                  enddocument


                                  p1



                                  I found this after scanning through this huge list of symbols in latex.






                                  share|improve this answer








                                  New contributor




                                  ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                  Check out our Code of Conduct.
























                                    0














                                    Use enleadertwodots in the stix package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:



                                    documentclass[10pt]article
                                    usepackagestix
                                    begindocument

                                    [[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]

                                    enddocument


                                    p1



                                    I found this after scanning through this huge list of symbols in latex.






                                    share|improve this answer








                                    New contributor




                                    ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.






















                                      0












                                      0








                                      0







                                      Use enleadertwodots in the stix package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:



                                      documentclass[10pt]article
                                      usepackagestix
                                      begindocument

                                      [[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]

                                      enddocument


                                      p1



                                      I found this after scanning through this huge list of symbols in latex.






                                      share|improve this answer








                                      New contributor




                                      ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.










                                      Use enleadertwodots in the stix package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:



                                      documentclass[10pt]article
                                      usepackagestix
                                      begindocument

                                      [[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]

                                      enddocument


                                      p1



                                      I found this after scanning through this huge list of symbols in latex.







                                      share|improve this answer








                                      New contributor




                                      ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.









                                      share|improve this answer



                                      share|improve this answer






                                      New contributor




                                      ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.









                                      answered 13 mins ago









                                      ryanryan

                                      1012




                                      1012




                                      New contributor




                                      ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.





                                      New contributor





                                      ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.






                                      ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.



























                                          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.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function ()
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f304662%2ftypesetting-an-integer-interval%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

                                          Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

                                          Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

                                          Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm