0

How do I label an array? The label can be anywhere on the right side. I can't find a \label in the array documentation.

Hao S
  • 858
  • 2
    Can you explain what you mean by a "label"? Are you just interested in marking a specific row? Or are you truly talking about a \label so you can \reference it later? – Werner Oct 06 '20 at 23:57
  • I mean in the way you label an equation – Hao S Oct 07 '20 at 00:00
  • Is the array in question associated with a counter variable? – Mico Oct 07 '20 at 00:18
  • 3
    How about \begin{equation} \left[\begin{array}{..} ... \end{array}\right] \end{equation}? – Werner Oct 07 '20 at 00:19
  • May this help you? https://tex.stackexchange.com/questions/30791/array-with-labeling-columns – scd Oct 07 '20 at 08:46

1 Answers1

2

It is not clear, what you like to have. I guess, that you looking for something like this:

enter image description here

Using @Werner comment for staring point, the MWE for above array is:

\documentclass{article}
\usepackage{amsmath}  % for "eqref"

\begin{document} \begin{equation}\label{eq:array} \begin{array}{ccc} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \end{array} \end{equation} See array \eqref{eq:array} ... \end{document}

in the case, that your array present an matrix, then you could use bmatrix from the amsmath package:

\documentclass{article}
\usepackage{amsmath}  % for "bmatrix" and "eqref"

\begin{document} \begin{equation}\label{eq:array} \begin{bmatrix} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \end{bmatrix} \end{equation} See array \eqref{eq:array} ... \end{document}

enter image description here

Zarko
  • 296,517