Writing Matrices on One Row & Labeling - LaTeX

In summary: Yes, you can numerate matrices using \eqref{matrices} commands. For example, you could use the following:\eqref{matrices}{1}This will use the 1st matrix in the equation as the numeration.
  • #1
ladil123
45
0
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
 
Physics news on Phys.org
  • #2
ladil123 said:
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
Yes I mean such as \label{matrix1}

Thanks you!
 
  • #4
ladil123 said:
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
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
ladil123 said:
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
Yes, kind of.
I have written \label{matrix1} after \end{bmatrix} but it doesn't work, where should I write \label{matrix1} in my code ?
 
  • #8
ladil123 said:
Yes, kind of.
I have written \label{matrix1} after \end{bmatrix} but it doesn't 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
Thank you very much!
 
  • #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.
 

1. How do I write a matrix on one row in LaTeX?

To write a matrix on one row in LaTeX, you can use the \matrix command followed by the matrix elements within curly braces. For example, \matrix{1 & 2 & 3} will create a matrix with the elements 1, 2, and 3 on one row.

2. How do I label a matrix in LaTeX?

To label a matrix in LaTeX, you can use the \label command followed by a unique identifier within the \matrix command. For example, \matrix[label=matrix1]{1 & 2 & 3} will label the matrix as "matrix1".

3. Can I add a caption to a matrix in LaTeX?

Yes, you can add a caption to a matrix in LaTeX by using the \caption command within the \matrix command. For example, \matrix[caption=A matrix]{1 & 2 & 3} will add the caption "A matrix" to the matrix.

4. How do I reference a labeled matrix in my document?

To reference a labeled matrix in your document, you can use the \ref command followed by the unique identifier used in the \label command. For example, \ref{matrix1} will reference the matrix labeled as "matrix1" in your document.

5. Can I write a matrix with multiple rows in LaTeX?

Yes, you can write a matrix with multiple rows in LaTeX by using the \matrix command and separating each row with a double backslash (\). For example, \matrix{1 & 2 & 3 \\ 4 & 5 & 6} will create a matrix with two rows and three columns.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
937
Replies
8
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
1K
Replies
22
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Precalculus Mathematics Homework Help
Replies
19
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
983
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Back
Top