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.

5
  • 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 6 '20 at 23:57
  • I mean in the way you label an equation – Hao S Oct 7 '20 at 0:00
  • Is the array in question associated with a counter variable? – Mico Oct 7 '20 at 0:18
  • 3
    How about \begin{equation} \left[\begin{array}{..} ... \end{array}\right] \end{equation}? – Werner Oct 7 '20 at 0:19
  • May this help you? tex.stackexchange.com/questions/30791/… – scd Oct 7 '20 at 8:46
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.