Make paired delimiter with prefix for Re and Im











up vote
1
down vote

favorite












I'm trying to make a new command for something like this:



operatorname{Re}leftlbracenum{1+2i}rightrbrace


Because I'm using the mathtools package already I tried to do something like this:
(And I have to undefine the previous Re and Im commands, because they are ugly and this command should be obviously called Re and Im.)



letReundefined
letImundefined
DeclarePairedDelimiterRe{operatorname{Re}lbrace}{rbrace}
DeclarePairedDelimiterIm{operatorname{Im}lbrace}{rbrace}


This will work, but will also spit put many errors. Like: Missing { inserted. end{align} and so on.



Then I thought: Yes, this is probably, because the font can not scale (and shouldn't), like the lbrace and rbrace. And I tried something like this:



letReundefined
letImundefined
DeclarePairedDelimiterbraces{lbrace}{rbrace}
newcommand{Re}{1}{operatorname{Re}braces*{#1}}
newcommand{Im}{1}{operatorname{Im}braces*{#1}}


But this will produce:




Missing $ inserted. newcommand{Re}{1}{operatorname{Re}



Missing begin{document}. newcommand{Re}{1}{operatorname{Re}




Inserting ensuremath or something like that doesn't help much.



Last try:



letReundefined
letImundefined
newcommand{Re}{1}{operatorname{Re}leftlbrace #1 rightrbrace}
newcommand{Im}{1}{operatorname{Im}leftlbrace #1 rightrbrace}



Missing $ inserted. newcommand{Re}{1}{operatorname{Re}



Missing begin{document}. newcommand{Re}{1}{operatorname{Re}



You can't use `macro parameter character #' in math mode. ...nd{Re}{1}{operatorname{Re}leftlbrace #




It can't be this hard to make something like this work, or can it? I really don't know what I should try next, or what am I even doing wrong.










share|improve this question






















  • why do you want left and right with 1+2i? you would get better spacing with (1+2i) than with left(1+2iright)
    – David Carlisle
    4 hours ago















up vote
1
down vote

favorite












I'm trying to make a new command for something like this:



operatorname{Re}leftlbracenum{1+2i}rightrbrace


Because I'm using the mathtools package already I tried to do something like this:
(And I have to undefine the previous Re and Im commands, because they are ugly and this command should be obviously called Re and Im.)



letReundefined
letImundefined
DeclarePairedDelimiterRe{operatorname{Re}lbrace}{rbrace}
DeclarePairedDelimiterIm{operatorname{Im}lbrace}{rbrace}


This will work, but will also spit put many errors. Like: Missing { inserted. end{align} and so on.



Then I thought: Yes, this is probably, because the font can not scale (and shouldn't), like the lbrace and rbrace. And I tried something like this:



letReundefined
letImundefined
DeclarePairedDelimiterbraces{lbrace}{rbrace}
newcommand{Re}{1}{operatorname{Re}braces*{#1}}
newcommand{Im}{1}{operatorname{Im}braces*{#1}}


But this will produce:




Missing $ inserted. newcommand{Re}{1}{operatorname{Re}



Missing begin{document}. newcommand{Re}{1}{operatorname{Re}




Inserting ensuremath or something like that doesn't help much.



Last try:



letReundefined
letImundefined
newcommand{Re}{1}{operatorname{Re}leftlbrace #1 rightrbrace}
newcommand{Im}{1}{operatorname{Im}leftlbrace #1 rightrbrace}



Missing $ inserted. newcommand{Re}{1}{operatorname{Re}



Missing begin{document}. newcommand{Re}{1}{operatorname{Re}



You can't use `macro parameter character #' in math mode. ...nd{Re}{1}{operatorname{Re}leftlbrace #




It can't be this hard to make something like this work, or can it? I really don't know what I should try next, or what am I even doing wrong.










share|improve this question






















  • why do you want left and right with 1+2i? you would get better spacing with (1+2i) than with left(1+2iright)
    – David Carlisle
    4 hours ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm trying to make a new command for something like this:



operatorname{Re}leftlbracenum{1+2i}rightrbrace


Because I'm using the mathtools package already I tried to do something like this:
(And I have to undefine the previous Re and Im commands, because they are ugly and this command should be obviously called Re and Im.)



letReundefined
letImundefined
DeclarePairedDelimiterRe{operatorname{Re}lbrace}{rbrace}
DeclarePairedDelimiterIm{operatorname{Im}lbrace}{rbrace}


This will work, but will also spit put many errors. Like: Missing { inserted. end{align} and so on.



Then I thought: Yes, this is probably, because the font can not scale (and shouldn't), like the lbrace and rbrace. And I tried something like this:



letReundefined
letImundefined
DeclarePairedDelimiterbraces{lbrace}{rbrace}
newcommand{Re}{1}{operatorname{Re}braces*{#1}}
newcommand{Im}{1}{operatorname{Im}braces*{#1}}


But this will produce:




Missing $ inserted. newcommand{Re}{1}{operatorname{Re}



Missing begin{document}. newcommand{Re}{1}{operatorname{Re}




Inserting ensuremath or something like that doesn't help much.



Last try:



letReundefined
letImundefined
newcommand{Re}{1}{operatorname{Re}leftlbrace #1 rightrbrace}
newcommand{Im}{1}{operatorname{Im}leftlbrace #1 rightrbrace}



Missing $ inserted. newcommand{Re}{1}{operatorname{Re}



Missing begin{document}. newcommand{Re}{1}{operatorname{Re}



You can't use `macro parameter character #' in math mode. ...nd{Re}{1}{operatorname{Re}leftlbrace #




It can't be this hard to make something like this work, or can it? I really don't know what I should try next, or what am I even doing wrong.










share|improve this question













I'm trying to make a new command for something like this:



operatorname{Re}leftlbracenum{1+2i}rightrbrace


Because I'm using the mathtools package already I tried to do something like this:
(And I have to undefine the previous Re and Im commands, because they are ugly and this command should be obviously called Re and Im.)



letReundefined
letImundefined
DeclarePairedDelimiterRe{operatorname{Re}lbrace}{rbrace}
DeclarePairedDelimiterIm{operatorname{Im}lbrace}{rbrace}


This will work, but will also spit put many errors. Like: Missing { inserted. end{align} and so on.



Then I thought: Yes, this is probably, because the font can not scale (and shouldn't), like the lbrace and rbrace. And I tried something like this:



letReundefined
letImundefined
DeclarePairedDelimiterbraces{lbrace}{rbrace}
newcommand{Re}{1}{operatorname{Re}braces*{#1}}
newcommand{Im}{1}{operatorname{Im}braces*{#1}}


But this will produce:




Missing $ inserted. newcommand{Re}{1}{operatorname{Re}



Missing begin{document}. newcommand{Re}{1}{operatorname{Re}




Inserting ensuremath or something like that doesn't help much.



Last try:



letReundefined
letImundefined
newcommand{Re}{1}{operatorname{Re}leftlbrace #1 rightrbrace}
newcommand{Im}{1}{operatorname{Im}leftlbrace #1 rightrbrace}



Missing $ inserted. newcommand{Re}{1}{operatorname{Re}



Missing begin{document}. newcommand{Re}{1}{operatorname{Re}



You can't use `macro parameter character #' in math mode. ...nd{Re}{1}{operatorname{Re}leftlbrace #




It can't be this hard to make something like this work, or can it? I really don't know what I should try next, or what am I even doing wrong.







math-mode macros mathtools






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 4 hours ago









Darkproduct

112




112












  • why do you want left and right with 1+2i? you would get better spacing with (1+2i) than with left(1+2iright)
    – David Carlisle
    4 hours ago


















  • why do you want left and right with 1+2i? you would get better spacing with (1+2i) than with left(1+2iright)
    – David Carlisle
    4 hours ago
















why do you want left and right with 1+2i? you would get better spacing with (1+2i) than with left(1+2iright)
– David Carlisle
4 hours ago




why do you want left and right with 1+2i? you would get better spacing with (1+2i) than with left(1+2iright)
– David Carlisle
4 hours ago










2 Answers
2






active

oldest

votes

















up vote
3
down vote













You have the incorrect syntax for newcommand.



newcommand{Re}{1}


should be



newcommand{Re}[1]





share|improve this answer




























    up vote
    1
    down vote













    You can use the DeclarePairedDelimiterXPPfrom mathtools. It will define Reand Im commands, which have a star version (adds a pair of implicit left right in front of the delimiters), but they also accept an optional argument among big, Big, bigg and Bigg, which adds a pair oof implicit bigl bigr, &c.



    documentclass[10pt]{article}
    usepackage{mathtools} %
    letReundefined
    letImundefined
    DeclarePairedDelimiterXPPRe[1]{mathrm{Re}}{lbrace}{rbrace}{}{#1}
    DeclarePairedDelimiterXPPIm[1]{mathrm{Im}}{lbrace}{rbrace}{}{#1}

    begin{document}

    [ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%

    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%2f462264%2fmake-paired-delimiter-with-prefix-for-re-and-im%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
      3
      down vote













      You have the incorrect syntax for newcommand.



      newcommand{Re}{1}


      should be



      newcommand{Re}[1]





      share|improve this answer

























        up vote
        3
        down vote













        You have the incorrect syntax for newcommand.



        newcommand{Re}{1}


        should be



        newcommand{Re}[1]





        share|improve this answer























          up vote
          3
          down vote










          up vote
          3
          down vote









          You have the incorrect syntax for newcommand.



          newcommand{Re}{1}


          should be



          newcommand{Re}[1]





          share|improve this answer












          You have the incorrect syntax for newcommand.



          newcommand{Re}{1}


          should be



          newcommand{Re}[1]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 4 hours ago









          David Carlisle

          478k3811071841




          478k3811071841






















              up vote
              1
              down vote













              You can use the DeclarePairedDelimiterXPPfrom mathtools. It will define Reand Im commands, which have a star version (adds a pair of implicit left right in front of the delimiters), but they also accept an optional argument among big, Big, bigg and Bigg, which adds a pair oof implicit bigl bigr, &c.



              documentclass[10pt]{article}
              usepackage{mathtools} %
              letReundefined
              letImundefined
              DeclarePairedDelimiterXPPRe[1]{mathrm{Re}}{lbrace}{rbrace}{}{#1}
              DeclarePairedDelimiterXPPIm[1]{mathrm{Im}}{lbrace}{rbrace}{}{#1}

              begin{document}

              [ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%

              end{document}


              enter image description here






              share|improve this answer



























                up vote
                1
                down vote













                You can use the DeclarePairedDelimiterXPPfrom mathtools. It will define Reand Im commands, which have a star version (adds a pair of implicit left right in front of the delimiters), but they also accept an optional argument among big, Big, bigg and Bigg, which adds a pair oof implicit bigl bigr, &c.



                documentclass[10pt]{article}
                usepackage{mathtools} %
                letReundefined
                letImundefined
                DeclarePairedDelimiterXPPRe[1]{mathrm{Re}}{lbrace}{rbrace}{}{#1}
                DeclarePairedDelimiterXPPIm[1]{mathrm{Im}}{lbrace}{rbrace}{}{#1}

                begin{document}

                [ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%

                end{document}


                enter image description here






                share|improve this answer

























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  You can use the DeclarePairedDelimiterXPPfrom mathtools. It will define Reand Im commands, which have a star version (adds a pair of implicit left right in front of the delimiters), but they also accept an optional argument among big, Big, bigg and Bigg, which adds a pair oof implicit bigl bigr, &c.



                  documentclass[10pt]{article}
                  usepackage{mathtools} %
                  letReundefined
                  letImundefined
                  DeclarePairedDelimiterXPPRe[1]{mathrm{Re}}{lbrace}{rbrace}{}{#1}
                  DeclarePairedDelimiterXPPIm[1]{mathrm{Im}}{lbrace}{rbrace}{}{#1}

                  begin{document}

                  [ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%

                  end{document}


                  enter image description here






                  share|improve this answer














                  You can use the DeclarePairedDelimiterXPPfrom mathtools. It will define Reand Im commands, which have a star version (adds a pair of implicit left right in front of the delimiters), but they also accept an optional argument among big, Big, bigg and Bigg, which adds a pair oof implicit bigl bigr, &c.



                  documentclass[10pt]{article}
                  usepackage{mathtools} %
                  letReundefined
                  letImundefined
                  DeclarePairedDelimiterXPPRe[1]{mathrm{Re}}{lbrace}{rbrace}{}{#1}
                  DeclarePairedDelimiterXPPIm[1]{mathrm{Im}}{lbrace}{rbrace}{}{#1}

                  begin{document}

                  [ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%

                  end{document}


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 4 hours ago

























                  answered 4 hours ago









                  Bernard

                  162k767192




                  162k767192






























                       

                      draft saved


                      draft discarded



















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462264%2fmake-paired-delimiter-with-prefix-for-re-and-im%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

                      Catalogne

                      Violoncelliste

                      Héron pourpré