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











up vote
7
down vote

favorite
1












enter image description here



The above fraction is what I would like to achieve



What I have so far is



$ begin{bmatrix}
0 \
0 \
1 \
1
end{bmatrix} - frac{ begin{bmatrix}
0 & 0 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix}}{begin{bmatrix}
1 & 1 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix} }$


and it looks like this



enter image description here



How can I achieve my desired result?










share|improve this question









New contributor




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
















  • 2




    You also get several errors from that input.
    – egreg
    yesterday










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










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






  • 2




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






  • 1




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















up vote
7
down vote

favorite
1












enter image description here



The above fraction is what I would like to achieve



What I have so far is



$ begin{bmatrix}
0 \
0 \
1 \
1
end{bmatrix} - frac{ begin{bmatrix}
0 & 0 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix}}{begin{bmatrix}
1 & 1 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix} }$


and it looks like this



enter image description here



How can I achieve my desired result?










share|improve this question









New contributor




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
















  • 2




    You also get several errors from that input.
    – egreg
    yesterday










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










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






  • 2




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






  • 1




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













up vote
7
down vote

favorite
1









up vote
7
down vote

favorite
1






1





enter image description here



The above fraction is what I would like to achieve



What I have so far is



$ begin{bmatrix}
0 \
0 \
1 \
1
end{bmatrix} - frac{ begin{bmatrix}
0 & 0 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix}}{begin{bmatrix}
1 & 1 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix} }$


and it looks like this



enter image description here



How can I achieve my desired result?










share|improve this question









New contributor




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











enter image description here



The above fraction is what I would like to achieve



What I have so far is



$ begin{bmatrix}
0 \
0 \
1 \
1
end{bmatrix} - frac{ begin{bmatrix}
0 & 0 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix}}{begin{bmatrix}
1 & 1 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix} }$


and it looks like this



enter image description here



How can I achieve my desired result?







fractions






share|improve this question









New contributor




user130306 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 question









New contributor




user130306 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 question




share|improve this question








edited yesterday





















New contributor




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









asked yesterday









user130306

1362




1362




New contributor




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





New contributor





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






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








  • 2




    You also get several errors from that input.
    – egreg
    yesterday










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










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






  • 2




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






  • 1




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














  • 2




    You also get several errors from that input.
    – egreg
    yesterday










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










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






  • 2




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






  • 1




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








2




2




You also get several errors from that input.
– egreg
yesterday




You also get several errors from that input.
– egreg
yesterday












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




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












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




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




2




2




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




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




1




1




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




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










2 Answers
2






active

oldest

votes

















up vote
9
down vote













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



documentclass{article}
usepackage{mathtools}
begin{document}
[
begin{bmatrix}
0 \ 0 \ 1 \ 1
end{bmatrix}
- frac{
begin{bsmallmatrix}
0 & 0 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix}}{%
begin{bsmallmatrix}
1 & 1 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix} }
begin{bmatrix}
1 \ 1 \ 1 \ 1
end{bmatrix}
]
end{document}





share|improve this answer




























    up vote
    9
    down vote













    documentclass{article}
    usepackage{tabstackengine}
    stackMath
    newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
    begin{document}
    [
    setstacktabbedgap{1ex}
    bracketVectorstack{0\0\1\1} -
    Frac{
    bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
    }{
    bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
    }
    bracketVectorstack{1\1\1\1}
    ]
    end{document}


    enter image description here



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



    documentclass{article}
    usepackage{tabstackengine}
    stackMath
    newcommandFrac[2]{{%
    setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
    frac{addstackgap{#1}}{addstackgap{#2}}%
    }}
    begin{document}
    [
    setstacktabbedgap{1ex}
    bracketVectorstack{0\0\1\1} -
    Frac{
    bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
    }{
    bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
    }
    bracketVectorstack{1\1\1\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
      });


      }
      });






      user130306 is a new contributor. Be nice, and check out our Code of Conduct.










       

      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








      up vote
      9
      down vote













      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



      documentclass{article}
      usepackage{mathtools}
      begin{document}
      [
      begin{bmatrix}
      0 \ 0 \ 1 \ 1
      end{bmatrix}
      - frac{
      begin{bsmallmatrix}
      0 & 0 & 1 & 1
      end{bsmallmatrix}
      begin{bsmallmatrix}
      1 \ 1 \ 1 \ 1
      end{bsmallmatrix}}{%
      begin{bsmallmatrix}
      1 & 1 & 1 & 1
      end{bsmallmatrix}
      begin{bsmallmatrix}
      1 \ 1 \ 1 \ 1
      end{bsmallmatrix} }
      begin{bmatrix}
      1 \ 1 \ 1 \ 1
      end{bmatrix}
      ]
      end{document}





      share|improve this answer

























        up vote
        9
        down vote













        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



        documentclass{article}
        usepackage{mathtools}
        begin{document}
        [
        begin{bmatrix}
        0 \ 0 \ 1 \ 1
        end{bmatrix}
        - frac{
        begin{bsmallmatrix}
        0 & 0 & 1 & 1
        end{bsmallmatrix}
        begin{bsmallmatrix}
        1 \ 1 \ 1 \ 1
        end{bsmallmatrix}}{%
        begin{bsmallmatrix}
        1 & 1 & 1 & 1
        end{bsmallmatrix}
        begin{bsmallmatrix}
        1 \ 1 \ 1 \ 1
        end{bsmallmatrix} }
        begin{bmatrix}
        1 \ 1 \ 1 \ 1
        end{bmatrix}
        ]
        end{document}





        share|improve this answer























          up vote
          9
          down vote










          up vote
          9
          down vote









          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



          documentclass{article}
          usepackage{mathtools}
          begin{document}
          [
          begin{bmatrix}
          0 \ 0 \ 1 \ 1
          end{bmatrix}
          - frac{
          begin{bsmallmatrix}
          0 & 0 & 1 & 1
          end{bsmallmatrix}
          begin{bsmallmatrix}
          1 \ 1 \ 1 \ 1
          end{bsmallmatrix}}{%
          begin{bsmallmatrix}
          1 & 1 & 1 & 1
          end{bsmallmatrix}
          begin{bsmallmatrix}
          1 \ 1 \ 1 \ 1
          end{bsmallmatrix} }
          begin{bmatrix}
          1 \ 1 \ 1 \ 1
          end{bmatrix}
          ]
          end{document}





          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



          documentclass{article}
          usepackage{mathtools}
          begin{document}
          [
          begin{bmatrix}
          0 \ 0 \ 1 \ 1
          end{bmatrix}
          - frac{
          begin{bsmallmatrix}
          0 & 0 & 1 & 1
          end{bsmallmatrix}
          begin{bsmallmatrix}
          1 \ 1 \ 1 \ 1
          end{bsmallmatrix}}{%
          begin{bsmallmatrix}
          1 & 1 & 1 & 1
          end{bsmallmatrix}
          begin{bsmallmatrix}
          1 \ 1 \ 1 \ 1
          end{bsmallmatrix} }
          begin{bmatrix}
          1 \ 1 \ 1 \ 1
          end{bmatrix}
          ]
          end{document}






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          Mico

          269k30364748




          269k30364748






















              up vote
              9
              down vote













              documentclass{article}
              usepackage{tabstackengine}
              stackMath
              newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
              begin{document}
              [
              setstacktabbedgap{1ex}
              bracketVectorstack{0\0\1\1} -
              Frac{
              bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
              }{
              bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
              }
              bracketVectorstack{1\1\1\1}
              ]
              end{document}


              enter image description here



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



              documentclass{article}
              usepackage{tabstackengine}
              stackMath
              newcommandFrac[2]{{%
              setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
              frac{addstackgap{#1}}{addstackgap{#2}}%
              }}
              begin{document}
              [
              setstacktabbedgap{1ex}
              bracketVectorstack{0\0\1\1} -
              Frac{
              bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
              }{
              bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
              }
              bracketVectorstack{1\1\1\1}
              ]
              end{document}


              enter image description here






              share|improve this answer



























                up vote
                9
                down vote













                documentclass{article}
                usepackage{tabstackengine}
                stackMath
                newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
                begin{document}
                [
                setstacktabbedgap{1ex}
                bracketVectorstack{0\0\1\1} -
                Frac{
                bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
                }{
                bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
                }
                bracketVectorstack{1\1\1\1}
                ]
                end{document}


                enter image description here



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



                documentclass{article}
                usepackage{tabstackengine}
                stackMath
                newcommandFrac[2]{{%
                setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
                frac{addstackgap{#1}}{addstackgap{#2}}%
                }}
                begin{document}
                [
                setstacktabbedgap{1ex}
                bracketVectorstack{0\0\1\1} -
                Frac{
                bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
                }{
                bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
                }
                bracketVectorstack{1\1\1\1}
                ]
                end{document}


                enter image description here






                share|improve this answer

























                  up vote
                  9
                  down vote










                  up vote
                  9
                  down vote









                  documentclass{article}
                  usepackage{tabstackengine}
                  stackMath
                  newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
                  begin{document}
                  [
                  setstacktabbedgap{1ex}
                  bracketVectorstack{0\0\1\1} -
                  Frac{
                  bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
                  }{
                  bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
                  }
                  bracketVectorstack{1\1\1\1}
                  ]
                  end{document}


                  enter image description here



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



                  documentclass{article}
                  usepackage{tabstackengine}
                  stackMath
                  newcommandFrac[2]{{%
                  setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
                  frac{addstackgap{#1}}{addstackgap{#2}}%
                  }}
                  begin{document}
                  [
                  setstacktabbedgap{1ex}
                  bracketVectorstack{0\0\1\1} -
                  Frac{
                  bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
                  }{
                  bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
                  }
                  bracketVectorstack{1\1\1\1}
                  ]
                  end{document}


                  enter image description here






                  share|improve this answer














                  documentclass{article}
                  usepackage{tabstackengine}
                  stackMath
                  newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
                  begin{document}
                  [
                  setstacktabbedgap{1ex}
                  bracketVectorstack{0\0\1\1} -
                  Frac{
                  bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
                  }{
                  bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
                  }
                  bracketVectorstack{1\1\1\1}
                  ]
                  end{document}


                  enter image description here



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



                  documentclass{article}
                  usepackage{tabstackengine}
                  stackMath
                  newcommandFrac[2]{{%
                  setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
                  frac{addstackgap{#1}}{addstackgap{#2}}%
                  }}
                  begin{document}
                  [
                  setstacktabbedgap{1ex}
                  bracketVectorstack{0\0\1\1} -
                  Frac{
                  bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
                  }{
                  bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
                  }
                  bracketVectorstack{1\1\1\1}
                  ]
                  end{document}


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited yesterday

























                  answered yesterday









                  Steven B. Segletes

                  151k9189397




                  151k9189397






















                      user130306 is a new contributor. Be nice, and check out our Code of Conduct.










                       

                      draft saved


                      draft discarded


















                      user130306 is a new contributor. Be nice, and check out our Code of Conduct.













                      user130306 is a new contributor. Be nice, and check out our Code of Conduct.












                      user130306 is a new contributor. Be nice, and check out our Code of Conduct.















                       


                      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







                      Popular posts from this blog

                      AnyDesk - Fatal Program Failure

                      QoS: MAC-Priority for clients behind a repeater

                      Актюбинская область