Matrices in Latex

  • LaTeX
  • Thread starter ladil123
  • Start date
  • #1
45
0

Main Question or Discussion Point

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
 

Answers and Replies

  • #2
Hootenanny
Staff Emeritus
Science Advisor
Gold Member
9,622
6
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
Like this,

Code:
\[
 \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"?
 
  • #3
45
0
Yes I mean such as \label{matrix1}

Thanks you!
 
  • #4
Hootenanny
Staff Emeritus
Science Advisor
Gold Member
9,622
6
Yes I mean such as \label{matrix1}

Thanks you!
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}"​
 
  • #5
45
0
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..
 
  • #6
Hootenanny
Staff Emeritus
Science Advisor
Gold Member
9,622
6
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.
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?
 
  • #7
45
0
Yes, kind of.
I have written \label{matrix1} after \end{bmatrix} but it doesnt work, where should I write \label{matrix1} in my code ?
 
  • #8
Hootenanny
Staff Emeritus
Science Advisor
Gold Member
9,622
6
Yes, kind of.
I have written \label{matrix1} after \end{bmatrix} but it doesnt work, where should I write \label{matrix1} in my code ?
Instead of using the \[ delimiters, which correspond to the displaymath environment, you need to use the equation environment:

Code:
\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.
 
  • #9
45
0
Thank you very much!
 
  • #10
7
0
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.
 

Related Threads for: Matrices in Latex

  • Last Post
Replies
2
Views
105K
  • Last Post
Replies
5
Views
1K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
3
Views
4K
  • Last Post
Replies
5
Views
4K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
4
Views
3K
  • Last Post
Replies
2
Views
16K
Top