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

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

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

Postby jjmm » Thu Jul 19, 2018 5:04 am

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

  1. \documentclass[12pt]{report}
  2. \usepackage{blkarray}
  3. \usepackage{amsmath}
  4.  
  5. \begin{document}
  6.  
  7. \[
  8. \begin{blockarray}{cccccc}
  9. a & b & c & d & e \\
  10. \begin{block}{(ccccc)c}
  11. 1 & 1 & 1 & 1 & 1 & f \\
  12. 0 & 1 & 0 & 0 & 1 & g \\
  13. 0 & 0 & 1 & 0 & 1 & h \\
  14. 0 & 0 & 0 & 1 & 1 & i \\
  15. 0 & 0 & 0 & 0 & 1 & j \\
  16. \end{block}
  17. \end{blockarray}
  18. \]
  19.  
  20. \end{document}

User avatar
Johannes_B
Site Moderator
Posts: 3854
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Jul 19, 2018 7:35 am

You chose an unnumbered math environment. Simply use a numbered one.
  1. \documentclass[12pt]{report}
  2. \usepackage{blkarray}
  3. \usepackage{amsmath}
  4.  
  5. \begin{document}
  6.  
  7. \begin{equation}
  8. \begin{blockarray}{cccccc}
  9. a & b & c & d & e \\
  10. \begin{block}{(ccccc)c}
  11. 1 & 1 & 1 & 1 & 1 & f \\
  12. 0 & 1 & 0 & 0 & 1 & g \\
  13. 0 & 0 & 1 & 0 & 1 & h \\
  14. 0 & 0 & 0 & 1 & 1 & i \\
  15. 0 & 0 & 0 & 0 & 1 & j \\
  16. \end{block}
  17. \end{blockarray}
  18. \label{matrix}
  19. \end{equation}
  20.  
  21. look at \ref{matrix}
  22. \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: 11
Joined: Tue Jul 12, 2016 5:23 am

Postby jjmm » Thu Jul 19, 2018 9:37 am

Thank you, Johannes! It works!


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 12 guests