How to typeset an invisible paired delimiter, preferably using MathTools?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I'm trying to typeset the simplification/expansion of a fraction using the notation below, but I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



enter image description here



I figured that if I could declare a set of invisible delimiters using DeclarePairedDelimiter<command><left delimiter><right delimiter> the task would be simple, since I could simply place the fraction inside the delimiters and place the 5cdot 4) relative to the entire block, but I'm not sure if this is possible. Using DeclarePairedDelimiterinvis.. didn't work.



I'm open to other solutions, but if someone has a solution using this particular method, it would make my life a lot simpler.










share|improve this question



























    up vote
    2
    down vote

    favorite












    I'm trying to typeset the simplification/expansion of a fraction using the notation below, but I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



    enter image description here



    I figured that if I could declare a set of invisible delimiters using DeclarePairedDelimiter<command><left delimiter><right delimiter> the task would be simple, since I could simply place the fraction inside the delimiters and place the 5cdot 4) relative to the entire block, but I'm not sure if this is possible. Using DeclarePairedDelimiterinvis.. didn't work.



    I'm open to other solutions, but if someone has a solution using this particular method, it would make my life a lot simpler.










    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I'm trying to typeset the simplification/expansion of a fraction using the notation below, but I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



      enter image description here



      I figured that if I could declare a set of invisible delimiters using DeclarePairedDelimiter<command><left delimiter><right delimiter> the task would be simple, since I could simply place the fraction inside the delimiters and place the 5cdot 4) relative to the entire block, but I'm not sure if this is possible. Using DeclarePairedDelimiterinvis.. didn't work.



      I'm open to other solutions, but if someone has a solution using this particular method, it would make my life a lot simpler.










      share|improve this question















      I'm trying to typeset the simplification/expansion of a fraction using the notation below, but I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



      enter image description here



      I figured that if I could declare a set of invisible delimiters using DeclarePairedDelimiter<command><left delimiter><right delimiter> the task would be simple, since I could simply place the fraction inside the delimiters and place the 5cdot 4) relative to the entire block, but I'm not sure if this is possible. Using DeclarePairedDelimiterinvis.. didn't work.



      I'm open to other solutions, but if someone has a solution using this particular method, it would make my life a lot simpler.







      delimiters fractions mathtools






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago

























      asked 1 hour ago









      TheSodesa

      726




      726




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



          APPROACH 1



          In this approach, the superscript will precede the full fraction, rather than just the numerator. It will also take up horizontal space, rather than be a lapped quantity.



          EDITED to allow [l]eft or [r]ight positioning with use of optional argument.



          documentclassarticle
          usepackagestackengine
          newcommandsimpex[3][l]%
          savestackthefrac$displaystyle#3$
          ifx l#1rule0pthtthefraccontent^#2)!fi
          #3
          ifx r#1rule0pthtthefraccontent^!(#2fi

          begindocument
          [
          simpex5cdot 4frac117
          textrm versus
          simpex[r]5cdot 4frac117
          ]
          enddocument


          enter image description here



          APPROACH 2



          Being a mathllap, there could be spacing issues with adjacent material. However, without more information on the use cases, it is hard to develop a remedy for that in the blind.



          For example, will it always lead a line? Will it always be part of a fraction? If so, will it always be in the numerator? etc.



          documentclassarticle
          usepackagemathtools
          begindocument
          [
          fracmathllap^5cdot 4)117
          ]
          enddocument


          enter image description here






          share|improve this answer






















          • What if I wanted achieve the same thing, but on the right side of the fraction? So instead of 5 cdot 4) being on the above left, I would have (5 cdot 4 on the above right side of the fraction.
            – TheSodesa
            32 mins ago










          • @TheSodesa See my edit. I introduce an optional argument to handle left or right positioning.
            – Steven B. Segletes
            21 mins ago

















          up vote
          2
          down vote













          Here's a solution that employs just the TeX primitives raise and hbox. The macro mysimp is defined to take three arguments, one of which is optional. The optional argument sets the vertical displacement by which the first mandatory argument must be raised. The default value of the vertical displacement is 3ex, which seems about right if the final argument contains a display-style fractional term.



          enter image description here



          Remove the scriptstyle directive if the left-superscript term should be typeset in text-style and not in scriptstyle.



          documentclassarticle
          newcommandmysimp[3][3ex]raise#1hbox$scriptstyle #2$ ! #3
          begindocument
          [
          mysimp5cdot4)frac117 qquad mysimp[1.25ex]uvabc
          ]
          enddocument





          share|improve this answer


















          • 1




            @PhelypeOleinik - Thanks for the edit!
            – Mico
            21 mins ago

















          up vote
          2
          down vote













          Is it one of these you want? They use stackengine:



          documentclassarticle
          usepackagemathtools
          usepackage[usestackEOL]stackengine
          setstackgapS1pt
          begindocument

          [ A = stackMathShortstackmathllapscriptstyle 5cdot 4)\dfrac117 ]%

          [ A = stackMath
          setstackgapS-1exShortstackmathllapscriptstyle 5cdot 4):\dfrac117 ]%

          enddocument


          enter image description here



          Edit: This code uses only mathtools:



          [ A = prescriptmathllap5cdot 4)mkern-8mufrac117 ]%


          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: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f453627%2fhow-to-typeset-an-invisible-paired-delimiter-preferably-using-mathtools%23new-answer', 'question_page');

            );

            Post as a guest






























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



            APPROACH 1



            In this approach, the superscript will precede the full fraction, rather than just the numerator. It will also take up horizontal space, rather than be a lapped quantity.



            EDITED to allow [l]eft or [r]ight positioning with use of optional argument.



            documentclassarticle
            usepackagestackengine
            newcommandsimpex[3][l]%
            savestackthefrac$displaystyle#3$
            ifx l#1rule0pthtthefraccontent^#2)!fi
            #3
            ifx r#1rule0pthtthefraccontent^!(#2fi

            begindocument
            [
            simpex5cdot 4frac117
            textrm versus
            simpex[r]5cdot 4frac117
            ]
            enddocument


            enter image description here



            APPROACH 2



            Being a mathllap, there could be spacing issues with adjacent material. However, without more information on the use cases, it is hard to develop a remedy for that in the blind.



            For example, will it always lead a line? Will it always be part of a fraction? If so, will it always be in the numerator? etc.



            documentclassarticle
            usepackagemathtools
            begindocument
            [
            fracmathllap^5cdot 4)117
            ]
            enddocument


            enter image description here






            share|improve this answer






















            • What if I wanted achieve the same thing, but on the right side of the fraction? So instead of 5 cdot 4) being on the above left, I would have (5 cdot 4 on the above right side of the fraction.
              – TheSodesa
              32 mins ago










            • @TheSodesa See my edit. I introduce an optional argument to handle left or right positioning.
              – Steven B. Segletes
              21 mins ago














            up vote
            2
            down vote



            accepted










            I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



            APPROACH 1



            In this approach, the superscript will precede the full fraction, rather than just the numerator. It will also take up horizontal space, rather than be a lapped quantity.



            EDITED to allow [l]eft or [r]ight positioning with use of optional argument.



            documentclassarticle
            usepackagestackengine
            newcommandsimpex[3][l]%
            savestackthefrac$displaystyle#3$
            ifx l#1rule0pthtthefraccontent^#2)!fi
            #3
            ifx r#1rule0pthtthefraccontent^!(#2fi

            begindocument
            [
            simpex5cdot 4frac117
            textrm versus
            simpex[r]5cdot 4frac117
            ]
            enddocument


            enter image description here



            APPROACH 2



            Being a mathllap, there could be spacing issues with adjacent material. However, without more information on the use cases, it is hard to develop a remedy for that in the blind.



            For example, will it always lead a line? Will it always be part of a fraction? If so, will it always be in the numerator? etc.



            documentclassarticle
            usepackagemathtools
            begindocument
            [
            fracmathllap^5cdot 4)117
            ]
            enddocument


            enter image description here






            share|improve this answer






















            • What if I wanted achieve the same thing, but on the right side of the fraction? So instead of 5 cdot 4) being on the above left, I would have (5 cdot 4 on the above right side of the fraction.
              – TheSodesa
              32 mins ago










            • @TheSodesa See my edit. I introduce an optional argument to handle left or right positioning.
              – Steven B. Segletes
              21 mins ago












            up vote
            2
            down vote



            accepted







            up vote
            2
            down vote



            accepted






            I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



            APPROACH 1



            In this approach, the superscript will precede the full fraction, rather than just the numerator. It will also take up horizontal space, rather than be a lapped quantity.



            EDITED to allow [l]eft or [r]ight positioning with use of optional argument.



            documentclassarticle
            usepackagestackengine
            newcommandsimpex[3][l]%
            savestackthefrac$displaystyle#3$
            ifx l#1rule0pthtthefraccontent^#2)!fi
            #3
            ifx r#1rule0pthtthefraccontent^!(#2fi

            begindocument
            [
            simpex5cdot 4frac117
            textrm versus
            simpex[r]5cdot 4frac117
            ]
            enddocument


            enter image description here



            APPROACH 2



            Being a mathllap, there could be spacing issues with adjacent material. However, without more information on the use cases, it is hard to develop a remedy for that in the blind.



            For example, will it always lead a line? Will it always be part of a fraction? If so, will it always be in the numerator? etc.



            documentclassarticle
            usepackagemathtools
            begindocument
            [
            fracmathllap^5cdot 4)117
            ]
            enddocument


            enter image description here






            share|improve this answer














            I would like the numerator to be centered and the 5cdot 4) to be to the left and above of the entire fraction without the division line being distorted or stretched in any way by it.



            APPROACH 1



            In this approach, the superscript will precede the full fraction, rather than just the numerator. It will also take up horizontal space, rather than be a lapped quantity.



            EDITED to allow [l]eft or [r]ight positioning with use of optional argument.



            documentclassarticle
            usepackagestackengine
            newcommandsimpex[3][l]%
            savestackthefrac$displaystyle#3$
            ifx l#1rule0pthtthefraccontent^#2)!fi
            #3
            ifx r#1rule0pthtthefraccontent^!(#2fi

            begindocument
            [
            simpex5cdot 4frac117
            textrm versus
            simpex[r]5cdot 4frac117
            ]
            enddocument


            enter image description here



            APPROACH 2



            Being a mathllap, there could be spacing issues with adjacent material. However, without more information on the use cases, it is hard to develop a remedy for that in the blind.



            For example, will it always lead a line? Will it always be part of a fraction? If so, will it always be in the numerator? etc.



            documentclassarticle
            usepackagemathtools
            begindocument
            [
            fracmathllap^5cdot 4)117
            ]
            enddocument


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 22 mins ago

























            answered 1 hour ago









            Steven B. Segletes

            148k9186390




            148k9186390











            • What if I wanted achieve the same thing, but on the right side of the fraction? So instead of 5 cdot 4) being on the above left, I would have (5 cdot 4 on the above right side of the fraction.
              – TheSodesa
              32 mins ago










            • @TheSodesa See my edit. I introduce an optional argument to handle left or right positioning.
              – Steven B. Segletes
              21 mins ago
















            • What if I wanted achieve the same thing, but on the right side of the fraction? So instead of 5 cdot 4) being on the above left, I would have (5 cdot 4 on the above right side of the fraction.
              – TheSodesa
              32 mins ago










            • @TheSodesa See my edit. I introduce an optional argument to handle left or right positioning.
              – Steven B. Segletes
              21 mins ago















            What if I wanted achieve the same thing, but on the right side of the fraction? So instead of 5 cdot 4) being on the above left, I would have (5 cdot 4 on the above right side of the fraction.
            – TheSodesa
            32 mins ago




            What if I wanted achieve the same thing, but on the right side of the fraction? So instead of 5 cdot 4) being on the above left, I would have (5 cdot 4 on the above right side of the fraction.
            – TheSodesa
            32 mins ago












            @TheSodesa See my edit. I introduce an optional argument to handle left or right positioning.
            – Steven B. Segletes
            21 mins ago




            @TheSodesa See my edit. I introduce an optional argument to handle left or right positioning.
            – Steven B. Segletes
            21 mins ago










            up vote
            2
            down vote













            Here's a solution that employs just the TeX primitives raise and hbox. The macro mysimp is defined to take three arguments, one of which is optional. The optional argument sets the vertical displacement by which the first mandatory argument must be raised. The default value of the vertical displacement is 3ex, which seems about right if the final argument contains a display-style fractional term.



            enter image description here



            Remove the scriptstyle directive if the left-superscript term should be typeset in text-style and not in scriptstyle.



            documentclassarticle
            newcommandmysimp[3][3ex]raise#1hbox$scriptstyle #2$ ! #3
            begindocument
            [
            mysimp5cdot4)frac117 qquad mysimp[1.25ex]uvabc
            ]
            enddocument





            share|improve this answer


















            • 1




              @PhelypeOleinik - Thanks for the edit!
              – Mico
              21 mins ago














            up vote
            2
            down vote













            Here's a solution that employs just the TeX primitives raise and hbox. The macro mysimp is defined to take three arguments, one of which is optional. The optional argument sets the vertical displacement by which the first mandatory argument must be raised. The default value of the vertical displacement is 3ex, which seems about right if the final argument contains a display-style fractional term.



            enter image description here



            Remove the scriptstyle directive if the left-superscript term should be typeset in text-style and not in scriptstyle.



            documentclassarticle
            newcommandmysimp[3][3ex]raise#1hbox$scriptstyle #2$ ! #3
            begindocument
            [
            mysimp5cdot4)frac117 qquad mysimp[1.25ex]uvabc
            ]
            enddocument





            share|improve this answer


















            • 1




              @PhelypeOleinik - Thanks for the edit!
              – Mico
              21 mins ago












            up vote
            2
            down vote










            up vote
            2
            down vote









            Here's a solution that employs just the TeX primitives raise and hbox. The macro mysimp is defined to take three arguments, one of which is optional. The optional argument sets the vertical displacement by which the first mandatory argument must be raised. The default value of the vertical displacement is 3ex, which seems about right if the final argument contains a display-style fractional term.



            enter image description here



            Remove the scriptstyle directive if the left-superscript term should be typeset in text-style and not in scriptstyle.



            documentclassarticle
            newcommandmysimp[3][3ex]raise#1hbox$scriptstyle #2$ ! #3
            begindocument
            [
            mysimp5cdot4)frac117 qquad mysimp[1.25ex]uvabc
            ]
            enddocument





            share|improve this answer














            Here's a solution that employs just the TeX primitives raise and hbox. The macro mysimp is defined to take three arguments, one of which is optional. The optional argument sets the vertical displacement by which the first mandatory argument must be raised. The default value of the vertical displacement is 3ex, which seems about right if the final argument contains a display-style fractional term.



            enter image description here



            Remove the scriptstyle directive if the left-superscript term should be typeset in text-style and not in scriptstyle.



            documentclassarticle
            newcommandmysimp[3][3ex]raise#1hbox$scriptstyle #2$ ! #3
            begindocument
            [
            mysimp5cdot4)frac117 qquad mysimp[1.25ex]uvabc
            ]
            enddocument






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 43 mins ago









            Phelype Oleinik

            17.4k43771




            17.4k43771










            answered 48 mins ago









            Mico

            265k30356736




            265k30356736







            • 1




              @PhelypeOleinik - Thanks for the edit!
              – Mico
              21 mins ago












            • 1




              @PhelypeOleinik - Thanks for the edit!
              – Mico
              21 mins ago







            1




            1




            @PhelypeOleinik - Thanks for the edit!
            – Mico
            21 mins ago




            @PhelypeOleinik - Thanks for the edit!
            – Mico
            21 mins ago










            up vote
            2
            down vote













            Is it one of these you want? They use stackengine:



            documentclassarticle
            usepackagemathtools
            usepackage[usestackEOL]stackengine
            setstackgapS1pt
            begindocument

            [ A = stackMathShortstackmathllapscriptstyle 5cdot 4)\dfrac117 ]%

            [ A = stackMath
            setstackgapS-1exShortstackmathllapscriptstyle 5cdot 4):\dfrac117 ]%

            enddocument


            enter image description here



            Edit: This code uses only mathtools:



            [ A = prescriptmathllap5cdot 4)mkern-8mufrac117 ]%


            enter image description here






            share|improve this answer


























              up vote
              2
              down vote













              Is it one of these you want? They use stackengine:



              documentclassarticle
              usepackagemathtools
              usepackage[usestackEOL]stackengine
              setstackgapS1pt
              begindocument

              [ A = stackMathShortstackmathllapscriptstyle 5cdot 4)\dfrac117 ]%

              [ A = stackMath
              setstackgapS-1exShortstackmathllapscriptstyle 5cdot 4):\dfrac117 ]%

              enddocument


              enter image description here



              Edit: This code uses only mathtools:



              [ A = prescriptmathllap5cdot 4)mkern-8mufrac117 ]%


              enter image description here






              share|improve this answer
























                up vote
                2
                down vote










                up vote
                2
                down vote









                Is it one of these you want? They use stackengine:



                documentclassarticle
                usepackagemathtools
                usepackage[usestackEOL]stackengine
                setstackgapS1pt
                begindocument

                [ A = stackMathShortstackmathllapscriptstyle 5cdot 4)\dfrac117 ]%

                [ A = stackMath
                setstackgapS-1exShortstackmathllapscriptstyle 5cdot 4):\dfrac117 ]%

                enddocument


                enter image description here



                Edit: This code uses only mathtools:



                [ A = prescriptmathllap5cdot 4)mkern-8mufrac117 ]%


                enter image description here






                share|improve this answer














                Is it one of these you want? They use stackengine:



                documentclassarticle
                usepackagemathtools
                usepackage[usestackEOL]stackengine
                setstackgapS1pt
                begindocument

                [ A = stackMathShortstackmathllapscriptstyle 5cdot 4)\dfrac117 ]%

                [ A = stackMath
                setstackgapS-1exShortstackmathllapscriptstyle 5cdot 4):\dfrac117 ]%

                enddocument


                enter image description here



                Edit: This code uses only mathtools:



                [ A = prescriptmathllap5cdot 4)mkern-8mufrac117 ]%


                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 29 mins ago

























                answered 42 mins ago









                Bernard

                157k764190




                157k764190



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f453627%2fhow-to-typeset-an-invisible-paired-delimiter-preferably-using-mathtools%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    Confectionery