## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ How can we number a matrix with row/column names? Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
jjmm
Posts: 13
Joined: Tue Jul 12, 2016 5:23 am

### How can we number a matrix with row/column names?

Hi,

We know how to label a matrix and reference it. It is done by \label and \ref. Could we label a matrix with a label and reference it likewise?

This matrix with a label is from here

https://tex.stackexchange.com/questions ... characters

\documentclass[12pt]{report}\usepackage{blkarray}\usepackage{amsmath} \begin{document} $\begin{blockarray}{cccccc}a & b & c & d & e \\\begin{block}{(ccccc)c} 1 & 1 & 1 & 1 & 1 & f \\ 0 & 1 & 0 & 0 & 1 & g \\ 0 & 0 & 1 & 0 & 1 & h \\ 0 & 0 & 0 & 1 & 1 & i \\ 0 & 0 & 0 & 0 & 1 & j \\\end{block}\end{blockarray}$ \end{document}

Johannes_B
Site Moderator
Posts: 4029
Joined: Thu Nov 01, 2012 4:08 pm
You chose an unnumbered math environment. Simply use a numbered one.
\documentclass[12pt]{report}    \usepackage{blkarray}    \usepackage{amsmath}     \begin{document}      \begin{equation}    \begin{blockarray}{cccccc}    a & b & c & d & e \\    \begin{block}{(ccccc)c}      1 & 1 & 1 & 1 & 1 & f \\      0 & 1 & 0 & 0 & 1 & g \\      0 & 0 & 1 & 0 & 1 & h \\      0 & 0 & 0 & 1 & 1 & i \\      0 & 0 & 0 & 0 & 1 & j \\    \end{block}    \end{blockarray}\label{matrix}     \end{equation} look at \ref{matrix}    \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

jjmm
Posts: 13
Joined: Tue Jul 12, 2016 5:23 am
Thank you, Johannes! It works!