How can I get a fraction with a matrix in the numerator and denominator?










7















enter image description here



The above fraction is what I would like to achieve



What I have so far is



$ beginbmatrix
0 \
0 \
1 \
1
endbmatrix - frac beginbmatrix
0 & 0 & 1 & 1
endbmatrix beginbmatrix
1 \
1 \
1 \
1
endbmatrixbeginbmatrix
1 & 1 & 1 & 1
endbmatrix beginbmatrix
1 \
1 \
1 \
1
endbmatrix $


and it looks like this



enter image description here



How can I achieve my desired result?










share|improve this question



















  • 2





    You also get several errors from that input.

    – egreg
    Nov 14 '18 at 17:09











  • what are the errors? my code compiles so I didn't notice any errors

    – user130306
    Nov 14 '18 at 17:16











  • The second $ causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (after endbmatrix }). You may want to instead use [...] or beginequation...endequationinstead of $...$ since this looks like a display equation rather than an inline equation.

    – Circumscribe
    Nov 14 '18 at 17:20






  • 2





    The fixed code compiles normally and has the expected result for me.

    – Bernard
    Nov 14 '18 at 17:25






  • 1





    yes I know, I corrected the misplaced $ and got my desired outcome so my question no longer needs an answer

    – user130306
    Nov 14 '18 at 18:27















7















enter image description here



The above fraction is what I would like to achieve



What I have so far is



$ beginbmatrix
0 \
0 \
1 \
1
endbmatrix - frac beginbmatrix
0 & 0 & 1 & 1
endbmatrix beginbmatrix
1 \
1 \
1 \
1
endbmatrixbeginbmatrix
1 & 1 & 1 & 1
endbmatrix beginbmatrix
1 \
1 \
1 \
1
endbmatrix $


and it looks like this



enter image description here



How can I achieve my desired result?










share|improve this question



















  • 2





    You also get several errors from that input.

    – egreg
    Nov 14 '18 at 17:09











  • what are the errors? my code compiles so I didn't notice any errors

    – user130306
    Nov 14 '18 at 17:16











  • The second $ causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (after endbmatrix }). You may want to instead use [...] or beginequation...endequationinstead of $...$ since this looks like a display equation rather than an inline equation.

    – Circumscribe
    Nov 14 '18 at 17:20






  • 2





    The fixed code compiles normally and has the expected result for me.

    – Bernard
    Nov 14 '18 at 17:25






  • 1





    yes I know, I corrected the misplaced $ and got my desired outcome so my question no longer needs an answer

    – user130306
    Nov 14 '18 at 18:27













7












7








7


1






enter image description here



The above fraction is what I would like to achieve



What I have so far is



$ beginbmatrix
0 \
0 \
1 \
1
endbmatrix - frac beginbmatrix
0 & 0 & 1 & 1
endbmatrix beginbmatrix
1 \
1 \
1 \
1
endbmatrixbeginbmatrix
1 & 1 & 1 & 1
endbmatrix beginbmatrix
1 \
1 \
1 \
1
endbmatrix $


and it looks like this



enter image description here



How can I achieve my desired result?










share|improve this question
















enter image description here



The above fraction is what I would like to achieve



What I have so far is



$ beginbmatrix
0 \
0 \
1 \
1
endbmatrix - frac beginbmatrix
0 & 0 & 1 & 1
endbmatrix beginbmatrix
1 \
1 \
1 \
1
endbmatrixbeginbmatrix
1 & 1 & 1 & 1
endbmatrix beginbmatrix
1 \
1 \
1 \
1
endbmatrix $


and it looks like this



enter image description here



How can I achieve my desired result?







fractions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 17:23







user130306

















asked Nov 14 '18 at 17:03









user130306user130306

1362




1362







  • 2





    You also get several errors from that input.

    – egreg
    Nov 14 '18 at 17:09











  • what are the errors? my code compiles so I didn't notice any errors

    – user130306
    Nov 14 '18 at 17:16











  • The second $ causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (after endbmatrix }). You may want to instead use [...] or beginequation...endequationinstead of $...$ since this looks like a display equation rather than an inline equation.

    – Circumscribe
    Nov 14 '18 at 17:20






  • 2





    The fixed code compiles normally and has the expected result for me.

    – Bernard
    Nov 14 '18 at 17:25






  • 1





    yes I know, I corrected the misplaced $ and got my desired outcome so my question no longer needs an answer

    – user130306
    Nov 14 '18 at 18:27












  • 2





    You also get several errors from that input.

    – egreg
    Nov 14 '18 at 17:09











  • what are the errors? my code compiles so I didn't notice any errors

    – user130306
    Nov 14 '18 at 17:16











  • The second $ causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (after endbmatrix }). You may want to instead use [...] or beginequation...endequationinstead of $...$ since this looks like a display equation rather than an inline equation.

    – Circumscribe
    Nov 14 '18 at 17:20






  • 2





    The fixed code compiles normally and has the expected result for me.

    – Bernard
    Nov 14 '18 at 17:25






  • 1





    yes I know, I corrected the misplaced $ and got my desired outcome so my question no longer needs an answer

    – user130306
    Nov 14 '18 at 18:27







2




2





You also get several errors from that input.

– egreg
Nov 14 '18 at 17:09





You also get several errors from that input.

– egreg
Nov 14 '18 at 17:09













what are the errors? my code compiles so I didn't notice any errors

– user130306
Nov 14 '18 at 17:16





what are the errors? my code compiles so I didn't notice any errors

– user130306
Nov 14 '18 at 17:16













The second $ causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (after endbmatrix }). You may want to instead use [...] or beginequation...endequationinstead of $...$ since this looks like a display equation rather than an inline equation.

– Circumscribe
Nov 14 '18 at 17:20





The second $ causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (after endbmatrix }). You may want to instead use [...] or beginequation...endequationinstead of $...$ since this looks like a display equation rather than an inline equation.

– Circumscribe
Nov 14 '18 at 17:20




2




2





The fixed code compiles normally and has the expected result for me.

– Bernard
Nov 14 '18 at 17:25





The fixed code compiles normally and has the expected result for me.

– Bernard
Nov 14 '18 at 17:25




1




1





yes I know, I corrected the misplaced $ and got my desired outcome so my question no longer needs an answer

– user130306
Nov 14 '18 at 18:27





yes I know, I corrected the misplaced $ and got my desired outcome so my question no longer needs an answer

– user130306
Nov 14 '18 at 18:27










2 Answers
2






active

oldest

votes


















10














You could use the bsmallmatrix environment, provided by the mathtools package, to render the row and column vectors in the frac expression more compactly.



enter image description here



documentclassarticle
usepackagemathtools
begindocument
[
beginbmatrix
0 \ 0 \ 1 \ 1
endbmatrix
- frac
beginbsmallmatrix
0 & 0 & 1 & 1
endbsmallmatrix
beginbsmallmatrix
1 \ 1 \ 1 \ 1
endbsmallmatrix%
beginbsmallmatrix
1 & 1 & 1 & 1
endbsmallmatrix
beginbsmallmatrix
1 \ 1 \ 1 \ 1
endbsmallmatrix
beginbmatrix
1 \ 1 \ 1 \ 1
endbmatrix
]
enddocument





share|improve this answer






























    9














    documentclassarticle
    usepackagetabstackengine
    stackMath
    newcommandFrac[2]fracaddstackgap#1addstackgap#2
    begindocument
    [
    setstacktabbedgap1ex
    bracketVectorstack0\0\1\1 -
    Frac
    bracketMatrixstack0&0&1&1bracketVectorstack1\1\1\1

    bracketMatrixstack1&1&1&1bracketVectorstack1\1\1\1

    bracketVectorstack1\1\1\1
    ]
    enddocument


    enter image description here



    The smaller size of Frac is also possible, with a small redefinition:



    documentclassarticle
    usepackagetabstackengine
    stackMath
    newcommandFrac[2]%
    setstackgapL.7normalbaselineskipTABstackMathstylescriptstyle%
    fracaddstackgap#1addstackgap#2%

    begindocument
    [
    setstacktabbedgap1ex
    bracketVectorstack0\0\1\1 -
    Frac
    bracketMatrixstack0&0&1&1bracketMatrixstack1\1\1\1

    bracketMatrixstack1&1&1&1bracketMatrixstack1\1\1\1

    bracketVectorstack1\1\1\1
    ]
    enddocument


    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',
      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%2f459980%2fhow-can-i-get-a-fraction-with-a-matrix-in-the-numerator-and-denominator%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









      10














      You could use the bsmallmatrix environment, provided by the mathtools package, to render the row and column vectors in the frac expression more compactly.



      enter image description here



      documentclassarticle
      usepackagemathtools
      begindocument
      [
      beginbmatrix
      0 \ 0 \ 1 \ 1
      endbmatrix
      - frac
      beginbsmallmatrix
      0 & 0 & 1 & 1
      endbsmallmatrix
      beginbsmallmatrix
      1 \ 1 \ 1 \ 1
      endbsmallmatrix%
      beginbsmallmatrix
      1 & 1 & 1 & 1
      endbsmallmatrix
      beginbsmallmatrix
      1 \ 1 \ 1 \ 1
      endbsmallmatrix
      beginbmatrix
      1 \ 1 \ 1 \ 1
      endbmatrix
      ]
      enddocument





      share|improve this answer



























        10














        You could use the bsmallmatrix environment, provided by the mathtools package, to render the row and column vectors in the frac expression more compactly.



        enter image description here



        documentclassarticle
        usepackagemathtools
        begindocument
        [
        beginbmatrix
        0 \ 0 \ 1 \ 1
        endbmatrix
        - frac
        beginbsmallmatrix
        0 & 0 & 1 & 1
        endbsmallmatrix
        beginbsmallmatrix
        1 \ 1 \ 1 \ 1
        endbsmallmatrix%
        beginbsmallmatrix
        1 & 1 & 1 & 1
        endbsmallmatrix
        beginbsmallmatrix
        1 \ 1 \ 1 \ 1
        endbsmallmatrix
        beginbmatrix
        1 \ 1 \ 1 \ 1
        endbmatrix
        ]
        enddocument





        share|improve this answer

























          10












          10








          10







          You could use the bsmallmatrix environment, provided by the mathtools package, to render the row and column vectors in the frac expression more compactly.



          enter image description here



          documentclassarticle
          usepackagemathtools
          begindocument
          [
          beginbmatrix
          0 \ 0 \ 1 \ 1
          endbmatrix
          - frac
          beginbsmallmatrix
          0 & 0 & 1 & 1
          endbsmallmatrix
          beginbsmallmatrix
          1 \ 1 \ 1 \ 1
          endbsmallmatrix%
          beginbsmallmatrix
          1 & 1 & 1 & 1
          endbsmallmatrix
          beginbsmallmatrix
          1 \ 1 \ 1 \ 1
          endbsmallmatrix
          beginbmatrix
          1 \ 1 \ 1 \ 1
          endbmatrix
          ]
          enddocument





          share|improve this answer













          You could use the bsmallmatrix environment, provided by the mathtools package, to render the row and column vectors in the frac expression more compactly.



          enter image description here



          documentclassarticle
          usepackagemathtools
          begindocument
          [
          beginbmatrix
          0 \ 0 \ 1 \ 1
          endbmatrix
          - frac
          beginbsmallmatrix
          0 & 0 & 1 & 1
          endbsmallmatrix
          beginbsmallmatrix
          1 \ 1 \ 1 \ 1
          endbsmallmatrix%
          beginbsmallmatrix
          1 & 1 & 1 & 1
          endbsmallmatrix
          beginbsmallmatrix
          1 \ 1 \ 1 \ 1
          endbsmallmatrix
          beginbmatrix
          1 \ 1 \ 1 \ 1
          endbmatrix
          ]
          enddocument






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 19:55









          MicoMico

          280k31383772




          280k31383772





















              9














              documentclassarticle
              usepackagetabstackengine
              stackMath
              newcommandFrac[2]fracaddstackgap#1addstackgap#2
              begindocument
              [
              setstacktabbedgap1ex
              bracketVectorstack0\0\1\1 -
              Frac
              bracketMatrixstack0&0&1&1bracketVectorstack1\1\1\1

              bracketMatrixstack1&1&1&1bracketVectorstack1\1\1\1

              bracketVectorstack1\1\1\1
              ]
              enddocument


              enter image description here



              The smaller size of Frac is also possible, with a small redefinition:



              documentclassarticle
              usepackagetabstackengine
              stackMath
              newcommandFrac[2]%
              setstackgapL.7normalbaselineskipTABstackMathstylescriptstyle%
              fracaddstackgap#1addstackgap#2%

              begindocument
              [
              setstacktabbedgap1ex
              bracketVectorstack0\0\1\1 -
              Frac
              bracketMatrixstack0&0&1&1bracketMatrixstack1\1\1\1

              bracketMatrixstack1&1&1&1bracketMatrixstack1\1\1\1

              bracketVectorstack1\1\1\1
              ]
              enddocument


              enter image description here






              share|improve this answer





























                9














                documentclassarticle
                usepackagetabstackengine
                stackMath
                newcommandFrac[2]fracaddstackgap#1addstackgap#2
                begindocument
                [
                setstacktabbedgap1ex
                bracketVectorstack0\0\1\1 -
                Frac
                bracketMatrixstack0&0&1&1bracketVectorstack1\1\1\1

                bracketMatrixstack1&1&1&1bracketVectorstack1\1\1\1

                bracketVectorstack1\1\1\1
                ]
                enddocument


                enter image description here



                The smaller size of Frac is also possible, with a small redefinition:



                documentclassarticle
                usepackagetabstackengine
                stackMath
                newcommandFrac[2]%
                setstackgapL.7normalbaselineskipTABstackMathstylescriptstyle%
                fracaddstackgap#1addstackgap#2%

                begindocument
                [
                setstacktabbedgap1ex
                bracketVectorstack0\0\1\1 -
                Frac
                bracketMatrixstack0&0&1&1bracketMatrixstack1\1\1\1

                bracketMatrixstack1&1&1&1bracketMatrixstack1\1\1\1

                bracketVectorstack1\1\1\1
                ]
                enddocument


                enter image description here






                share|improve this answer



























                  9












                  9








                  9







                  documentclassarticle
                  usepackagetabstackengine
                  stackMath
                  newcommandFrac[2]fracaddstackgap#1addstackgap#2
                  begindocument
                  [
                  setstacktabbedgap1ex
                  bracketVectorstack0\0\1\1 -
                  Frac
                  bracketMatrixstack0&0&1&1bracketVectorstack1\1\1\1

                  bracketMatrixstack1&1&1&1bracketVectorstack1\1\1\1

                  bracketVectorstack1\1\1\1
                  ]
                  enddocument


                  enter image description here



                  The smaller size of Frac is also possible, with a small redefinition:



                  documentclassarticle
                  usepackagetabstackengine
                  stackMath
                  newcommandFrac[2]%
                  setstackgapL.7normalbaselineskipTABstackMathstylescriptstyle%
                  fracaddstackgap#1addstackgap#2%

                  begindocument
                  [
                  setstacktabbedgap1ex
                  bracketVectorstack0\0\1\1 -
                  Frac
                  bracketMatrixstack0&0&1&1bracketMatrixstack1\1\1\1

                  bracketMatrixstack1&1&1&1bracketMatrixstack1\1\1\1

                  bracketVectorstack1\1\1\1
                  ]
                  enddocument


                  enter image description here






                  share|improve this answer















                  documentclassarticle
                  usepackagetabstackengine
                  stackMath
                  newcommandFrac[2]fracaddstackgap#1addstackgap#2
                  begindocument
                  [
                  setstacktabbedgap1ex
                  bracketVectorstack0\0\1\1 -
                  Frac
                  bracketMatrixstack0&0&1&1bracketVectorstack1\1\1\1

                  bracketMatrixstack1&1&1&1bracketVectorstack1\1\1\1

                  bracketVectorstack1\1\1\1
                  ]
                  enddocument


                  enter image description here



                  The smaller size of Frac is also possible, with a small redefinition:



                  documentclassarticle
                  usepackagetabstackengine
                  stackMath
                  newcommandFrac[2]%
                  setstackgapL.7normalbaselineskipTABstackMathstylescriptstyle%
                  fracaddstackgap#1addstackgap#2%

                  begindocument
                  [
                  setstacktabbedgap1ex
                  bracketVectorstack0\0\1\1 -
                  Frac
                  bracketMatrixstack0&0&1&1bracketMatrixstack1\1\1\1

                  bracketMatrixstack1&1&1&1bracketMatrixstack1\1\1\1

                  bracketVectorstack1\1\1\1
                  ]
                  enddocument


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 14 '18 at 20:13

























                  answered Nov 14 '18 at 17:42









                  Steven B. SegletesSteven B. Segletes

                  157k9202411




                  157k9202411



























                      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%2f459980%2fhow-can-i-get-a-fraction-with-a-matrix-in-the-numerator-and-denominator%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







                      這個網誌中的熱門文章

                      How to read a connectionString WITH PROVIDER in .NET Core?

                      Node.js Script on GitHub Pages or Amazon S3

                      Museum of Modern and Contemporary Art of Trento and Rovereto