align equation, matrix and table

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











up vote
4
down vote

favorite












I need to align this equation as enter image description here



I recreated it by using equation , matrix and tabular environment.



beginequation hatJ_x leftrightarrow frachbar2
beginpmatrix
begintabular c
0 & 0 & 0 & 0 & \ hline
multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
& & & $sqrt3$ 0 2 0 & \
& & & 0 2 0 $sqrt3$ & \
& & & 0 0 $sqrt3$ 0& \ hline
& & & & $ddots$ \
endtabular
endpmatrix
endequation


getting this enter image description here but I need the first part of the equation to be aligned on the top left. Also the alignment in the table is a bit off. Any ideas?










share|improve this question























  • Don't use tabular but array (essentially the same as tabular but for maths).
    – Skillmon
    40 mins ago














up vote
4
down vote

favorite












I need to align this equation as enter image description here



I recreated it by using equation , matrix and tabular environment.



beginequation hatJ_x leftrightarrow frachbar2
beginpmatrix
begintabular c
0 & 0 & 0 & 0 & \ hline
multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
& & & $sqrt3$ 0 2 0 & \
& & & 0 2 0 $sqrt3$ & \
& & & 0 0 $sqrt3$ 0& \ hline
& & & & $ddots$ \
endtabular
endpmatrix
endequation


getting this enter image description here but I need the first part of the equation to be aligned on the top left. Also the alignment in the table is a bit off. Any ideas?










share|improve this question























  • Don't use tabular but array (essentially the same as tabular but for maths).
    – Skillmon
    40 mins ago












up vote
4
down vote

favorite









up vote
4
down vote

favorite











I need to align this equation as enter image description here



I recreated it by using equation , matrix and tabular environment.



beginequation hatJ_x leftrightarrow frachbar2
beginpmatrix
begintabular c
0 & 0 & 0 & 0 & \ hline
multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
& & & $sqrt3$ 0 2 0 & \
& & & 0 2 0 $sqrt3$ & \
& & & 0 0 $sqrt3$ 0& \ hline
& & & & $ddots$ \
endtabular
endpmatrix
endequation


getting this enter image description here but I need the first part of the equation to be aligned on the top left. Also the alignment in the table is a bit off. Any ideas?










share|improve this question















I need to align this equation as enter image description here



I recreated it by using equation , matrix and tabular environment.



beginequation hatJ_x leftrightarrow frachbar2
beginpmatrix
begintabular c
0 & 0 & 0 & 0 & \ hline
multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
& & & $sqrt3$ 0 2 0 & \
& & & 0 2 0 $sqrt3$ & \
& & & 0 0 $sqrt3$ 0& \ hline
& & & & $ddots$ \
endtabular
endpmatrix
endequation


getting this enter image description here but I need the first part of the equation to be aligned on the top left. Also the alignment in the table is a bit off. Any ideas?







tables align matrices






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 44 mins ago









Skillmon

18.8k11637




18.8k11637










asked 51 mins ago









Evan

734




734











  • Don't use tabular but array (essentially the same as tabular but for maths).
    – Skillmon
    40 mins ago
















  • Don't use tabular but array (essentially the same as tabular but for maths).
    – Skillmon
    40 mins ago















Don't use tabular but array (essentially the same as tabular but for maths).
– Skillmon
40 mins ago




Don't use tabular but array (essentially the same as tabular but for maths).
– Skillmon
40 mins ago










3 Answers
3






active

oldest

votes

















up vote
3
down vote













You can use delarray for top aligning the matrix and gathered for centering the equation number.



documentclassarticle
usepackageamsmath
usepackagedelarray

begindocument

beginequation
begingathered
hatJ_x leftrightarrow frachbar2
beginarray[t]( c )
0 & 0 & 0 & 0 & vphantomBig \
hline
0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
hline
0 & 0 & beginmatrix
0 & sqrt2 & 0 \
sqrt2 & 0 & sqrt2 \
0 & sqrt2 & 0
endmatrix & 0 & \
hline
0 & 0 & 0 & beginmatrix
0 & sqrt3 & 0 & 0 \
sqrt3 & 0 & 2 & 0 \
0 & 2 & 0 & sqrt3 \
0 & 0 & sqrt3 & 0
endmatrix & \
hline
& & & & ddots
endarray
endgathered
endequation

enddocument


Nesting matrices is much easier than abusing multirow.



enter image description here



Removing gathered yields



enter image description here



On the other hand, I don't think this is really clear.



In case you change your mind:



documentclassarticle
usepackageamsmath

begindocument

beginequation
hatJ_x leftrightarrow frachbar2
left(beginarray c
0 & 0 & 0 & 0 & vphantomBig \
hline
0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
hline
0 & 0 & beginmatrix
0 & sqrt2 & 0 \
sqrt2 & 0 & sqrt2 \
0 & sqrt2 & 0
endmatrix & 0 & \
hline
0 & 0 & 0 & beginmatrix
0 & sqrt3 & 0 & 0 \
sqrt3 & 0 & 2 & 0 \
0 & 2 & 0 & sqrt3 \
0 & 0 & sqrt3 & 0
endmatrix & \
hline
& & & & ddots
endarrayright)
endequation

enddocument


enter image description here



You can obtain a more open look by setting extrarowheight. I'll only show it added to the last code, the method applies the same for the other two examples.



documentclassarticle
usepackageamsmath
usepackagearray

begindocument

beginequation
setlengthextrarowheight2pt
hatJ_x leftrightarrow frachbar2
left(beginarray c
0 & 0 & 0 & 0 & vphantomBig \
hline
0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
hline
0 & 0 & beginmatrix
0 & sqrt2 & 0 \
sqrt2 & 0 & sqrt2 \
0 & sqrt2 & 0
endmatrix & 0 & \
hline
0 & 0 & 0 & beginmatrix
0 & sqrt3 & 0 & 0 \
sqrt3 & 0 & 2 & 0 \
0 & 2 & 0 & sqrt3 \
0 & 0 & sqrt3 & 0
endmatrix & \
hline
& & & & ddots
endarrayright)
endequation

enddocument


enter image description here






share|improve this answer


















  • 1




    @Mico Done in a different way
    – egreg
    4 mins ago










  • your first answer looks exactly like what I want but the ( ) after the beginarray don't work.
    – Evan
    2 mins ago


















up vote
1
down vote













You can use raisebox-height to lower the box to move it below the baseline and raiseboxdimexpr-height+baselineskiprelax to get it on the correct height:



documentclassarticle

usepackageamsmath
usepackagemultirow

begindocument
beginequation hatJ_x leftrightarrow frachbar2
raiseboxdimexpr-height+baselineskiprelax
%
$beginpmatrix
beginarray c
0 & 0 & 0 & 0 & \ hline
multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
multirow3*0 & multirow3*0 & 0 sqrt2 0 & multirow3*0 \ & & sqrt2 0 sqrt2 & \ & & 0 sqrt2 0 & \ hline
multirow4*0 & multirow4*0 & multirow4*0 & 0 sqrt3 0 0 & \
& & & sqrt3 0 2 0 & \
& & & 0 2 0 sqrt3 & \
& & & 0 0 sqrt3 0& \ hline
& & & & ddots \
endarray
endpmatrix$%

endequation
enddocument


enter image description here






share|improve this answer



























    up vote
    1
    down vote













    If you want the eq number aligned with the top, then just place the pmatrix in a belowbaseline[-htstrutbox]....



    documentclassarticle
    usepackageamsmath,multirow,stackengine
    begindocument
    beginequation hatJ_x leftrightarrow frachbar2
    belowbaseline[-htstrutbox]$beginpmatrix
    begintabular c
    0 & 0 & 0 & 0 & \ hline
    multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
    multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
    multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
    & & & $sqrt3$ 0 2 0 & \
    & & & 0 2 0 $sqrt3$ & \
    & & & 0 0 $sqrt3$ 0& \ hline
    & & & & $ddots$ \
    endtabular
    endpmatrix$
    endequation
    enddocument


    enter image description here



    If you want the number centered, then just wrap the whole thing in a vcenterhbox$displaystyle...$



    documentclassarticle
    usepackageamsmath,multirow,stackengine
    begindocument
    beginequation vcenterhbox$displaystylehatJ_x leftrightarrow frachbar2
    belowbaseline[-htstrutbox]$beginpmatrix
    begintabular c
    0 & 0 & 0 & 0 & \ hline
    multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
    multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
    multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
    & & & $sqrt3$ 0 2 0 & \
    & & & 0 2 0 $sqrt3$ & \
    & & & 0 0 $sqrt3$ 0& \ hline
    & & & & $ddots$ \
    endtabular
    endpmatrix$$
    endequation
    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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f453300%2falign-equation-matrix-and-table%23new-answer', 'question_page');

      );

      Post as a guest






























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote













      You can use delarray for top aligning the matrix and gathered for centering the equation number.



      documentclassarticle
      usepackageamsmath
      usepackagedelarray

      begindocument

      beginequation
      begingathered
      hatJ_x leftrightarrow frachbar2
      beginarray[t]( c )
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarray
      endgathered
      endequation

      enddocument


      Nesting matrices is much easier than abusing multirow.



      enter image description here



      Removing gathered yields



      enter image description here



      On the other hand, I don't think this is really clear.



      In case you change your mind:



      documentclassarticle
      usepackageamsmath

      begindocument

      beginequation
      hatJ_x leftrightarrow frachbar2
      left(beginarray c
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarrayright)
      endequation

      enddocument


      enter image description here



      You can obtain a more open look by setting extrarowheight. I'll only show it added to the last code, the method applies the same for the other two examples.



      documentclassarticle
      usepackageamsmath
      usepackagearray

      begindocument

      beginequation
      setlengthextrarowheight2pt
      hatJ_x leftrightarrow frachbar2
      left(beginarray c
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarrayright)
      endequation

      enddocument


      enter image description here






      share|improve this answer


















      • 1




        @Mico Done in a different way
        – egreg
        4 mins ago










      • your first answer looks exactly like what I want but the ( ) after the beginarray don't work.
        – Evan
        2 mins ago















      up vote
      3
      down vote













      You can use delarray for top aligning the matrix and gathered for centering the equation number.



      documentclassarticle
      usepackageamsmath
      usepackagedelarray

      begindocument

      beginequation
      begingathered
      hatJ_x leftrightarrow frachbar2
      beginarray[t]( c )
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarray
      endgathered
      endequation

      enddocument


      Nesting matrices is much easier than abusing multirow.



      enter image description here



      Removing gathered yields



      enter image description here



      On the other hand, I don't think this is really clear.



      In case you change your mind:



      documentclassarticle
      usepackageamsmath

      begindocument

      beginequation
      hatJ_x leftrightarrow frachbar2
      left(beginarray c
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarrayright)
      endequation

      enddocument


      enter image description here



      You can obtain a more open look by setting extrarowheight. I'll only show it added to the last code, the method applies the same for the other two examples.



      documentclassarticle
      usepackageamsmath
      usepackagearray

      begindocument

      beginequation
      setlengthextrarowheight2pt
      hatJ_x leftrightarrow frachbar2
      left(beginarray c
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarrayright)
      endequation

      enddocument


      enter image description here






      share|improve this answer


















      • 1




        @Mico Done in a different way
        – egreg
        4 mins ago










      • your first answer looks exactly like what I want but the ( ) after the beginarray don't work.
        – Evan
        2 mins ago













      up vote
      3
      down vote










      up vote
      3
      down vote









      You can use delarray for top aligning the matrix and gathered for centering the equation number.



      documentclassarticle
      usepackageamsmath
      usepackagedelarray

      begindocument

      beginequation
      begingathered
      hatJ_x leftrightarrow frachbar2
      beginarray[t]( c )
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarray
      endgathered
      endequation

      enddocument


      Nesting matrices is much easier than abusing multirow.



      enter image description here



      Removing gathered yields



      enter image description here



      On the other hand, I don't think this is really clear.



      In case you change your mind:



      documentclassarticle
      usepackageamsmath

      begindocument

      beginequation
      hatJ_x leftrightarrow frachbar2
      left(beginarray c
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarrayright)
      endequation

      enddocument


      enter image description here



      You can obtain a more open look by setting extrarowheight. I'll only show it added to the last code, the method applies the same for the other two examples.



      documentclassarticle
      usepackageamsmath
      usepackagearray

      begindocument

      beginequation
      setlengthextrarowheight2pt
      hatJ_x leftrightarrow frachbar2
      left(beginarray c
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarrayright)
      endequation

      enddocument


      enter image description here






      share|improve this answer














      You can use delarray for top aligning the matrix and gathered for centering the equation number.



      documentclassarticle
      usepackageamsmath
      usepackagedelarray

      begindocument

      beginequation
      begingathered
      hatJ_x leftrightarrow frachbar2
      beginarray[t]( c )
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarray
      endgathered
      endequation

      enddocument


      Nesting matrices is much easier than abusing multirow.



      enter image description here



      Removing gathered yields



      enter image description here



      On the other hand, I don't think this is really clear.



      In case you change your mind:



      documentclassarticle
      usepackageamsmath

      begindocument

      beginequation
      hatJ_x leftrightarrow frachbar2
      left(beginarray c
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarrayright)
      endequation

      enddocument


      enter image description here



      You can obtain a more open look by setting extrarowheight. I'll only show it added to the last code, the method applies the same for the other two examples.



      documentclassarticle
      usepackageamsmath
      usepackagearray

      begindocument

      beginequation
      setlengthextrarowheight2pt
      hatJ_x leftrightarrow frachbar2
      left(beginarray c
      0 & 0 & 0 & 0 & vphantomBig \
      hline
      0 & beginmatrix 1 & 0 \ 0 & 1endmatrix & 0 & & \
      hline
      0 & 0 & beginmatrix
      0 & sqrt2 & 0 \
      sqrt2 & 0 & sqrt2 \
      0 & sqrt2 & 0
      endmatrix & 0 & \
      hline
      0 & 0 & 0 & beginmatrix
      0 & sqrt3 & 0 & 0 \
      sqrt3 & 0 & 2 & 0 \
      0 & 2 & 0 & sqrt3 \
      0 & 0 & sqrt3 & 0
      endmatrix & \
      hline
      & & & & ddots
      endarrayright)
      endequation

      enddocument


      enter image description here







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited 4 mins ago

























      answered 30 mins ago









      egreg

      686k8418283077




      686k8418283077







      • 1




        @Mico Done in a different way
        – egreg
        4 mins ago










      • your first answer looks exactly like what I want but the ( ) after the beginarray don't work.
        – Evan
        2 mins ago













      • 1




        @Mico Done in a different way
        – egreg
        4 mins ago










      • your first answer looks exactly like what I want but the ( ) after the beginarray don't work.
        – Evan
        2 mins ago








      1




      1




      @Mico Done in a different way
      – egreg
      4 mins ago




      @Mico Done in a different way
      – egreg
      4 mins ago












      your first answer looks exactly like what I want but the ( ) after the beginarray don't work.
      – Evan
      2 mins ago





      your first answer looks exactly like what I want but the ( ) after the beginarray don't work.
      – Evan
      2 mins ago











      up vote
      1
      down vote













      You can use raisebox-height to lower the box to move it below the baseline and raiseboxdimexpr-height+baselineskiprelax to get it on the correct height:



      documentclassarticle

      usepackageamsmath
      usepackagemultirow

      begindocument
      beginequation hatJ_x leftrightarrow frachbar2
      raiseboxdimexpr-height+baselineskiprelax
      %
      $beginpmatrix
      beginarray c
      0 & 0 & 0 & 0 & \ hline
      multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
      multirow3*0 & multirow3*0 & 0 sqrt2 0 & multirow3*0 \ & & sqrt2 0 sqrt2 & \ & & 0 sqrt2 0 & \ hline
      multirow4*0 & multirow4*0 & multirow4*0 & 0 sqrt3 0 0 & \
      & & & sqrt3 0 2 0 & \
      & & & 0 2 0 sqrt3 & \
      & & & 0 0 sqrt3 0& \ hline
      & & & & ddots \
      endarray
      endpmatrix$%

      endequation
      enddocument


      enter image description here






      share|improve this answer
























        up vote
        1
        down vote













        You can use raisebox-height to lower the box to move it below the baseline and raiseboxdimexpr-height+baselineskiprelax to get it on the correct height:



        documentclassarticle

        usepackageamsmath
        usepackagemultirow

        begindocument
        beginequation hatJ_x leftrightarrow frachbar2
        raiseboxdimexpr-height+baselineskiprelax
        %
        $beginpmatrix
        beginarray c
        0 & 0 & 0 & 0 & \ hline
        multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
        multirow3*0 & multirow3*0 & 0 sqrt2 0 & multirow3*0 \ & & sqrt2 0 sqrt2 & \ & & 0 sqrt2 0 & \ hline
        multirow4*0 & multirow4*0 & multirow4*0 & 0 sqrt3 0 0 & \
        & & & sqrt3 0 2 0 & \
        & & & 0 2 0 sqrt3 & \
        & & & 0 0 sqrt3 0& \ hline
        & & & & ddots \
        endarray
        endpmatrix$%

        endequation
        enddocument


        enter image description here






        share|improve this answer






















          up vote
          1
          down vote










          up vote
          1
          down vote









          You can use raisebox-height to lower the box to move it below the baseline and raiseboxdimexpr-height+baselineskiprelax to get it on the correct height:



          documentclassarticle

          usepackageamsmath
          usepackagemultirow

          begindocument
          beginequation hatJ_x leftrightarrow frachbar2
          raiseboxdimexpr-height+baselineskiprelax
          %
          $beginpmatrix
          beginarray c
          0 & 0 & 0 & 0 & \ hline
          multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
          multirow3*0 & multirow3*0 & 0 sqrt2 0 & multirow3*0 \ & & sqrt2 0 sqrt2 & \ & & 0 sqrt2 0 & \ hline
          multirow4*0 & multirow4*0 & multirow4*0 & 0 sqrt3 0 0 & \
          & & & sqrt3 0 2 0 & \
          & & & 0 2 0 sqrt3 & \
          & & & 0 0 sqrt3 0& \ hline
          & & & & ddots \
          endarray
          endpmatrix$%

          endequation
          enddocument


          enter image description here






          share|improve this answer












          You can use raisebox-height to lower the box to move it below the baseline and raiseboxdimexpr-height+baselineskiprelax to get it on the correct height:



          documentclassarticle

          usepackageamsmath
          usepackagemultirow

          begindocument
          beginequation hatJ_x leftrightarrow frachbar2
          raiseboxdimexpr-height+baselineskiprelax
          %
          $beginpmatrix
          beginarray c
          0 & 0 & 0 & 0 & \ hline
          multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
          multirow3*0 & multirow3*0 & 0 sqrt2 0 & multirow3*0 \ & & sqrt2 0 sqrt2 & \ & & 0 sqrt2 0 & \ hline
          multirow4*0 & multirow4*0 & multirow4*0 & 0 sqrt3 0 0 & \
          & & & sqrt3 0 2 0 & \
          & & & 0 2 0 sqrt3 & \
          & & & 0 0 sqrt3 0& \ hline
          & & & & ddots \
          endarray
          endpmatrix$%

          endequation
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 24 mins ago









          Skillmon

          18.8k11637




          18.8k11637




















              up vote
              1
              down vote













              If you want the eq number aligned with the top, then just place the pmatrix in a belowbaseline[-htstrutbox]....



              documentclassarticle
              usepackageamsmath,multirow,stackengine
              begindocument
              beginequation hatJ_x leftrightarrow frachbar2
              belowbaseline[-htstrutbox]$beginpmatrix
              begintabular c
              0 & 0 & 0 & 0 & \ hline
              multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
              multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
              multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
              & & & $sqrt3$ 0 2 0 & \
              & & & 0 2 0 $sqrt3$ & \
              & & & 0 0 $sqrt3$ 0& \ hline
              & & & & $ddots$ \
              endtabular
              endpmatrix$
              endequation
              enddocument


              enter image description here



              If you want the number centered, then just wrap the whole thing in a vcenterhbox$displaystyle...$



              documentclassarticle
              usepackageamsmath,multirow,stackengine
              begindocument
              beginequation vcenterhbox$displaystylehatJ_x leftrightarrow frachbar2
              belowbaseline[-htstrutbox]$beginpmatrix
              begintabular c
              0 & 0 & 0 & 0 & \ hline
              multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
              multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
              multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
              & & & $sqrt3$ 0 2 0 & \
              & & & 0 2 0 $sqrt3$ & \
              & & & 0 0 $sqrt3$ 0& \ hline
              & & & & $ddots$ \
              endtabular
              endpmatrix$$
              endequation
              enddocument


              enter image description here






              share|improve this answer


























                up vote
                1
                down vote













                If you want the eq number aligned with the top, then just place the pmatrix in a belowbaseline[-htstrutbox]....



                documentclassarticle
                usepackageamsmath,multirow,stackengine
                begindocument
                beginequation hatJ_x leftrightarrow frachbar2
                belowbaseline[-htstrutbox]$beginpmatrix
                begintabular c
                0 & 0 & 0 & 0 & \ hline
                multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
                multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
                multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
                & & & $sqrt3$ 0 2 0 & \
                & & & 0 2 0 $sqrt3$ & \
                & & & 0 0 $sqrt3$ 0& \ hline
                & & & & $ddots$ \
                endtabular
                endpmatrix$
                endequation
                enddocument


                enter image description here



                If you want the number centered, then just wrap the whole thing in a vcenterhbox$displaystyle...$



                documentclassarticle
                usepackageamsmath,multirow,stackengine
                begindocument
                beginequation vcenterhbox$displaystylehatJ_x leftrightarrow frachbar2
                belowbaseline[-htstrutbox]$beginpmatrix
                begintabular c
                0 & 0 & 0 & 0 & \ hline
                multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
                multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
                multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
                & & & $sqrt3$ 0 2 0 & \
                & & & 0 2 0 $sqrt3$ & \
                & & & 0 0 $sqrt3$ 0& \ hline
                & & & & $ddots$ \
                endtabular
                endpmatrix$$
                endequation
                enddocument


                enter image description here






                share|improve this answer
























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  If you want the eq number aligned with the top, then just place the pmatrix in a belowbaseline[-htstrutbox]....



                  documentclassarticle
                  usepackageamsmath,multirow,stackengine
                  begindocument
                  beginequation hatJ_x leftrightarrow frachbar2
                  belowbaseline[-htstrutbox]$beginpmatrix
                  begintabular c
                  0 & 0 & 0 & 0 & \ hline
                  multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
                  multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
                  multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
                  & & & $sqrt3$ 0 2 0 & \
                  & & & 0 2 0 $sqrt3$ & \
                  & & & 0 0 $sqrt3$ 0& \ hline
                  & & & & $ddots$ \
                  endtabular
                  endpmatrix$
                  endequation
                  enddocument


                  enter image description here



                  If you want the number centered, then just wrap the whole thing in a vcenterhbox$displaystyle...$



                  documentclassarticle
                  usepackageamsmath,multirow,stackengine
                  begindocument
                  beginequation vcenterhbox$displaystylehatJ_x leftrightarrow frachbar2
                  belowbaseline[-htstrutbox]$beginpmatrix
                  begintabular c
                  0 & 0 & 0 & 0 & \ hline
                  multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
                  multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
                  multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
                  & & & $sqrt3$ 0 2 0 & \
                  & & & 0 2 0 $sqrt3$ & \
                  & & & 0 0 $sqrt3$ 0& \ hline
                  & & & & $ddots$ \
                  endtabular
                  endpmatrix$$
                  endequation
                  enddocument


                  enter image description here






                  share|improve this answer














                  If you want the eq number aligned with the top, then just place the pmatrix in a belowbaseline[-htstrutbox]....



                  documentclassarticle
                  usepackageamsmath,multirow,stackengine
                  begindocument
                  beginequation hatJ_x leftrightarrow frachbar2
                  belowbaseline[-htstrutbox]$beginpmatrix
                  begintabular c
                  0 & 0 & 0 & 0 & \ hline
                  multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
                  multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
                  multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
                  & & & $sqrt3$ 0 2 0 & \
                  & & & 0 2 0 $sqrt3$ & \
                  & & & 0 0 $sqrt3$ 0& \ hline
                  & & & & $ddots$ \
                  endtabular
                  endpmatrix$
                  endequation
                  enddocument


                  enter image description here



                  If you want the number centered, then just wrap the whole thing in a vcenterhbox$displaystyle...$



                  documentclassarticle
                  usepackageamsmath,multirow,stackengine
                  begindocument
                  beginequation vcenterhbox$displaystylehatJ_x leftrightarrow frachbar2
                  belowbaseline[-htstrutbox]$beginpmatrix
                  begintabular c
                  0 & 0 & 0 & 0 & \ hline
                  multirow2*0 & 0 1 & multirow2*0 & multirow2*0 \ & 1 0 & & \ hline
                  multirow3*0 & multirow3*0 & 0 $sqrt2$ 0 & multirow3*0 \ & & $sqrt2$ 0 $sqrt2$ & \ & & 0 $sqrt2$ 0 & \ hline
                  multirow4*0 & multirow4*0 & multirow4*0 & 0 $sqrt3$ 0 0 & \
                  & & & $sqrt3$ 0 2 0 & \
                  & & & 0 2 0 $sqrt3$ & \
                  & & & 0 0 $sqrt3$ 0& \ hline
                  & & & & $ddots$ \
                  endtabular
                  endpmatrix$$
                  endequation
                  enddocument


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 3 mins ago

























                  answered 33 mins ago









                  Steven B. Segletes

                  147k9186390




                  147k9186390



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f453300%2falign-equation-matrix-and-table%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      List of Gilmore Girls characters

                      Confectionery