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. Apr 21, 2009 #1
    Hello!

    I know how to do a matrice in latex like this:
    \[
    \begin{bmatrix}
    a & b & c \\
    d & e & f \\
    g & h & i
    \end{bmatrix}
    \]

    How do I write severell matrices on one row like : "matrix_A times another matrix_B = answer "

    And how can I label the matrices so I can refer to them later on ?
    Thanks
     
  2. jcsd
  3. Apr 21, 2009 #2

    Hootenanny

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Like this,

    Code (Text):
    \[
     \begin{bmatrix}
      a & b & c \\
      d & e & f \\
      g & h & i
     \end{bmatrix}
     \begin{bmatrix}
      a & b & c \\
      d & e & f \\
      g & h & i
     \end{bmatrix}
    =
     \begin{bmatrix}
      a & b & c \\
      d & e & f \\
      g & h & i
     \end{bmatrix}
    \]
    With respect to the labelling, do you mean label them by given them a tex label such as \label{matrix1} or simply calling them matrix "A"?
     
  4. Apr 21, 2009 #3
    Yes I mean such as \label{matrix1}

    Thanks you!
     
  5. Apr 21, 2009 #4

    Hootenanny

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    As far as I'm aware, there are no macros available for numbering terms within a single equation.

    The best you could do would be to label the matrices A,B,C using something like \underbrace and then give the equation a label using \label{matrices}. You could then reference the matrices using something of the form:
    "see matrix A in \eqref{matrices}"​
     
  6. Apr 21, 2009 #5
    If I have the three matrices that you wrote, then I want to refer to all three at the same time, not only the first matrix or the second.
    I don´t know how to use \underbrace..
     
  7. Apr 21, 2009 #6

    Hootenanny

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    That's fine then. Simply give the over all equation a label using \label{matrices} and then you can refer to the equation using \eqref{matrices}.

    Does that answer your question?
     
  8. Apr 21, 2009 #7
    Yes, kind of.
    I have written \label{matrix1} after \end{bmatrix} but it doesnt work, where should I write \label{matrix1} in my code ?
     
  9. Apr 21, 2009 #8

    Hootenanny

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Instead of using the \[ delimiters, which correspond to the displaymath environment, you need to use the equation environment:

    Code (Text):
    \begin{equation}
    [COLOR="Red"]equation goes here[/COLOR]
    \label{[COLOR="Red"]equation name goes here[/COLOR]}
    \end{equation}
    This will then give your equation a number, which can be referred to using the \eqref{equation name goes here} command.
     
  10. Apr 21, 2009 #9
    Thank you very much!
     
  11. Jan 17, 2010 #10
    Hello!
    I have matrices in my LaTex document. LaTex automatically gives order number to all equations, but it doesn’t numerate matrices. Could you help me and say how I could automatically numerate matrices as equations. Beforehand thank you.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




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

  2. Graphs in LaTeX (Replies: 3)

  3. LaTeX in PowerPoint (Replies: 2)

  4. Latex Help (Replies: 9)

  5. LaTeX help (Replies: 2)

Loading...