Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matrices in LaTeX

  1. Dec 2, 2006 #1

    lo2

    User Avatar

    Hi there I am writing about linear algebra and therefore I need to type matrices. I thought I could do this.

    \newcommand{\metar}[16]{\left [ \begin{array}{cccc} #1 & #2 & #3 & #4 \\ #5 & #6 & #7 & #8 \\ #9 & #10 & #11 & #12 \\ #13 & #14 & #15 & #16 \end{array} \right ] }

    But I get errors and it does not look as desired...

    So please help!
     
  2. jcsd
  3. Dec 2, 2006 #2
    Is this all you were trying to do?

    [tex]
    \left[ \begin{array}{cccc} 1 & 2 & 3 & 4 \\ 5 & 6 & 7 & 8 \\ 9 & 10 & 11 & 12 \\ 13 & 14 & 15 & 16 \end{array} \right]
    [/tex]

    just click on the above and you can see the TeX. You basically had everything there.
     
    Last edited: Dec 2, 2006
  4. Dec 3, 2006 #3
    The amsmath package also gives you 5 matrix environments:
    Code (Text):

    \documentclass[article]{memoir}
    \usepackage{amsmath}
    \begin{document}
    \[
    \begin{pmatrix}
      1 & 2 & 3 & 4\\
      5 & 6 & 7 & 8\\
      9 &10 &11 &12\\
      13&14 &15 &16
    \end{pmatrix}
    \begin{bmatrix}
      1 & 2 & 3 & 4\\
      5 & 6 & 7 & 8\\
      9 &10 &11 &12\\
      13&14 &15 &16
    \end{bmatrix}
    \begin{Bmatrix}
      1 & 2 & 3 & 4\\
      5 & 6 & 7 & 8\\
      9 &10 &11 &12\\
      13&14 &15 &16
    \end{Bmatrix}
    \begin{vmatrix}
      1 & 2 & 3 & 4\\
      5 & 6 & 7 & 8\\
      9 &10 &11 &12\\
      13&14 &15 &16
    \end{vmatrix}
    \begin{Vmatrix}
      1 & 2 & 3 & 4\\
      5 & 6 & 7 & 8\\
      9 &10 &11 &12\\
      13&14 &15 &16
    \end{Vmatrix}
    \]
    \end{document}
     
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Matrices in LaTeX
  1. Matrices in Latex (Replies: 9)

  2. Graphs in LaTeX (Replies: 3)

  3. LaTeX in PowerPoint (Replies: 2)

  4. Latex Help (Replies: 9)

  5. LaTeX help (Replies: 2)

Loading...