How to write the block matrix in LaTex? [duplicate]Highlight elements in the matrixAligning equations with text with alignatMatrix environments not workingnewcommand for bmatrix of features using pgffor throws missing endgroup errorLeft align text in equation environment (no use of align environment)How to align cases block to the leftObtaining a properly aligned complex matrixXparse k argument to parse options at end of environmentHow to represent the following border matrix in latex?How to write the following mathematical expression in LaTeX?“Missing '' inserted” and “Missing inserted” with aligned environment

What is required to make GPS signals available indoors?

Using "tail" to follow a file without displaying the most recent lines

How could indestructible materials be used in power generation?

Detention in 1997

Fair gambler's ruin problem intuition

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?

How do I gain back my faith in my PhD degree?

Is it possible for a PC to dismember a humanoid?

Array of objects return object when condition matched

How to properly check if the given string is empty in a POSIX shell script?

Is Mindfulness the Opposite of Multitasking?

files created then deleted at every second in tmp directory

Why would the Red Woman birth a shadow if she worshipped the Lord of the Light?

Car headlights in a world without electricity

Does the Cone of Cold spell freeze water?

Venezuelan girlfriend wants to travel the USA to be with me. What is the process?

Personal Teleportation: From Rags to Riches

How much mains leakage does an Ethernet connection to a PC induce, and what is the operating leakage path?

What exactly is ineptocracy?

Was the Stack Exchange "Happy April Fools" page fitting with the '90's code?

In 'Revenger,' what does 'cove' come from?

Are British MPs missing the point, with these 'Indicative Votes'?

Can I set a Ready action to trigger when literally anything happens?

ssTTsSTtRrriinInnnnNNNIiinngg



How to write the block matrix in LaTex? [duplicate]


Highlight elements in the matrixAligning equations with text with alignatMatrix environments not workingnewcommand for bmatrix of features using pgffor throws missing endgroup errorLeft align text in equation environment (no use of align environment)How to align cases block to the leftObtaining a properly aligned complex matrixXparse k argument to parse options at end of environmentHow to represent the following border matrix in latex?How to write the following mathematical expression in LaTeX?“Missing '' inserted” and “Missing inserted” with aligned environment













10
















This question already has an answer here:



  • Highlight elements in the matrix

    11 answers



I wish to write the following block matrix in LaTex.



enter image description here



I have been trying a bunch of stuff, but none of it seems to work. In particular, I tried the following:



beginbmatrix
0 & -1& & & & & 0 & & & &\
1 & 0 & & & & & & & & &\
& & cdot & & & & & & & &\
& & & cdot & & & & & & &\
& & & & cdot & & & & & &\
& & & & & 0 & 1 & & & &\
& & & & &-1 & 0 & & & &\
& & & & & & & cdot & & &\
& & & & & & & & cdot & & \
& & & & & & & & & cdot & \
0 & & & & & & & & & & 0\
endbmatrix



But this is pretty ugly and so any suggestions will be much appreciated.










share|improve this question















marked as duplicate by Werner, Raaja, Kurt, Sebastiano, siracusa yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






















    10
















    This question already has an answer here:



    • Highlight elements in the matrix

      11 answers



    I wish to write the following block matrix in LaTex.



    enter image description here



    I have been trying a bunch of stuff, but none of it seems to work. In particular, I tried the following:



    beginbmatrix
    0 & -1& & & & & 0 & & & &\
    1 & 0 & & & & & & & & &\
    & & cdot & & & & & & & &\
    & & & cdot & & & & & & &\
    & & & & cdot & & & & & &\
    & & & & & 0 & 1 & & & &\
    & & & & &-1 & 0 & & & &\
    & & & & & & & cdot & & &\
    & & & & & & & & cdot & & \
    & & & & & & & & & cdot & \
    0 & & & & & & & & & & 0\
    endbmatrix



    But this is pretty ugly and so any suggestions will be much appreciated.










    share|improve this question















    marked as duplicate by Werner, Raaja, Kurt, Sebastiano, siracusa yesterday


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















      10












      10








      10


      2







      This question already has an answer here:



      • Highlight elements in the matrix

        11 answers



      I wish to write the following block matrix in LaTex.



      enter image description here



      I have been trying a bunch of stuff, but none of it seems to work. In particular, I tried the following:



      beginbmatrix
      0 & -1& & & & & 0 & & & &\
      1 & 0 & & & & & & & & &\
      & & cdot & & & & & & & &\
      & & & cdot & & & & & & &\
      & & & & cdot & & & & & &\
      & & & & & 0 & 1 & & & &\
      & & & & &-1 & 0 & & & &\
      & & & & & & & cdot & & &\
      & & & & & & & & cdot & & \
      & & & & & & & & & cdot & \
      0 & & & & & & & & & & 0\
      endbmatrix



      But this is pretty ugly and so any suggestions will be much appreciated.










      share|improve this question

















      This question already has an answer here:



      • Highlight elements in the matrix

        11 answers



      I wish to write the following block matrix in LaTex.



      enter image description here



      I have been trying a bunch of stuff, but none of it seems to work. In particular, I tried the following:



      beginbmatrix
      0 & -1& & & & & 0 & & & &\
      1 & 0 & & & & & & & & &\
      & & cdot & & & & & & & &\
      & & & cdot & & & & & & &\
      & & & & cdot & & & & & &\
      & & & & & 0 & 1 & & & &\
      & & & & &-1 & 0 & & & &\
      & & & & & & & cdot & & &\
      & & & & & & & & cdot & & \
      & & & & & & & & & cdot & \
      0 & & & & & & & & & & 0\
      endbmatrix



      But this is pretty ugly and so any suggestions will be much appreciated.





      This question already has an answer here:



      • Highlight elements in the matrix

        11 answers







      amsmath






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 20:33







      model_checker

















      asked Mar 28 at 20:19









      model_checkermodel_checker

      2551310




      2551310




      marked as duplicate by Werner, Raaja, Kurt, Sebastiano, siracusa yesterday


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Werner, Raaja, Kurt, Sebastiano, siracusa yesterday


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






















          5 Answers
          5






          active

          oldest

          votes


















          9














          Perhaps



          $left(beginarraycccccc
          left[beginarraycc
          0 & 1\
          -1 & 0
          endarrayright] & & & & & 0\
          & ddots\
          & & left[beginarraycc
          0 & 1\
          -1 & 0
          endarrayright]\
          & & & 0\
          & & & & ddots\
          0 & & & & & 0
          endarrayright)$


          enter image description here






          share|improve this answer


















          • 2





            Thank you so much!

            – model_checker
            Mar 28 at 20:45


















          7














          Just for the fun of it! :-)



          documentclassarticle
          usepackageamsmath,array

          begindocument

          [
          beginpmatrix
          newcommandlr[1]multicolumn1c#1
          newcommandrr[1]multicolumn1#1
          ;
          beginarray@*10c@
          cline1-2
          lr0 & rr1 &&&&&&&& raisebox-1em[0pt][0pt]$0$\
          lr-1 & rr0 \
          cline1-2
          && ddots \
          cline4-5
          &&& lr0 & rr1 \
          &&& lr-1 & rr0 \
          cline4-5
          &&&&& 0 \[-1ex]
          &&&&&& ddots \
          &&&&&&& 0 \[-1ex]
          &&&&&&&& ddots \
          multicolumn2c0 &&&&&&&& 0
          endarray
          ;;
          endpmatrix
          ]

          enddocument


          enter image description here






          share|improve this answer


















          • 2





            You guys are the best!

            – model_checker
            Mar 28 at 22:40






          • 1





            @model_checker I'm certainly not the best. Here is world excellence.

            – Sebastiano
            Mar 28 at 22:50






          • 2





            I am sorry! Last I checked there was an objection to your answer. But it's also great!

            – model_checker
            Mar 28 at 22:53






          • 2





            @model_checker Don't worry. I have put two & in addition. :-) but now it is correct.

            – Sebastiano
            Mar 28 at 23:02


















          6














          Here there is my proposal as the original picture using bmatx command that replace a boxed matrix.



          enter image description here



          documentclassarticle
          usepackagemathtools
          newcommandbmatxboxedbeginmatrix 0& 1 \ -1& 0endmatrix

          begindocument
          [
          beginpmatrix
          , bmatx& & & & & & & 0 \
          & ddots& & & & \
          & & bmatx & & & & \
          & & & ddots& & &\
          & & & & 0 & &\
          & & & & & & ddots\
          0 & & & & & & & 0
          endpmatrix
          ]

          enddocument


          The best code is provided thanks to the precious comment of @Bernard.






          share|improve this answer




















          • 4





            In my opinion, you shouldn't add an empty 3rd column in the definition of bmatx

            – Bernard
            Mar 28 at 21:24






          • 2





            Your comment not is an opinion :-) ...it is truly correct. :-)

            – Sebastiano
            Mar 28 at 21:30


















          5














          Here's another solution. It uses a pmatrix environment for the overall matrix and a custom macro called blockmat for the 2x2 inner matrices.



          enter image description here



          documentclassarticle
          usepackagearray,amsmath
          newcommandblockmat%
          beginarray
          hline 0 & 1^mathstrut \ -1 & 0 \ hline
          endarray
          begindocument
          [
          beginpmatrix
          blockmat & & & & & 0 \
          & ddots & & & & \
          & & blockmat & & & \
          & & & 0 & & \
          & & & & ddots & \
          0 & & & & & 0 \
          endpmatrix
          ]
          enddocument





          share|improve this answer




















          • 1





            Thank you for writing this answer!

            – model_checker
            Mar 28 at 22:03


















          1














          Here's a solution using TikZ that will work in all kinds of context, not just matrices, to draw boxes. You just need to put tl in the point where the top-right corner is supposed to be and br where the bottom-right will be. You can also use any TikZ feature to modify your box. Obviously this needs to be fine tuned depending on what exactly you're using it for (spacing etc.).



          newcountertextbox
          deftlstepcountertextboxtikzmarknodeathetextboxstrut
          defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture


          The spacing in this version is not optimized for matrices, but you can use



          tikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw ($(athetextbox.north west)+(-0.4arraycolsep,0ex)$) rectangle ($(bthetextbox.south east)+(0.4arraycolsep,0ex)$);endtikzpicture


          to add extra space.



          enter image description here



          Full code:



          documentclassarticle
          usepackagetikz
          usepackageamsmath
          usetikzlibrarytikzmark,calc
          newcountertextbox
          deftlstepcountertextboxtikzmarknodeathetextboxstrut
          defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture
          begindocument
          [
          beginbmatrix
          tl0 &-1 & & & & & & & & 0 \
          1 & 0br & & & & & & & & \
          & & cdot & & & & & & & \
          & & & cdot & & & & & & \
          & & & & cdot & & & & & \
          & & & & &tl0 & 1 & & & \
          & & & & &-1 & 0br & & & \
          & & & & & & & cdot & & \
          & & & & & & & & cdot & \
          0 & & & & & & & & & cdot \
          endbmatrix
          ]
          enddocument





          share|improve this answer































            5 Answers
            5






            active

            oldest

            votes








            5 Answers
            5






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            9














            Perhaps



            $left(beginarraycccccc
            left[beginarraycc
            0 & 1\
            -1 & 0
            endarrayright] & & & & & 0\
            & ddots\
            & & left[beginarraycc
            0 & 1\
            -1 & 0
            endarrayright]\
            & & & 0\
            & & & & ddots\
            0 & & & & & 0
            endarrayright)$


            enter image description here






            share|improve this answer


















            • 2





              Thank you so much!

              – model_checker
              Mar 28 at 20:45















            9














            Perhaps



            $left(beginarraycccccc
            left[beginarraycc
            0 & 1\
            -1 & 0
            endarrayright] & & & & & 0\
            & ddots\
            & & left[beginarraycc
            0 & 1\
            -1 & 0
            endarrayright]\
            & & & 0\
            & & & & ddots\
            0 & & & & & 0
            endarrayright)$


            enter image description here






            share|improve this answer


















            • 2





              Thank you so much!

              – model_checker
              Mar 28 at 20:45













            9












            9








            9







            Perhaps



            $left(beginarraycccccc
            left[beginarraycc
            0 & 1\
            -1 & 0
            endarrayright] & & & & & 0\
            & ddots\
            & & left[beginarraycc
            0 & 1\
            -1 & 0
            endarrayright]\
            & & & 0\
            & & & & ddots\
            0 & & & & & 0
            endarrayright)$


            enter image description here






            share|improve this answer













            Perhaps



            $left(beginarraycccccc
            left[beginarraycc
            0 & 1\
            -1 & 0
            endarrayright] & & & & & 0\
            & ddots\
            & & left[beginarraycc
            0 & 1\
            -1 & 0
            endarrayright]\
            & & & 0\
            & & & & ddots\
            0 & & & & & 0
            endarrayright)$


            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 28 at 20:42









            riccs_0xriccs_0x

            21015




            21015







            • 2





              Thank you so much!

              – model_checker
              Mar 28 at 20:45












            • 2





              Thank you so much!

              – model_checker
              Mar 28 at 20:45







            2




            2





            Thank you so much!

            – model_checker
            Mar 28 at 20:45





            Thank you so much!

            – model_checker
            Mar 28 at 20:45











            7














            Just for the fun of it! :-)



            documentclassarticle
            usepackageamsmath,array

            begindocument

            [
            beginpmatrix
            newcommandlr[1]multicolumn1c#1
            newcommandrr[1]multicolumn1#1
            ;
            beginarray@*10c@
            cline1-2
            lr0 & rr1 &&&&&&&& raisebox-1em[0pt][0pt]$0$\
            lr-1 & rr0 \
            cline1-2
            && ddots \
            cline4-5
            &&& lr0 & rr1 \
            &&& lr-1 & rr0 \
            cline4-5
            &&&&& 0 \[-1ex]
            &&&&&& ddots \
            &&&&&&& 0 \[-1ex]
            &&&&&&&& ddots \
            multicolumn2c0 &&&&&&&& 0
            endarray
            ;;
            endpmatrix
            ]

            enddocument


            enter image description here






            share|improve this answer


















            • 2





              You guys are the best!

              – model_checker
              Mar 28 at 22:40






            • 1





              @model_checker I'm certainly not the best. Here is world excellence.

              – Sebastiano
              Mar 28 at 22:50






            • 2





              I am sorry! Last I checked there was an objection to your answer. But it's also great!

              – model_checker
              Mar 28 at 22:53






            • 2





              @model_checker Don't worry. I have put two & in addition. :-) but now it is correct.

              – Sebastiano
              Mar 28 at 23:02















            7














            Just for the fun of it! :-)



            documentclassarticle
            usepackageamsmath,array

            begindocument

            [
            beginpmatrix
            newcommandlr[1]multicolumn1c#1
            newcommandrr[1]multicolumn1#1
            ;
            beginarray@*10c@
            cline1-2
            lr0 & rr1 &&&&&&&& raisebox-1em[0pt][0pt]$0$\
            lr-1 & rr0 \
            cline1-2
            && ddots \
            cline4-5
            &&& lr0 & rr1 \
            &&& lr-1 & rr0 \
            cline4-5
            &&&&& 0 \[-1ex]
            &&&&&& ddots \
            &&&&&&& 0 \[-1ex]
            &&&&&&&& ddots \
            multicolumn2c0 &&&&&&&& 0
            endarray
            ;;
            endpmatrix
            ]

            enddocument


            enter image description here






            share|improve this answer


















            • 2





              You guys are the best!

              – model_checker
              Mar 28 at 22:40






            • 1





              @model_checker I'm certainly not the best. Here is world excellence.

              – Sebastiano
              Mar 28 at 22:50






            • 2





              I am sorry! Last I checked there was an objection to your answer. But it's also great!

              – model_checker
              Mar 28 at 22:53






            • 2





              @model_checker Don't worry. I have put two & in addition. :-) but now it is correct.

              – Sebastiano
              Mar 28 at 23:02













            7












            7








            7







            Just for the fun of it! :-)



            documentclassarticle
            usepackageamsmath,array

            begindocument

            [
            beginpmatrix
            newcommandlr[1]multicolumn1c#1
            newcommandrr[1]multicolumn1#1
            ;
            beginarray@*10c@
            cline1-2
            lr0 & rr1 &&&&&&&& raisebox-1em[0pt][0pt]$0$\
            lr-1 & rr0 \
            cline1-2
            && ddots \
            cline4-5
            &&& lr0 & rr1 \
            &&& lr-1 & rr0 \
            cline4-5
            &&&&& 0 \[-1ex]
            &&&&&& ddots \
            &&&&&&& 0 \[-1ex]
            &&&&&&&& ddots \
            multicolumn2c0 &&&&&&&& 0
            endarray
            ;;
            endpmatrix
            ]

            enddocument


            enter image description here






            share|improve this answer













            Just for the fun of it! :-)



            documentclassarticle
            usepackageamsmath,array

            begindocument

            [
            beginpmatrix
            newcommandlr[1]multicolumn1c#1
            newcommandrr[1]multicolumn1#1
            ;
            beginarray@*10c@
            cline1-2
            lr0 & rr1 &&&&&&&& raisebox-1em[0pt][0pt]$0$\
            lr-1 & rr0 \
            cline1-2
            && ddots \
            cline4-5
            &&& lr0 & rr1 \
            &&& lr-1 & rr0 \
            cline4-5
            &&&&& 0 \[-1ex]
            &&&&&& ddots \
            &&&&&&& 0 \[-1ex]
            &&&&&&&& ddots \
            multicolumn2c0 &&&&&&&& 0
            endarray
            ;;
            endpmatrix
            ]

            enddocument


            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 28 at 22:27









            egregegreg

            731k8919293249




            731k8919293249







            • 2





              You guys are the best!

              – model_checker
              Mar 28 at 22:40






            • 1





              @model_checker I'm certainly not the best. Here is world excellence.

              – Sebastiano
              Mar 28 at 22:50






            • 2





              I am sorry! Last I checked there was an objection to your answer. But it's also great!

              – model_checker
              Mar 28 at 22:53






            • 2





              @model_checker Don't worry. I have put two & in addition. :-) but now it is correct.

              – Sebastiano
              Mar 28 at 23:02












            • 2





              You guys are the best!

              – model_checker
              Mar 28 at 22:40






            • 1





              @model_checker I'm certainly not the best. Here is world excellence.

              – Sebastiano
              Mar 28 at 22:50






            • 2





              I am sorry! Last I checked there was an objection to your answer. But it's also great!

              – model_checker
              Mar 28 at 22:53






            • 2





              @model_checker Don't worry. I have put two & in addition. :-) but now it is correct.

              – Sebastiano
              Mar 28 at 23:02







            2




            2





            You guys are the best!

            – model_checker
            Mar 28 at 22:40





            You guys are the best!

            – model_checker
            Mar 28 at 22:40




            1




            1





            @model_checker I'm certainly not the best. Here is world excellence.

            – Sebastiano
            Mar 28 at 22:50





            @model_checker I'm certainly not the best. Here is world excellence.

            – Sebastiano
            Mar 28 at 22:50




            2




            2





            I am sorry! Last I checked there was an objection to your answer. But it's also great!

            – model_checker
            Mar 28 at 22:53





            I am sorry! Last I checked there was an objection to your answer. But it's also great!

            – model_checker
            Mar 28 at 22:53




            2




            2





            @model_checker Don't worry. I have put two & in addition. :-) but now it is correct.

            – Sebastiano
            Mar 28 at 23:02





            @model_checker Don't worry. I have put two & in addition. :-) but now it is correct.

            – Sebastiano
            Mar 28 at 23:02











            6














            Here there is my proposal as the original picture using bmatx command that replace a boxed matrix.



            enter image description here



            documentclassarticle
            usepackagemathtools
            newcommandbmatxboxedbeginmatrix 0& 1 \ -1& 0endmatrix

            begindocument
            [
            beginpmatrix
            , bmatx& & & & & & & 0 \
            & ddots& & & & \
            & & bmatx & & & & \
            & & & ddots& & &\
            & & & & 0 & &\
            & & & & & & ddots\
            0 & & & & & & & 0
            endpmatrix
            ]

            enddocument


            The best code is provided thanks to the precious comment of @Bernard.






            share|improve this answer




















            • 4





              In my opinion, you shouldn't add an empty 3rd column in the definition of bmatx

              – Bernard
              Mar 28 at 21:24






            • 2





              Your comment not is an opinion :-) ...it is truly correct. :-)

              – Sebastiano
              Mar 28 at 21:30















            6














            Here there is my proposal as the original picture using bmatx command that replace a boxed matrix.



            enter image description here



            documentclassarticle
            usepackagemathtools
            newcommandbmatxboxedbeginmatrix 0& 1 \ -1& 0endmatrix

            begindocument
            [
            beginpmatrix
            , bmatx& & & & & & & 0 \
            & ddots& & & & \
            & & bmatx & & & & \
            & & & ddots& & &\
            & & & & 0 & &\
            & & & & & & ddots\
            0 & & & & & & & 0
            endpmatrix
            ]

            enddocument


            The best code is provided thanks to the precious comment of @Bernard.






            share|improve this answer




















            • 4





              In my opinion, you shouldn't add an empty 3rd column in the definition of bmatx

              – Bernard
              Mar 28 at 21:24






            • 2





              Your comment not is an opinion :-) ...it is truly correct. :-)

              – Sebastiano
              Mar 28 at 21:30













            6












            6








            6







            Here there is my proposal as the original picture using bmatx command that replace a boxed matrix.



            enter image description here



            documentclassarticle
            usepackagemathtools
            newcommandbmatxboxedbeginmatrix 0& 1 \ -1& 0endmatrix

            begindocument
            [
            beginpmatrix
            , bmatx& & & & & & & 0 \
            & ddots& & & & \
            & & bmatx & & & & \
            & & & ddots& & &\
            & & & & 0 & &\
            & & & & & & ddots\
            0 & & & & & & & 0
            endpmatrix
            ]

            enddocument


            The best code is provided thanks to the precious comment of @Bernard.






            share|improve this answer















            Here there is my proposal as the original picture using bmatx command that replace a boxed matrix.



            enter image description here



            documentclassarticle
            usepackagemathtools
            newcommandbmatxboxedbeginmatrix 0& 1 \ -1& 0endmatrix

            begindocument
            [
            beginpmatrix
            , bmatx& & & & & & & 0 \
            & ddots& & & & \
            & & bmatx & & & & \
            & & & ddots& & &\
            & & & & 0 & &\
            & & & & & & ddots\
            0 & & & & & & & 0
            endpmatrix
            ]

            enddocument


            The best code is provided thanks to the precious comment of @Bernard.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 28 at 21:30

























            answered Mar 28 at 20:56









            SebastianoSebastiano

            11.5k42164




            11.5k42164







            • 4





              In my opinion, you shouldn't add an empty 3rd column in the definition of bmatx

              – Bernard
              Mar 28 at 21:24






            • 2





              Your comment not is an opinion :-) ...it is truly correct. :-)

              – Sebastiano
              Mar 28 at 21:30












            • 4





              In my opinion, you shouldn't add an empty 3rd column in the definition of bmatx

              – Bernard
              Mar 28 at 21:24






            • 2





              Your comment not is an opinion :-) ...it is truly correct. :-)

              – Sebastiano
              Mar 28 at 21:30







            4




            4





            In my opinion, you shouldn't add an empty 3rd column in the definition of bmatx

            – Bernard
            Mar 28 at 21:24





            In my opinion, you shouldn't add an empty 3rd column in the definition of bmatx

            – Bernard
            Mar 28 at 21:24




            2




            2





            Your comment not is an opinion :-) ...it is truly correct. :-)

            – Sebastiano
            Mar 28 at 21:30





            Your comment not is an opinion :-) ...it is truly correct. :-)

            – Sebastiano
            Mar 28 at 21:30











            5














            Here's another solution. It uses a pmatrix environment for the overall matrix and a custom macro called blockmat for the 2x2 inner matrices.



            enter image description here



            documentclassarticle
            usepackagearray,amsmath
            newcommandblockmat%
            beginarray
            hline 0 & 1^mathstrut \ -1 & 0 \ hline
            endarray
            begindocument
            [
            beginpmatrix
            blockmat & & & & & 0 \
            & ddots & & & & \
            & & blockmat & & & \
            & & & 0 & & \
            & & & & ddots & \
            0 & & & & & 0 \
            endpmatrix
            ]
            enddocument





            share|improve this answer




















            • 1





              Thank you for writing this answer!

              – model_checker
              Mar 28 at 22:03















            5














            Here's another solution. It uses a pmatrix environment for the overall matrix and a custom macro called blockmat for the 2x2 inner matrices.



            enter image description here



            documentclassarticle
            usepackagearray,amsmath
            newcommandblockmat%
            beginarray
            hline 0 & 1^mathstrut \ -1 & 0 \ hline
            endarray
            begindocument
            [
            beginpmatrix
            blockmat & & & & & 0 \
            & ddots & & & & \
            & & blockmat & & & \
            & & & 0 & & \
            & & & & ddots & \
            0 & & & & & 0 \
            endpmatrix
            ]
            enddocument





            share|improve this answer




















            • 1





              Thank you for writing this answer!

              – model_checker
              Mar 28 at 22:03













            5












            5








            5







            Here's another solution. It uses a pmatrix environment for the overall matrix and a custom macro called blockmat for the 2x2 inner matrices.



            enter image description here



            documentclassarticle
            usepackagearray,amsmath
            newcommandblockmat%
            beginarray
            hline 0 & 1^mathstrut \ -1 & 0 \ hline
            endarray
            begindocument
            [
            beginpmatrix
            blockmat & & & & & 0 \
            & ddots & & & & \
            & & blockmat & & & \
            & & & 0 & & \
            & & & & ddots & \
            0 & & & & & 0 \
            endpmatrix
            ]
            enddocument





            share|improve this answer















            Here's another solution. It uses a pmatrix environment for the overall matrix and a custom macro called blockmat for the 2x2 inner matrices.



            enter image description here



            documentclassarticle
            usepackagearray,amsmath
            newcommandblockmat%
            beginarray
            hline 0 & 1^mathstrut \ -1 & 0 \ hline
            endarray
            begindocument
            [
            beginpmatrix
            blockmat & & & & & 0 \
            & ddots & & & & \
            & & blockmat & & & \
            & & & 0 & & \
            & & & & ddots & \
            0 & & & & & 0 \
            endpmatrix
            ]
            enddocument






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 28 at 20:57









            samcarter

            93.4k7105302




            93.4k7105302










            answered Mar 28 at 20:55









            MicoMico

            285k31388778




            285k31388778







            • 1





              Thank you for writing this answer!

              – model_checker
              Mar 28 at 22:03












            • 1





              Thank you for writing this answer!

              – model_checker
              Mar 28 at 22:03







            1




            1





            Thank you for writing this answer!

            – model_checker
            Mar 28 at 22:03





            Thank you for writing this answer!

            – model_checker
            Mar 28 at 22:03











            1














            Here's a solution using TikZ that will work in all kinds of context, not just matrices, to draw boxes. You just need to put tl in the point where the top-right corner is supposed to be and br where the bottom-right will be. You can also use any TikZ feature to modify your box. Obviously this needs to be fine tuned depending on what exactly you're using it for (spacing etc.).



            newcountertextbox
            deftlstepcountertextboxtikzmarknodeathetextboxstrut
            defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture


            The spacing in this version is not optimized for matrices, but you can use



            tikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw ($(athetextbox.north west)+(-0.4arraycolsep,0ex)$) rectangle ($(bthetextbox.south east)+(0.4arraycolsep,0ex)$);endtikzpicture


            to add extra space.



            enter image description here



            Full code:



            documentclassarticle
            usepackagetikz
            usepackageamsmath
            usetikzlibrarytikzmark,calc
            newcountertextbox
            deftlstepcountertextboxtikzmarknodeathetextboxstrut
            defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture
            begindocument
            [
            beginbmatrix
            tl0 &-1 & & & & & & & & 0 \
            1 & 0br & & & & & & & & \
            & & cdot & & & & & & & \
            & & & cdot & & & & & & \
            & & & & cdot & & & & & \
            & & & & &tl0 & 1 & & & \
            & & & & &-1 & 0br & & & \
            & & & & & & & cdot & & \
            & & & & & & & & cdot & \
            0 & & & & & & & & & cdot \
            endbmatrix
            ]
            enddocument





            share|improve this answer





























              1














              Here's a solution using TikZ that will work in all kinds of context, not just matrices, to draw boxes. You just need to put tl in the point where the top-right corner is supposed to be and br where the bottom-right will be. You can also use any TikZ feature to modify your box. Obviously this needs to be fine tuned depending on what exactly you're using it for (spacing etc.).



              newcountertextbox
              deftlstepcountertextboxtikzmarknodeathetextboxstrut
              defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture


              The spacing in this version is not optimized for matrices, but you can use



              tikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw ($(athetextbox.north west)+(-0.4arraycolsep,0ex)$) rectangle ($(bthetextbox.south east)+(0.4arraycolsep,0ex)$);endtikzpicture


              to add extra space.



              enter image description here



              Full code:



              documentclassarticle
              usepackagetikz
              usepackageamsmath
              usetikzlibrarytikzmark,calc
              newcountertextbox
              deftlstepcountertextboxtikzmarknodeathetextboxstrut
              defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture
              begindocument
              [
              beginbmatrix
              tl0 &-1 & & & & & & & & 0 \
              1 & 0br & & & & & & & & \
              & & cdot & & & & & & & \
              & & & cdot & & & & & & \
              & & & & cdot & & & & & \
              & & & & &tl0 & 1 & & & \
              & & & & &-1 & 0br & & & \
              & & & & & & & cdot & & \
              & & & & & & & & cdot & \
              0 & & & & & & & & & cdot \
              endbmatrix
              ]
              enddocument





              share|improve this answer



























                1












                1








                1







                Here's a solution using TikZ that will work in all kinds of context, not just matrices, to draw boxes. You just need to put tl in the point where the top-right corner is supposed to be and br where the bottom-right will be. You can also use any TikZ feature to modify your box. Obviously this needs to be fine tuned depending on what exactly you're using it for (spacing etc.).



                newcountertextbox
                deftlstepcountertextboxtikzmarknodeathetextboxstrut
                defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture


                The spacing in this version is not optimized for matrices, but you can use



                tikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw ($(athetextbox.north west)+(-0.4arraycolsep,0ex)$) rectangle ($(bthetextbox.south east)+(0.4arraycolsep,0ex)$);endtikzpicture


                to add extra space.



                enter image description here



                Full code:



                documentclassarticle
                usepackagetikz
                usepackageamsmath
                usetikzlibrarytikzmark,calc
                newcountertextbox
                deftlstepcountertextboxtikzmarknodeathetextboxstrut
                defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture
                begindocument
                [
                beginbmatrix
                tl0 &-1 & & & & & & & & 0 \
                1 & 0br & & & & & & & & \
                & & cdot & & & & & & & \
                & & & cdot & & & & & & \
                & & & & cdot & & & & & \
                & & & & &tl0 & 1 & & & \
                & & & & &-1 & 0br & & & \
                & & & & & & & cdot & & \
                & & & & & & & & cdot & \
                0 & & & & & & & & & cdot \
                endbmatrix
                ]
                enddocument





                share|improve this answer















                Here's a solution using TikZ that will work in all kinds of context, not just matrices, to draw boxes. You just need to put tl in the point where the top-right corner is supposed to be and br where the bottom-right will be. You can also use any TikZ feature to modify your box. Obviously this needs to be fine tuned depending on what exactly you're using it for (spacing etc.).



                newcountertextbox
                deftlstepcountertextboxtikzmarknodeathetextboxstrut
                defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture


                The spacing in this version is not optimized for matrices, but you can use



                tikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw ($(athetextbox.north west)+(-0.4arraycolsep,0ex)$) rectangle ($(bthetextbox.south east)+(0.4arraycolsep,0ex)$);endtikzpicture


                to add extra space.



                enter image description here



                Full code:



                documentclassarticle
                usepackagetikz
                usepackageamsmath
                usetikzlibrarytikzmark,calc
                newcountertextbox
                deftlstepcountertextboxtikzmarknodeathetextboxstrut
                defbrtikzmarknodebthetextboxstrutbegintikzpicture[overlay, remember picture]draw (athetextbox.north west) rectangle (bthetextbox.south east);endtikzpicture
                begindocument
                [
                beginbmatrix
                tl0 &-1 & & & & & & & & 0 \
                1 & 0br & & & & & & & & \
                & & cdot & & & & & & & \
                & & & cdot & & & & & & \
                & & & & cdot & & & & & \
                & & & & &tl0 & 1 & & & \
                & & & & &-1 & 0br & & & \
                & & & & & & & cdot & & \
                & & & & & & & & cdot & \
                0 & & & & & & & & & cdot \
                endbmatrix
                ]
                enddocument






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited yesterday

























                answered yesterday









                sheßsheß

                2,04711436




                2,04711436













                    Popular posts from this blog

                    Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

                    Tähtien Talli Jäsenet | Lähteet | NavigointivalikkoSuomen Hippos – Tähtien Talli

                    Do these cracks on my tires look bad? The Next CEO of Stack OverflowDry rot tire should I replace?Having to replace tiresFishtailed so easily? Bad tires? ABS?Filling the tires with something other than air, to avoid puncture hassles?Used Michelin tires safe to install?Do these tyre cracks necessitate replacement?Rumbling noise: tires or mechanicalIs it possible to fix noisy feathered tires?Are bad winter tires still better than summer tires in winter?Torque converter failure - Related to replacing only 2 tires?Why use snow tires on all 4 wheels on 2-wheel-drive cars?