Latex matrix formattingColumn and row padding in tablesSmaller matrices (or other math elements) in displayed...

Latex matrix formatting

Is there a theorem in Real analysis similar to Cauchy's theorem in Complex analysis?

How to ensure that neurotic or annoying characters don't get tiring on the long run

How many people need to succeed in a group check with three people?

Why does an orbit become hyperbolic when total orbital energy is positive?

Why 1.5fill is 0pt

Is there a generally agreed upon solution to Bradley's Infinite Regress without appeal to Paraconsistent Logic?

Exam design: give maximum score per question or not?

Permutations in Disguise

Did slaves have slaves?

Does household ovens ventilate heat to the outdoors?

Where is it? - The Google Earth Challenge Ep. 4

Is it acceptable to use decoupling capacitor ground pad as ground for oscilloscope probe?

Why does dd not make working bootable USB sticks for Microsoft?

Why is the year in this ISO timestamp not 2019?

Output Distinct Factor Cuboids

Floating Point XOR

What does the Free Recovery sign (UK) actually mean?

What is this WWII four-engine plane on skis?

Who are the people reviewing far more papers than they're submitting for review?

Is it better to use mosfet with gate driver IC or mosfet with lower VGs on

Which version of the Pigeonhole principle is correct? One is far stronger than the other

What is a "major country" as named in Bernie Sanders' Healthcare debate answers?

Are lay articles good enough to be the main source of information for PhD research?



Latex matrix formatting


Column and row padding in tablesSmaller matrices (or other math elements) in displayed mathBlock matrix with vectorsLeft aligning equations without align characterToeplitz matrix in LaTeXFormatting a Block MatrixCreating a matrix with column or row vectors as argumentsMultiple Matrix Formattingrepresentation of vector and matrix in latex






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







4















I am trying to create something similar to the below image. I have something but my formatting is a little off. How can I correct the formatting and also add the W1, W2, Wn and D letters on top (not a major issue however)?



enter image description here



documentclass{article}
usepackage{amsmath}
begin{document}

begin{align}
begin{bmatrix}
W_{11} \
W_{12} \
vdots \
W_{1n}
end{bmatrix}
&+ begin{bmatrix}
W_{21} \
W_{22} \
vdots \
W_{2n}
end{bmatrix}
&+ hdots
&+ begin{bmatrix}
W_{n1} \
W_{n2} \
vdots \
W_{nn}
end{bmatrix}
&= begin{bmatrix}
frac{W_{11} + W_{21} + hdots + W_{n1}}{n} \
frac{W_{12} + W_{22} + hdots + W_{n2}}{n} \
vdots \
frac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
end{bmatrix}
end{align}

end{document}









share|improve this question































    4















    I am trying to create something similar to the below image. I have something but my formatting is a little off. How can I correct the formatting and also add the W1, W2, Wn and D letters on top (not a major issue however)?



    enter image description here



    documentclass{article}
    usepackage{amsmath}
    begin{document}

    begin{align}
    begin{bmatrix}
    W_{11} \
    W_{12} \
    vdots \
    W_{1n}
    end{bmatrix}
    &+ begin{bmatrix}
    W_{21} \
    W_{22} \
    vdots \
    W_{2n}
    end{bmatrix}
    &+ hdots
    &+ begin{bmatrix}
    W_{n1} \
    W_{n2} \
    vdots \
    W_{nn}
    end{bmatrix}
    &= begin{bmatrix}
    frac{W_{11} + W_{21} + hdots + W_{n1}}{n} \
    frac{W_{12} + W_{22} + hdots + W_{n2}}{n} \
    vdots \
    frac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
    end{bmatrix}
    end{align}

    end{document}









    share|improve this question



























      4












      4








      4


      0






      I am trying to create something similar to the below image. I have something but my formatting is a little off. How can I correct the formatting and also add the W1, W2, Wn and D letters on top (not a major issue however)?



      enter image description here



      documentclass{article}
      usepackage{amsmath}
      begin{document}

      begin{align}
      begin{bmatrix}
      W_{11} \
      W_{12} \
      vdots \
      W_{1n}
      end{bmatrix}
      &+ begin{bmatrix}
      W_{21} \
      W_{22} \
      vdots \
      W_{2n}
      end{bmatrix}
      &+ hdots
      &+ begin{bmatrix}
      W_{n1} \
      W_{n2} \
      vdots \
      W_{nn}
      end{bmatrix}
      &= begin{bmatrix}
      frac{W_{11} + W_{21} + hdots + W_{n1}}{n} \
      frac{W_{12} + W_{22} + hdots + W_{n2}}{n} \
      vdots \
      frac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
      end{bmatrix}
      end{align}

      end{document}









      share|improve this question














      I am trying to create something similar to the below image. I have something but my formatting is a little off. How can I correct the formatting and also add the W1, W2, Wn and D letters on top (not a major issue however)?



      enter image description here



      documentclass{article}
      usepackage{amsmath}
      begin{document}

      begin{align}
      begin{bmatrix}
      W_{11} \
      W_{12} \
      vdots \
      W_{1n}
      end{bmatrix}
      &+ begin{bmatrix}
      W_{21} \
      W_{22} \
      vdots \
      W_{2n}
      end{bmatrix}
      &+ hdots
      &+ begin{bmatrix}
      W_{n1} \
      W_{n2} \
      vdots \
      W_{nn}
      end{bmatrix}
      &= begin{bmatrix}
      frac{W_{11} + W_{21} + hdots + W_{n1}}{n} \
      frac{W_{12} + W_{22} + hdots + W_{n2}}{n} \
      vdots \
      frac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
      end{bmatrix}
      end{align}

      end{document}






      amsmath matrices vector






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 8 hours ago









      user113156user113156

      1726 bronze badges




      1726 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          4
















          The following sets the arrangement inside an array, with the first row handling the labels on top of each bmatrix, while the second row sets each of the matrices/vectors. arraystretch has been increased to spread the content vertically.



          enter image description here



          documentclass{article}

          usepackage{amsmath}

          begin{document}

          [
          setlength{arraycolsep}{0pt}% No column separation in array; manual spacing
          % by supplying empty groups {} around operators
          renewcommand{arraystretch}{1.5}% Stretch out content vertically
          begin{array}{ *{8}{c} }
          % Header row in scriptstyle
          scriptstyle W_1 & & % +
          scriptstyle W_2 & & % + ... +
          scriptstyle W_n & & & % = 1/n
          scriptstyle D \
          % Matrix/vector row
          begin{bmatrix}
          W_{11} \ W_{12} \ vdots \ W_{1n}
          end{bmatrix}
          & {} + {} &
          begin{bmatrix}
          W_{21} \ W_{22} \ vdots \ W_{2n}
          end{bmatrix}
          & {} + dots + {} &
          begin{bmatrix}
          W_{n1} \ W_{n2} \ vdots \ W_{nn}
          end{bmatrix}
          & {} = {} &
          dfrac{1}{n} &
          begin{bmatrix}
          W_{11} + W_{21} + dots + W_{n1} \
          W_{12} + W_{22} + dots + W_{n2} \
          vdots \
          W_{1n} + W_{2n} + dots + W_{nn}
          end{bmatrix}
          end{array}
          ]

          end{document}


          Since scalar multiplication of a vector results in each component being multiplied by the scalar, some simplification in the presentation makes things line up nicely.






          share|improve this answer





















          • 1





            The math doesn't make sense though...

            – Werner
            8 hours ago











          • Thats awesome! its looks better than what I was expecting. How would I reference this though in a document? The math is from a Natural Language Processing model where we have many documents and train a model to output vectors for each word. Once we have these vectors we average them to obtain a single vector for each document. Some better explanation here: yaronvazana.com/2018/09/20/…

            – user113156
            8 hours ago











          • The usual method for referencing such a structure is to give it an equation number. Instead of using [ ... ], wrap it in an equation environment, with a label{...} inside.

            – barbara beeton
            1 hour ago



















          3
















          A proposition with the mmatrix environment (medium size matrix) from nccmath and cellspace for a proper row spacing:



          documentclass{article}
          usepackage{amsmath, nccmath}

          usepackage[math]{cellspace}
          setlength{cellspacetoplimit}{2pt}
          setlength{cellspacebottomlimit}{2pt}

          newenvironment{bmmatrix}{begin{bmatrix} begin{mmatrix}}{end{mmatrix}end{bmatrix}}
          begin{document}

          begin{alignat}{3}
          begin{matrix}
          W_1 \
          begin{bmmatrix}
          W_{11} \
          W_{12} \[-1.5ex]
          vdots \
          W_{1n}
          end{bmmatrix}
          end{matrix} &+ &
          begin{matrix}
          W_2 \
          begin{bmmatrix}
          W_{21} \
          W_{22} \[-1.5ex]
          vdots \
          W_{2n}
          end{bmmatrix}
          end{matrix}
          &+ hdots{}
          &
          + begin{matrix}
          W_n \
          begin{bmmatrix}
          W_{n1} \
          W_{n2} \[-1.5ex]
          vdots \
          W_{nn}
          end{bmmatrix}
          end{matrix}
          &=
          begin{matrix}
          D \
          begin{bmatrix}
          mfrac{W_{11} + W_{21} + hdots + W_{n1}}{n} \[-1ex]
          smash[b]{ vdots }\[-0.5ex]
          mfrac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
          end{bmatrix}
          end{matrix}
          end{alignat}

          end{document}


          enter image description here






          share|improve this answer






























            Your Answer








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

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

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            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/4.0/"u003ecc by-sa 4.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%2f508418%2flatex-matrix-formatting%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









            4
















            The following sets the arrangement inside an array, with the first row handling the labels on top of each bmatrix, while the second row sets each of the matrices/vectors. arraystretch has been increased to spread the content vertically.



            enter image description here



            documentclass{article}

            usepackage{amsmath}

            begin{document}

            [
            setlength{arraycolsep}{0pt}% No column separation in array; manual spacing
            % by supplying empty groups {} around operators
            renewcommand{arraystretch}{1.5}% Stretch out content vertically
            begin{array}{ *{8}{c} }
            % Header row in scriptstyle
            scriptstyle W_1 & & % +
            scriptstyle W_2 & & % + ... +
            scriptstyle W_n & & & % = 1/n
            scriptstyle D \
            % Matrix/vector row
            begin{bmatrix}
            W_{11} \ W_{12} \ vdots \ W_{1n}
            end{bmatrix}
            & {} + {} &
            begin{bmatrix}
            W_{21} \ W_{22} \ vdots \ W_{2n}
            end{bmatrix}
            & {} + dots + {} &
            begin{bmatrix}
            W_{n1} \ W_{n2} \ vdots \ W_{nn}
            end{bmatrix}
            & {} = {} &
            dfrac{1}{n} &
            begin{bmatrix}
            W_{11} + W_{21} + dots + W_{n1} \
            W_{12} + W_{22} + dots + W_{n2} \
            vdots \
            W_{1n} + W_{2n} + dots + W_{nn}
            end{bmatrix}
            end{array}
            ]

            end{document}


            Since scalar multiplication of a vector results in each component being multiplied by the scalar, some simplification in the presentation makes things line up nicely.






            share|improve this answer





















            • 1





              The math doesn't make sense though...

              – Werner
              8 hours ago











            • Thats awesome! its looks better than what I was expecting. How would I reference this though in a document? The math is from a Natural Language Processing model where we have many documents and train a model to output vectors for each word. Once we have these vectors we average them to obtain a single vector for each document. Some better explanation here: yaronvazana.com/2018/09/20/…

              – user113156
              8 hours ago











            • The usual method for referencing such a structure is to give it an equation number. Instead of using [ ... ], wrap it in an equation environment, with a label{...} inside.

              – barbara beeton
              1 hour ago
















            4
















            The following sets the arrangement inside an array, with the first row handling the labels on top of each bmatrix, while the second row sets each of the matrices/vectors. arraystretch has been increased to spread the content vertically.



            enter image description here



            documentclass{article}

            usepackage{amsmath}

            begin{document}

            [
            setlength{arraycolsep}{0pt}% No column separation in array; manual spacing
            % by supplying empty groups {} around operators
            renewcommand{arraystretch}{1.5}% Stretch out content vertically
            begin{array}{ *{8}{c} }
            % Header row in scriptstyle
            scriptstyle W_1 & & % +
            scriptstyle W_2 & & % + ... +
            scriptstyle W_n & & & % = 1/n
            scriptstyle D \
            % Matrix/vector row
            begin{bmatrix}
            W_{11} \ W_{12} \ vdots \ W_{1n}
            end{bmatrix}
            & {} + {} &
            begin{bmatrix}
            W_{21} \ W_{22} \ vdots \ W_{2n}
            end{bmatrix}
            & {} + dots + {} &
            begin{bmatrix}
            W_{n1} \ W_{n2} \ vdots \ W_{nn}
            end{bmatrix}
            & {} = {} &
            dfrac{1}{n} &
            begin{bmatrix}
            W_{11} + W_{21} + dots + W_{n1} \
            W_{12} + W_{22} + dots + W_{n2} \
            vdots \
            W_{1n} + W_{2n} + dots + W_{nn}
            end{bmatrix}
            end{array}
            ]

            end{document}


            Since scalar multiplication of a vector results in each component being multiplied by the scalar, some simplification in the presentation makes things line up nicely.






            share|improve this answer





















            • 1





              The math doesn't make sense though...

              – Werner
              8 hours ago











            • Thats awesome! its looks better than what I was expecting. How would I reference this though in a document? The math is from a Natural Language Processing model where we have many documents and train a model to output vectors for each word. Once we have these vectors we average them to obtain a single vector for each document. Some better explanation here: yaronvazana.com/2018/09/20/…

              – user113156
              8 hours ago











            • The usual method for referencing such a structure is to give it an equation number. Instead of using [ ... ], wrap it in an equation environment, with a label{...} inside.

              – barbara beeton
              1 hour ago














            4














            4










            4









            The following sets the arrangement inside an array, with the first row handling the labels on top of each bmatrix, while the second row sets each of the matrices/vectors. arraystretch has been increased to spread the content vertically.



            enter image description here



            documentclass{article}

            usepackage{amsmath}

            begin{document}

            [
            setlength{arraycolsep}{0pt}% No column separation in array; manual spacing
            % by supplying empty groups {} around operators
            renewcommand{arraystretch}{1.5}% Stretch out content vertically
            begin{array}{ *{8}{c} }
            % Header row in scriptstyle
            scriptstyle W_1 & & % +
            scriptstyle W_2 & & % + ... +
            scriptstyle W_n & & & % = 1/n
            scriptstyle D \
            % Matrix/vector row
            begin{bmatrix}
            W_{11} \ W_{12} \ vdots \ W_{1n}
            end{bmatrix}
            & {} + {} &
            begin{bmatrix}
            W_{21} \ W_{22} \ vdots \ W_{2n}
            end{bmatrix}
            & {} + dots + {} &
            begin{bmatrix}
            W_{n1} \ W_{n2} \ vdots \ W_{nn}
            end{bmatrix}
            & {} = {} &
            dfrac{1}{n} &
            begin{bmatrix}
            W_{11} + W_{21} + dots + W_{n1} \
            W_{12} + W_{22} + dots + W_{n2} \
            vdots \
            W_{1n} + W_{2n} + dots + W_{nn}
            end{bmatrix}
            end{array}
            ]

            end{document}


            Since scalar multiplication of a vector results in each component being multiplied by the scalar, some simplification in the presentation makes things line up nicely.






            share|improve this answer













            The following sets the arrangement inside an array, with the first row handling the labels on top of each bmatrix, while the second row sets each of the matrices/vectors. arraystretch has been increased to spread the content vertically.



            enter image description here



            documentclass{article}

            usepackage{amsmath}

            begin{document}

            [
            setlength{arraycolsep}{0pt}% No column separation in array; manual spacing
            % by supplying empty groups {} around operators
            renewcommand{arraystretch}{1.5}% Stretch out content vertically
            begin{array}{ *{8}{c} }
            % Header row in scriptstyle
            scriptstyle W_1 & & % +
            scriptstyle W_2 & & % + ... +
            scriptstyle W_n & & & % = 1/n
            scriptstyle D \
            % Matrix/vector row
            begin{bmatrix}
            W_{11} \ W_{12} \ vdots \ W_{1n}
            end{bmatrix}
            & {} + {} &
            begin{bmatrix}
            W_{21} \ W_{22} \ vdots \ W_{2n}
            end{bmatrix}
            & {} + dots + {} &
            begin{bmatrix}
            W_{n1} \ W_{n2} \ vdots \ W_{nn}
            end{bmatrix}
            & {} = {} &
            dfrac{1}{n} &
            begin{bmatrix}
            W_{11} + W_{21} + dots + W_{n1} \
            W_{12} + W_{22} + dots + W_{n2} \
            vdots \
            W_{1n} + W_{2n} + dots + W_{nn}
            end{bmatrix}
            end{array}
            ]

            end{document}


            Since scalar multiplication of a vector results in each component being multiplied by the scalar, some simplification in the presentation makes things line up nicely.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 8 hours ago









            WernerWerner

            463k77 gold badges1039 silver badges1787 bronze badges




            463k77 gold badges1039 silver badges1787 bronze badges











            • 1





              The math doesn't make sense though...

              – Werner
              8 hours ago











            • Thats awesome! its looks better than what I was expecting. How would I reference this though in a document? The math is from a Natural Language Processing model where we have many documents and train a model to output vectors for each word. Once we have these vectors we average them to obtain a single vector for each document. Some better explanation here: yaronvazana.com/2018/09/20/…

              – user113156
              8 hours ago











            • The usual method for referencing such a structure is to give it an equation number. Instead of using [ ... ], wrap it in an equation environment, with a label{...} inside.

              – barbara beeton
              1 hour ago














            • 1





              The math doesn't make sense though...

              – Werner
              8 hours ago











            • Thats awesome! its looks better than what I was expecting. How would I reference this though in a document? The math is from a Natural Language Processing model where we have many documents and train a model to output vectors for each word. Once we have these vectors we average them to obtain a single vector for each document. Some better explanation here: yaronvazana.com/2018/09/20/…

              – user113156
              8 hours ago











            • The usual method for referencing such a structure is to give it an equation number. Instead of using [ ... ], wrap it in an equation environment, with a label{...} inside.

              – barbara beeton
              1 hour ago








            1




            1





            The math doesn't make sense though...

            – Werner
            8 hours ago





            The math doesn't make sense though...

            – Werner
            8 hours ago













            Thats awesome! its looks better than what I was expecting. How would I reference this though in a document? The math is from a Natural Language Processing model where we have many documents and train a model to output vectors for each word. Once we have these vectors we average them to obtain a single vector for each document. Some better explanation here: yaronvazana.com/2018/09/20/…

            – user113156
            8 hours ago





            Thats awesome! its looks better than what I was expecting. How would I reference this though in a document? The math is from a Natural Language Processing model where we have many documents and train a model to output vectors for each word. Once we have these vectors we average them to obtain a single vector for each document. Some better explanation here: yaronvazana.com/2018/09/20/…

            – user113156
            8 hours ago













            The usual method for referencing such a structure is to give it an equation number. Instead of using [ ... ], wrap it in an equation environment, with a label{...} inside.

            – barbara beeton
            1 hour ago





            The usual method for referencing such a structure is to give it an equation number. Instead of using [ ... ], wrap it in an equation environment, with a label{...} inside.

            – barbara beeton
            1 hour ago













            3
















            A proposition with the mmatrix environment (medium size matrix) from nccmath and cellspace for a proper row spacing:



            documentclass{article}
            usepackage{amsmath, nccmath}

            usepackage[math]{cellspace}
            setlength{cellspacetoplimit}{2pt}
            setlength{cellspacebottomlimit}{2pt}

            newenvironment{bmmatrix}{begin{bmatrix} begin{mmatrix}}{end{mmatrix}end{bmatrix}}
            begin{document}

            begin{alignat}{3}
            begin{matrix}
            W_1 \
            begin{bmmatrix}
            W_{11} \
            W_{12} \[-1.5ex]
            vdots \
            W_{1n}
            end{bmmatrix}
            end{matrix} &+ &
            begin{matrix}
            W_2 \
            begin{bmmatrix}
            W_{21} \
            W_{22} \[-1.5ex]
            vdots \
            W_{2n}
            end{bmmatrix}
            end{matrix}
            &+ hdots{}
            &
            + begin{matrix}
            W_n \
            begin{bmmatrix}
            W_{n1} \
            W_{n2} \[-1.5ex]
            vdots \
            W_{nn}
            end{bmmatrix}
            end{matrix}
            &=
            begin{matrix}
            D \
            begin{bmatrix}
            mfrac{W_{11} + W_{21} + hdots + W_{n1}}{n} \[-1ex]
            smash[b]{ vdots }\[-0.5ex]
            mfrac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
            end{bmatrix}
            end{matrix}
            end{alignat}

            end{document}


            enter image description here






            share|improve this answer
































              3
















              A proposition with the mmatrix environment (medium size matrix) from nccmath and cellspace for a proper row spacing:



              documentclass{article}
              usepackage{amsmath, nccmath}

              usepackage[math]{cellspace}
              setlength{cellspacetoplimit}{2pt}
              setlength{cellspacebottomlimit}{2pt}

              newenvironment{bmmatrix}{begin{bmatrix} begin{mmatrix}}{end{mmatrix}end{bmatrix}}
              begin{document}

              begin{alignat}{3}
              begin{matrix}
              W_1 \
              begin{bmmatrix}
              W_{11} \
              W_{12} \[-1.5ex]
              vdots \
              W_{1n}
              end{bmmatrix}
              end{matrix} &+ &
              begin{matrix}
              W_2 \
              begin{bmmatrix}
              W_{21} \
              W_{22} \[-1.5ex]
              vdots \
              W_{2n}
              end{bmmatrix}
              end{matrix}
              &+ hdots{}
              &
              + begin{matrix}
              W_n \
              begin{bmmatrix}
              W_{n1} \
              W_{n2} \[-1.5ex]
              vdots \
              W_{nn}
              end{bmmatrix}
              end{matrix}
              &=
              begin{matrix}
              D \
              begin{bmatrix}
              mfrac{W_{11} + W_{21} + hdots + W_{n1}}{n} \[-1ex]
              smash[b]{ vdots }\[-0.5ex]
              mfrac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
              end{bmatrix}
              end{matrix}
              end{alignat}

              end{document}


              enter image description here






              share|improve this answer






























                3














                3










                3









                A proposition with the mmatrix environment (medium size matrix) from nccmath and cellspace for a proper row spacing:



                documentclass{article}
                usepackage{amsmath, nccmath}

                usepackage[math]{cellspace}
                setlength{cellspacetoplimit}{2pt}
                setlength{cellspacebottomlimit}{2pt}

                newenvironment{bmmatrix}{begin{bmatrix} begin{mmatrix}}{end{mmatrix}end{bmatrix}}
                begin{document}

                begin{alignat}{3}
                begin{matrix}
                W_1 \
                begin{bmmatrix}
                W_{11} \
                W_{12} \[-1.5ex]
                vdots \
                W_{1n}
                end{bmmatrix}
                end{matrix} &+ &
                begin{matrix}
                W_2 \
                begin{bmmatrix}
                W_{21} \
                W_{22} \[-1.5ex]
                vdots \
                W_{2n}
                end{bmmatrix}
                end{matrix}
                &+ hdots{}
                &
                + begin{matrix}
                W_n \
                begin{bmmatrix}
                W_{n1} \
                W_{n2} \[-1.5ex]
                vdots \
                W_{nn}
                end{bmmatrix}
                end{matrix}
                &=
                begin{matrix}
                D \
                begin{bmatrix}
                mfrac{W_{11} + W_{21} + hdots + W_{n1}}{n} \[-1ex]
                smash[b]{ vdots }\[-0.5ex]
                mfrac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
                end{bmatrix}
                end{matrix}
                end{alignat}

                end{document}


                enter image description here






                share|improve this answer















                A proposition with the mmatrix environment (medium size matrix) from nccmath and cellspace for a proper row spacing:



                documentclass{article}
                usepackage{amsmath, nccmath}

                usepackage[math]{cellspace}
                setlength{cellspacetoplimit}{2pt}
                setlength{cellspacebottomlimit}{2pt}

                newenvironment{bmmatrix}{begin{bmatrix} begin{mmatrix}}{end{mmatrix}end{bmatrix}}
                begin{document}

                begin{alignat}{3}
                begin{matrix}
                W_1 \
                begin{bmmatrix}
                W_{11} \
                W_{12} \[-1.5ex]
                vdots \
                W_{1n}
                end{bmmatrix}
                end{matrix} &+ &
                begin{matrix}
                W_2 \
                begin{bmmatrix}
                W_{21} \
                W_{22} \[-1.5ex]
                vdots \
                W_{2n}
                end{bmmatrix}
                end{matrix}
                &+ hdots{}
                &
                + begin{matrix}
                W_n \
                begin{bmmatrix}
                W_{n1} \
                W_{n2} \[-1.5ex]
                vdots \
                W_{nn}
                end{bmmatrix}
                end{matrix}
                &=
                begin{matrix}
                D \
                begin{bmatrix}
                mfrac{W_{11} + W_{21} + hdots + W_{n1}}{n} \[-1ex]
                smash[b]{ vdots }\[-0.5ex]
                mfrac{W_{1n} + W_{2n} + hdots + W_{nn}}{n}
                end{bmatrix}
                end{matrix}
                end{alignat}

                end{document}


                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 5 hours ago

























                answered 7 hours ago









                BernardBernard

                191k8 gold badges86 silver badges226 bronze badges




                191k8 gold badges86 silver badges226 bronze badges


































                    draft saved

                    draft discarded



















































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


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

                    But avoid



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

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


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




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f508418%2flatex-matrix-formatting%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

                    Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

                    The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

                    Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...