How to typeset an array











up vote
1
down vote

favorite












I would like to produce the following:



enter image description here



what is the error?



documentclass{article}
usepackage{tikz}
usepackage{float}
usepackage{amsmath}
usepackage{copyrightbox}
begin{document}
[
begin{array}
0.5 & -1 & -0.5
end{array}
]

end{document}









share|improve this question




























    up vote
    1
    down vote

    favorite












    I would like to produce the following:



    enter image description here



    what is the error?



    documentclass{article}
    usepackage{tikz}
    usepackage{float}
    usepackage{amsmath}
    usepackage{copyrightbox}
    begin{document}
    [
    begin{array}
    0.5 & -1 & -0.5
    end{array}
    ]

    end{document}









    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I would like to produce the following:



      enter image description here



      what is the error?



      documentclass{article}
      usepackage{tikz}
      usepackage{float}
      usepackage{amsmath}
      usepackage{copyrightbox}
      begin{document}
      [
      begin{array}
      0.5 & -1 & -0.5
      end{array}
      ]

      end{document}









      share|improve this question















      I would like to produce the following:



      enter image description here



      what is the error?



      documentclass{article}
      usepackage{tikz}
      usepackage{float}
      usepackage{amsmath}
      usepackage{copyrightbox}
      begin{document}
      [
      begin{array}
      0.5 & -1 & -0.5
      end{array}
      ]

      end{document}






      math-mode errors amsmath arrays






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 30 mins ago









      Alan Munn

      157k27421695




      157k27421695










      asked 2 hours ago









      hubman

      1915




      1915






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          since you use the amsmath package, why you not use bmatrix environment?



          using array you need to specify columns (see second equation below)



          documentclass{article}
          usepackage{tikz}
          usepackage{float}
          usepackage{amsmath}
          usepackage{copyrightbox}
          begin{document}
          [
          mathbf{W} = begin{bmatrix}
          0.5 & -1 & -0.5
          end{bmatrix}
          qquad b=0.5
          ]
          or
          [
          mathbf{W} = [begin{array}{ccc} % <--- added columns' types
          0.5 & -1 & -0.5
          end{array}]
          qquad b=0.5
          ]
          end{document}


          enter image description here






          share|improve this answer























          • how written b=0.5 in the same line?
            – hubman
            2 hours ago






          • 1




            this was not very clear in your question, now added.
            – Zarko
            2 hours ago











          Your Answer








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

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

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


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462293%2fhow-to-typeset-an-array%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          since you use the amsmath package, why you not use bmatrix environment?



          using array you need to specify columns (see second equation below)



          documentclass{article}
          usepackage{tikz}
          usepackage{float}
          usepackage{amsmath}
          usepackage{copyrightbox}
          begin{document}
          [
          mathbf{W} = begin{bmatrix}
          0.5 & -1 & -0.5
          end{bmatrix}
          qquad b=0.5
          ]
          or
          [
          mathbf{W} = [begin{array}{ccc} % <--- added columns' types
          0.5 & -1 & -0.5
          end{array}]
          qquad b=0.5
          ]
          end{document}


          enter image description here






          share|improve this answer























          • how written b=0.5 in the same line?
            – hubman
            2 hours ago






          • 1




            this was not very clear in your question, now added.
            – Zarko
            2 hours ago















          up vote
          1
          down vote



          accepted










          since you use the amsmath package, why you not use bmatrix environment?



          using array you need to specify columns (see second equation below)



          documentclass{article}
          usepackage{tikz}
          usepackage{float}
          usepackage{amsmath}
          usepackage{copyrightbox}
          begin{document}
          [
          mathbf{W} = begin{bmatrix}
          0.5 & -1 & -0.5
          end{bmatrix}
          qquad b=0.5
          ]
          or
          [
          mathbf{W} = [begin{array}{ccc} % <--- added columns' types
          0.5 & -1 & -0.5
          end{array}]
          qquad b=0.5
          ]
          end{document}


          enter image description here






          share|improve this answer























          • how written b=0.5 in the same line?
            – hubman
            2 hours ago






          • 1




            this was not very clear in your question, now added.
            – Zarko
            2 hours ago













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          since you use the amsmath package, why you not use bmatrix environment?



          using array you need to specify columns (see second equation below)



          documentclass{article}
          usepackage{tikz}
          usepackage{float}
          usepackage{amsmath}
          usepackage{copyrightbox}
          begin{document}
          [
          mathbf{W} = begin{bmatrix}
          0.5 & -1 & -0.5
          end{bmatrix}
          qquad b=0.5
          ]
          or
          [
          mathbf{W} = [begin{array}{ccc} % <--- added columns' types
          0.5 & -1 & -0.5
          end{array}]
          qquad b=0.5
          ]
          end{document}


          enter image description here






          share|improve this answer














          since you use the amsmath package, why you not use bmatrix environment?



          using array you need to specify columns (see second equation below)



          documentclass{article}
          usepackage{tikz}
          usepackage{float}
          usepackage{amsmath}
          usepackage{copyrightbox}
          begin{document}
          [
          mathbf{W} = begin{bmatrix}
          0.5 & -1 & -0.5
          end{bmatrix}
          qquad b=0.5
          ]
          or
          [
          mathbf{W} = [begin{array}{ccc} % <--- added columns' types
          0.5 & -1 & -0.5
          end{array}]
          qquad b=0.5
          ]
          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 hours ago

























          answered 2 hours ago









          Zarko

          117k865155




          117k865155












          • how written b=0.5 in the same line?
            – hubman
            2 hours ago






          • 1




            this was not very clear in your question, now added.
            – Zarko
            2 hours ago


















          • how written b=0.5 in the same line?
            – hubman
            2 hours ago






          • 1




            this was not very clear in your question, now added.
            – Zarko
            2 hours ago
















          how written b=0.5 in the same line?
          – hubman
          2 hours ago




          how written b=0.5 in the same line?
          – hubman
          2 hours ago




          1




          1




          this was not very clear in your question, now added.
          – Zarko
          2 hours ago




          this was not very clear in your question, now added.
          – Zarko
          2 hours ago


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462293%2fhow-to-typeset-an-array%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

          Contact image not getting when fetch all contact list from iPhone by CNContact

          count number of partitions of a set with n elements into k subsets

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks