Latex: Writing "x" Beside a Matrix

  • Context: LaTeX 
  • Thread starter Thread starter EngWiPy
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary
SUMMARY

The discussion focuses on formatting matrices in LaTeX, specifically how to place labels beside a matrix. Users provided solutions for labeling either the first row or all rows of a matrix using the \texttt{matrix} environment. The proposed solutions include using \texttt{\textbackslash phantom} for spacing and aligning labels correctly. Additionally, participants explored the challenge of labeling columns, indicating that the same approach may not be directly applicable.

PREREQUISITES
  • Understanding of LaTeX syntax and environments
  • Familiarity with the \texttt{pmatrix} and \texttt{matrix} environments
  • Knowledge of LaTeX commands for formatting text, such as \texttt{\textbackslashmathbf} and \texttt{\textbackslashphantom}
  • Basic concepts of matrix notation in mathematics
NEXT STEPS
  • Research advanced LaTeX formatting techniques for matrices
  • Learn about the \texttt{array} environment for more complex matrix layouts
  • Explore LaTeX packages that enhance matrix and equation formatting, such as \texttt{amsmath}
  • Investigate methods for labeling columns in matrices using LaTeX
USEFUL FOR

Mathematicians, researchers, students, and anyone involved in typesetting mathematical documents using LaTeX who seeks to improve their matrix formatting skills.

EngWiPy
Messages
1,361
Reaction score
61
Hi everyone,

I have the following matrix:

\begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Now I need to write beside the matrix like \mathbf{x}^{(1)}= on the first row but from outside the matrix, and so on. How can I do that?

Thanks in advance
 
Physics news on Phys.org
S_David said:
Hi everyone,

I have the following matrix:

\begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Now I need to write beside the matrix like \mathbf{x}^{(1)}= on the first row but from outside the matrix, and so on. How can I do that?

Thanks in advance

Just on the first row?
<br /> \begin{matrix}<br /> \mathbf{x}^{(1)} = \\ \phantom{x} \\ \phantom{x} \\ \phantom{x} <br /> \end{matrix}<br /> <br /> \begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Or every row?


<br /> \begin{matrix}<br /> \mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)}<br /> \end{matrix}<br /> =<br /> \begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />
 
D H said:
Just on the first row?
<br /> \begin{matrix}<br /> \mathbf{x}^{(1)} = \\ \phantom{x} \\ \phantom{x} \\ \phantom{x} <br /> \end{matrix}<br /> <br /> \begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Or every row?


<br /> \begin{matrix}<br /> \mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)}<br /> \end{matrix}<br /> =<br /> \begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Thanks a lot. That is exactly what I wanted. Now I need to do something similar to the columns, and I guess this approach won't work, will it?
 
\begin{matrix} <br /> \mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)} <br /> \end{matrix} <br /> = <br /> \begin{matrix}<br /> \begin{matrix}<br /> \mathbf{x_0\ \ }&amp;\mathbf{x_1\ \ }&amp;\ \cdots &amp;\mathbf{x_{N-1}}\\ <br /> \end{matrix}\\<br /> %<br /> \begin{pmatrix} <br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\ <br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\ <br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\ <br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)} <br /> \end{pmatrix}<br /> \end{matrix}<br />
 
robphy said:
\begin{matrix} <br /> \mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)} <br /> \end{matrix} <br /> = <br /> \begin{matrix}<br /> \begin{matrix}<br /> \mathbf{x_0\ \ }&amp;\mathbf{x_1\ \ }&amp;\ \cdots &amp;\mathbf{x_{N-1}}\\ <br /> \end{matrix}\\<br /> %<br /> \begin{pmatrix} <br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\ <br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\ <br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\ <br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)} <br /> \end{pmatrix}<br /> \end{matrix}<br />

Thanks
 

Similar threads

Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 52 ·
2
Replies
52
Views
4K
  • · Replies 1 ·
Replies
1
Views
10K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K