Mulicolumn and Multirow alignment and spacing

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












1














In my first encounter with multicolumn and multirow, I have attempted to make a table containing math, including matrices.



Firstly, I have an error in my column names; I'm unsure where I am going wrong and have been unable to find similar problems. I wish for my titles to be "Design" and then "Results" as my multicolumn heading, but they both sit in the same box. (Edit: I'm also getting an error "Extra alignment tab has been changed to cr." which I think may be the source of this problem?)



Secondly, the matrices in the cells seem crowded, is it possible to modify the cell size whilst retaining centering?



Finally, in my first column I have two matrices which sit each in their own multirow, they are currently left aligned (or aligned with each other) is it possible again to have them centered within their (multiple) cell?



I appreciate any help but will continue to attempt to resolve the issues. Please see the code below:



documentclassarticle
usepackagemultirow
usepackageamsmath
begindocument

begincenter
begintabular c
Design &multicolumn4cResults\
hline
multirow211em$xi_3 = beginBmatrix
-1 &0 &1 \
1/3 &1/3 &1/3 \
endBmatrix$
&$M(xi_3)=beginbmatrix
3 &0 \
0 &2
endbmatrix$
&$d(x,xi_3)= 1+frac3x^22$ \
&$beginvmatrixM(xi_3)endvmatrix=6$
&$d(x,xi_3)=2.5$\
multirow211em$xi_3^' = beginBmatrix
-1 &1 \
1/2 &1/2 \
endBmatrix$
&$M(xi_3^')=beginbmatrix
3 &0 \
0 &2
endbmatrix$
&$d(x,xi_3^')= 1+frac3x^22$ \
&$beginvmatrixM(xi_3^')endvmatrix=8$
&$d(x,xi_3^')=3$\
endtabular
endcenter

enddocument









share|improve this question


























    1














    In my first encounter with multicolumn and multirow, I have attempted to make a table containing math, including matrices.



    Firstly, I have an error in my column names; I'm unsure where I am going wrong and have been unable to find similar problems. I wish for my titles to be "Design" and then "Results" as my multicolumn heading, but they both sit in the same box. (Edit: I'm also getting an error "Extra alignment tab has been changed to cr." which I think may be the source of this problem?)



    Secondly, the matrices in the cells seem crowded, is it possible to modify the cell size whilst retaining centering?



    Finally, in my first column I have two matrices which sit each in their own multirow, they are currently left aligned (or aligned with each other) is it possible again to have them centered within their (multiple) cell?



    I appreciate any help but will continue to attempt to resolve the issues. Please see the code below:



    documentclassarticle
    usepackagemultirow
    usepackageamsmath
    begindocument

    begincenter
    begintabular c
    Design &multicolumn4cResults\
    hline
    multirow211em$xi_3 = beginBmatrix
    -1 &0 &1 \
    1/3 &1/3 &1/3 \
    endBmatrix$
    &$M(xi_3)=beginbmatrix
    3 &0 \
    0 &2
    endbmatrix$
    &$d(x,xi_3)= 1+frac3x^22$ \
    &$beginvmatrixM(xi_3)endvmatrix=6$
    &$d(x,xi_3)=2.5$\
    multirow211em$xi_3^' = beginBmatrix
    -1 &1 \
    1/2 &1/2 \
    endBmatrix$
    &$M(xi_3^')=beginbmatrix
    3 &0 \
    0 &2
    endbmatrix$
    &$d(x,xi_3^')= 1+frac3x^22$ \
    &$beginvmatrixM(xi_3^')endvmatrix=8$
    &$d(x,xi_3^')=3$\
    endtabular
    endcenter

    enddocument









    share|improve this question
























      1












      1








      1


      1





      In my first encounter with multicolumn and multirow, I have attempted to make a table containing math, including matrices.



      Firstly, I have an error in my column names; I'm unsure where I am going wrong and have been unable to find similar problems. I wish for my titles to be "Design" and then "Results" as my multicolumn heading, but they both sit in the same box. (Edit: I'm also getting an error "Extra alignment tab has been changed to cr." which I think may be the source of this problem?)



      Secondly, the matrices in the cells seem crowded, is it possible to modify the cell size whilst retaining centering?



      Finally, in my first column I have two matrices which sit each in their own multirow, they are currently left aligned (or aligned with each other) is it possible again to have them centered within their (multiple) cell?



      I appreciate any help but will continue to attempt to resolve the issues. Please see the code below:



      documentclassarticle
      usepackagemultirow
      usepackageamsmath
      begindocument

      begincenter
      begintabular c
      Design &multicolumn4cResults\
      hline
      multirow211em$xi_3 = beginBmatrix
      -1 &0 &1 \
      1/3 &1/3 &1/3 \
      endBmatrix$
      &$M(xi_3)=beginbmatrix
      3 &0 \
      0 &2
      endbmatrix$
      &$d(x,xi_3)= 1+frac3x^22$ \
      &$beginvmatrixM(xi_3)endvmatrix=6$
      &$d(x,xi_3)=2.5$\
      multirow211em$xi_3^' = beginBmatrix
      -1 &1 \
      1/2 &1/2 \
      endBmatrix$
      &$M(xi_3^')=beginbmatrix
      3 &0 \
      0 &2
      endbmatrix$
      &$d(x,xi_3^')= 1+frac3x^22$ \
      &$beginvmatrixM(xi_3^')endvmatrix=8$
      &$d(x,xi_3^')=3$\
      endtabular
      endcenter

      enddocument









      share|improve this question













      In my first encounter with multicolumn and multirow, I have attempted to make a table containing math, including matrices.



      Firstly, I have an error in my column names; I'm unsure where I am going wrong and have been unable to find similar problems. I wish for my titles to be "Design" and then "Results" as my multicolumn heading, but they both sit in the same box. (Edit: I'm also getting an error "Extra alignment tab has been changed to cr." which I think may be the source of this problem?)



      Secondly, the matrices in the cells seem crowded, is it possible to modify the cell size whilst retaining centering?



      Finally, in my first column I have two matrices which sit each in their own multirow, they are currently left aligned (or aligned with each other) is it possible again to have them centered within their (multiple) cell?



      I appreciate any help but will continue to attempt to resolve the issues. Please see the code below:



      documentclassarticle
      usepackagemultirow
      usepackageamsmath
      begindocument

      begincenter
      begintabular c
      Design &multicolumn4cResults\
      hline
      multirow211em$xi_3 = beginBmatrix
      -1 &0 &1 \
      1/3 &1/3 &1/3 \
      endBmatrix$
      &$M(xi_3)=beginbmatrix
      3 &0 \
      0 &2
      endbmatrix$
      &$d(x,xi_3)= 1+frac3x^22$ \
      &$beginvmatrixM(xi_3)endvmatrix=6$
      &$d(x,xi_3)=2.5$\
      multirow211em$xi_3^' = beginBmatrix
      -1 &1 \
      1/2 &1/2 \
      endBmatrix$
      &$M(xi_3^')=beginbmatrix
      3 &0 \
      0 &2
      endbmatrix$
      &$d(x,xi_3^')= 1+frac3x^22$ \
      &$beginvmatrixM(xi_3^')endvmatrix=8$
      &$d(x,xi_3^')=3$\
      endtabular
      endcenter

      enddocument






      multirow multicolumn






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 21 '18 at 21:53









      Ben

      303




      303




















          2 Answers
          2






          active

          oldest

          votes


















          1














          You do not have to take into account the number pf columns of the matrices inside the tabular. I propose here some simplifications of the code and some improvemennts to the layout, using the array environment, and the makecell and nccmath packages:



          documentclassarticle
          usepackageamsmath, nccmath
          usepackagemultirow, makecell

          begindocument

          [
          beginarrayc
          textDesign &multicolumn2ctextResults\%
          hline
          multirowcell3 xi_3 = beginBmatrix
          -1 &0 &1 \
          1/3 &1/3 &1/3 \
          endBmatrix
          &Gape[6pt][2pt]M(xi_3)=beginbmatrix
          3 &0 \
          0 &2
          endbmatrix
          & d(x,xi_3)= 1+mfrac3x^22 \[1ex]%
          & beginvmatrixM(xi_3)endvmatrix=6
          & d(x,xi_3)=2.5 \
          multirowcell3xi'_3 = beginBmatrix
          -1 &1 \
          1/2 &1/2 \
          endBmatrix
          &Gape[10pt][2pt]M(xi'_3)=beginbmatrix
          3 &0 \
          0 &2
          endbmatrix
          &d(x,xi_3')= 1+mfrac3x^22 \%
          &beginvmatrixM(xi'_3)endvmatrix=8
          &d(x,xi'_3)=3 \
          endarray ]

          enddocument


          enter image description here






          share|improve this answer




























            2














            I would avoid multirow altogether. With array the entries are automatically typeset in math mode, to which I add displaystyle.



            Note that x_3^' is wrong and it should be x_3'.



            documentclassarticle
            usepackageamsmath
            usepackagebooktabs
            usepackagearray

            begindocument

            begincenter
            $beginarray *3>displaystylel
            toprule
            multicolumn1ctextDesign & multicolumn2ctextResults \
            midrule
            smash[b]xi_3 = beginBmatrix
            -1 &0 &1 \
            1/3 &1/3 &1/3 \
            endBmatrix
            &M(xi_3)=beginbmatrix
            3 &0 \
            0 &2
            endbmatrix
            &d(x,xi_3)=1+frac3x^22
            \ addlinespace
            &lvert M(xi_3)rvert=6
            &d(x,xi_3)=2.5
            \ midrule
            smash[b]xi_3' = beginBmatrix
            -1 &1 \
            1/2 &1/2 \
            endBmatrix
            &M(xi_3')=beginbmatrix
            3 &0 \
            0 &2
            endbmatrix
            &d(x,xi_3')=1+frac3x^22
            \ addlinespace
            &lvert M(xi_3')rvert=8
            &d(x,xi_3')=3
            \
            bottomrule
            endarray$
            endcenter

            enddocument


            enter image description here






            share|improve this answer




















              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "85"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466915%2fmulicolumn-and-multirow-alignment-and-spacing%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









              1














              You do not have to take into account the number pf columns of the matrices inside the tabular. I propose here some simplifications of the code and some improvemennts to the layout, using the array environment, and the makecell and nccmath packages:



              documentclassarticle
              usepackageamsmath, nccmath
              usepackagemultirow, makecell

              begindocument

              [
              beginarrayc
              textDesign &multicolumn2ctextResults\%
              hline
              multirowcell3 xi_3 = beginBmatrix
              -1 &0 &1 \
              1/3 &1/3 &1/3 \
              endBmatrix
              &Gape[6pt][2pt]M(xi_3)=beginbmatrix
              3 &0 \
              0 &2
              endbmatrix
              & d(x,xi_3)= 1+mfrac3x^22 \[1ex]%
              & beginvmatrixM(xi_3)endvmatrix=6
              & d(x,xi_3)=2.5 \
              multirowcell3xi'_3 = beginBmatrix
              -1 &1 \
              1/2 &1/2 \
              endBmatrix
              &Gape[10pt][2pt]M(xi'_3)=beginbmatrix
              3 &0 \
              0 &2
              endbmatrix
              &d(x,xi_3')= 1+mfrac3x^22 \%
              &beginvmatrixM(xi'_3)endvmatrix=8
              &d(x,xi'_3)=3 \
              endarray ]

              enddocument


              enter image description here






              share|improve this answer

























                1














                You do not have to take into account the number pf columns of the matrices inside the tabular. I propose here some simplifications of the code and some improvemennts to the layout, using the array environment, and the makecell and nccmath packages:



                documentclassarticle
                usepackageamsmath, nccmath
                usepackagemultirow, makecell

                begindocument

                [
                beginarrayc
                textDesign &multicolumn2ctextResults\%
                hline
                multirowcell3 xi_3 = beginBmatrix
                -1 &0 &1 \
                1/3 &1/3 &1/3 \
                endBmatrix
                &Gape[6pt][2pt]M(xi_3)=beginbmatrix
                3 &0 \
                0 &2
                endbmatrix
                & d(x,xi_3)= 1+mfrac3x^22 \[1ex]%
                & beginvmatrixM(xi_3)endvmatrix=6
                & d(x,xi_3)=2.5 \
                multirowcell3xi'_3 = beginBmatrix
                -1 &1 \
                1/2 &1/2 \
                endBmatrix
                &Gape[10pt][2pt]M(xi'_3)=beginbmatrix
                3 &0 \
                0 &2
                endbmatrix
                &d(x,xi_3')= 1+mfrac3x^22 \%
                &beginvmatrixM(xi'_3)endvmatrix=8
                &d(x,xi'_3)=3 \
                endarray ]

                enddocument


                enter image description here






                share|improve this answer























                  1












                  1








                  1






                  You do not have to take into account the number pf columns of the matrices inside the tabular. I propose here some simplifications of the code and some improvemennts to the layout, using the array environment, and the makecell and nccmath packages:



                  documentclassarticle
                  usepackageamsmath, nccmath
                  usepackagemultirow, makecell

                  begindocument

                  [
                  beginarrayc
                  textDesign &multicolumn2ctextResults\%
                  hline
                  multirowcell3 xi_3 = beginBmatrix
                  -1 &0 &1 \
                  1/3 &1/3 &1/3 \
                  endBmatrix
                  &Gape[6pt][2pt]M(xi_3)=beginbmatrix
                  3 &0 \
                  0 &2
                  endbmatrix
                  & d(x,xi_3)= 1+mfrac3x^22 \[1ex]%
                  & beginvmatrixM(xi_3)endvmatrix=6
                  & d(x,xi_3)=2.5 \
                  multirowcell3xi'_3 = beginBmatrix
                  -1 &1 \
                  1/2 &1/2 \
                  endBmatrix
                  &Gape[10pt][2pt]M(xi'_3)=beginbmatrix
                  3 &0 \
                  0 &2
                  endbmatrix
                  &d(x,xi_3')= 1+mfrac3x^22 \%
                  &beginvmatrixM(xi'_3)endvmatrix=8
                  &d(x,xi'_3)=3 \
                  endarray ]

                  enddocument


                  enter image description here






                  share|improve this answer












                  You do not have to take into account the number pf columns of the matrices inside the tabular. I propose here some simplifications of the code and some improvemennts to the layout, using the array environment, and the makecell and nccmath packages:



                  documentclassarticle
                  usepackageamsmath, nccmath
                  usepackagemultirow, makecell

                  begindocument

                  [
                  beginarrayc
                  textDesign &multicolumn2ctextResults\%
                  hline
                  multirowcell3 xi_3 = beginBmatrix
                  -1 &0 &1 \
                  1/3 &1/3 &1/3 \
                  endBmatrix
                  &Gape[6pt][2pt]M(xi_3)=beginbmatrix
                  3 &0 \
                  0 &2
                  endbmatrix
                  & d(x,xi_3)= 1+mfrac3x^22 \[1ex]%
                  & beginvmatrixM(xi_3)endvmatrix=6
                  & d(x,xi_3)=2.5 \
                  multirowcell3xi'_3 = beginBmatrix
                  -1 &1 \
                  1/2 &1/2 \
                  endBmatrix
                  &Gape[10pt][2pt]M(xi'_3)=beginbmatrix
                  3 &0 \
                  0 &2
                  endbmatrix
                  &d(x,xi_3')= 1+mfrac3x^22 \%
                  &beginvmatrixM(xi'_3)endvmatrix=8
                  &d(x,xi'_3)=3 \
                  endarray ]

                  enddocument


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 21 '18 at 22:44









                  Bernard

                  166k769194




                  166k769194





















                      2














                      I would avoid multirow altogether. With array the entries are automatically typeset in math mode, to which I add displaystyle.



                      Note that x_3^' is wrong and it should be x_3'.



                      documentclassarticle
                      usepackageamsmath
                      usepackagebooktabs
                      usepackagearray

                      begindocument

                      begincenter
                      $beginarray *3>displaystylel
                      toprule
                      multicolumn1ctextDesign & multicolumn2ctextResults \
                      midrule
                      smash[b]xi_3 = beginBmatrix
                      -1 &0 &1 \
                      1/3 &1/3 &1/3 \
                      endBmatrix
                      &M(xi_3)=beginbmatrix
                      3 &0 \
                      0 &2
                      endbmatrix
                      &d(x,xi_3)=1+frac3x^22
                      \ addlinespace
                      &lvert M(xi_3)rvert=6
                      &d(x,xi_3)=2.5
                      \ midrule
                      smash[b]xi_3' = beginBmatrix
                      -1 &1 \
                      1/2 &1/2 \
                      endBmatrix
                      &M(xi_3')=beginbmatrix
                      3 &0 \
                      0 &2
                      endbmatrix
                      &d(x,xi_3')=1+frac3x^22
                      \ addlinespace
                      &lvert M(xi_3')rvert=8
                      &d(x,xi_3')=3
                      \
                      bottomrule
                      endarray$
                      endcenter

                      enddocument


                      enter image description here






                      share|improve this answer

























                        2














                        I would avoid multirow altogether. With array the entries are automatically typeset in math mode, to which I add displaystyle.



                        Note that x_3^' is wrong and it should be x_3'.



                        documentclassarticle
                        usepackageamsmath
                        usepackagebooktabs
                        usepackagearray

                        begindocument

                        begincenter
                        $beginarray *3>displaystylel
                        toprule
                        multicolumn1ctextDesign & multicolumn2ctextResults \
                        midrule
                        smash[b]xi_3 = beginBmatrix
                        -1 &0 &1 \
                        1/3 &1/3 &1/3 \
                        endBmatrix
                        &M(xi_3)=beginbmatrix
                        3 &0 \
                        0 &2
                        endbmatrix
                        &d(x,xi_3)=1+frac3x^22
                        \ addlinespace
                        &lvert M(xi_3)rvert=6
                        &d(x,xi_3)=2.5
                        \ midrule
                        smash[b]xi_3' = beginBmatrix
                        -1 &1 \
                        1/2 &1/2 \
                        endBmatrix
                        &M(xi_3')=beginbmatrix
                        3 &0 \
                        0 &2
                        endbmatrix
                        &d(x,xi_3')=1+frac3x^22
                        \ addlinespace
                        &lvert M(xi_3')rvert=8
                        &d(x,xi_3')=3
                        \
                        bottomrule
                        endarray$
                        endcenter

                        enddocument


                        enter image description here






                        share|improve this answer























                          2












                          2








                          2






                          I would avoid multirow altogether. With array the entries are automatically typeset in math mode, to which I add displaystyle.



                          Note that x_3^' is wrong and it should be x_3'.



                          documentclassarticle
                          usepackageamsmath
                          usepackagebooktabs
                          usepackagearray

                          begindocument

                          begincenter
                          $beginarray *3>displaystylel
                          toprule
                          multicolumn1ctextDesign & multicolumn2ctextResults \
                          midrule
                          smash[b]xi_3 = beginBmatrix
                          -1 &0 &1 \
                          1/3 &1/3 &1/3 \
                          endBmatrix
                          &M(xi_3)=beginbmatrix
                          3 &0 \
                          0 &2
                          endbmatrix
                          &d(x,xi_3)=1+frac3x^22
                          \ addlinespace
                          &lvert M(xi_3)rvert=6
                          &d(x,xi_3)=2.5
                          \ midrule
                          smash[b]xi_3' = beginBmatrix
                          -1 &1 \
                          1/2 &1/2 \
                          endBmatrix
                          &M(xi_3')=beginbmatrix
                          3 &0 \
                          0 &2
                          endbmatrix
                          &d(x,xi_3')=1+frac3x^22
                          \ addlinespace
                          &lvert M(xi_3')rvert=8
                          &d(x,xi_3')=3
                          \
                          bottomrule
                          endarray$
                          endcenter

                          enddocument


                          enter image description here






                          share|improve this answer












                          I would avoid multirow altogether. With array the entries are automatically typeset in math mode, to which I add displaystyle.



                          Note that x_3^' is wrong and it should be x_3'.



                          documentclassarticle
                          usepackageamsmath
                          usepackagebooktabs
                          usepackagearray

                          begindocument

                          begincenter
                          $beginarray *3>displaystylel
                          toprule
                          multicolumn1ctextDesign & multicolumn2ctextResults \
                          midrule
                          smash[b]xi_3 = beginBmatrix
                          -1 &0 &1 \
                          1/3 &1/3 &1/3 \
                          endBmatrix
                          &M(xi_3)=beginbmatrix
                          3 &0 \
                          0 &2
                          endbmatrix
                          &d(x,xi_3)=1+frac3x^22
                          \ addlinespace
                          &lvert M(xi_3)rvert=6
                          &d(x,xi_3)=2.5
                          \ midrule
                          smash[b]xi_3' = beginBmatrix
                          -1 &1 \
                          1/2 &1/2 \
                          endBmatrix
                          &M(xi_3')=beginbmatrix
                          3 &0 \
                          0 &2
                          endbmatrix
                          &d(x,xi_3')=1+frac3x^22
                          \ addlinespace
                          &lvert M(xi_3')rvert=8
                          &d(x,xi_3')=3
                          \
                          bottomrule
                          endarray$
                          endcenter

                          enddocument


                          enter image description here







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 21 '18 at 22:30









                          egreg

                          709k8618843167




                          709k8618843167



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466915%2fmulicolumn-and-multirow-alignment-and-spacing%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

                              How to check contact read email or not when send email to Individual?

                              Bahrain

                              Postfix configuration issue with fips on centos 7; mailgun relay