# How does one extract specific attributes of a label e.g. just the section number?

I'm using hyperref and calling \autoref to refer to tables, sections, chapters, etc.. However, sometimes I just want to refer to the section number of a table (e.g. 7.2 as opposed to Table 7.2).

How do we do this?

More generally, how do we extract the (5?) attributes of a label. I know \pageref gets the page, but what about the others?

Also, some commands are issued in .aux like:

\@writefile{lot}{\contentsline
{figure}{\numberline
{5.2}{\ignorespaces Galois
Correspondence}}{20}{figure.5.2}}


How does extract, say, the 2.2nd attribute ({\ignorespaces Galois Correspondence})?

-
In addition to @lockstep's answer, plain LaTeX also has the \pageref command. –  Marc van Dongen Mar 21 '13 at 9:34

Use the \ref command (core LaTeX) and the \nameref command (provided by the nameref package, which is loaded by hyperref).

\documentclass{article}

\usepackage{hyperref}

\begin{document}

\begin{table}
\centering
(Table content)
\caption{foo}
\label{tab:foo}
\end{table}

This is a reference to \autoref{tab:foo}.

One could also refer to the number \ref{tab:foo} or to the name \nameref{tab:foo}.

\end{document}

-
Thanks lockstep, that answers an important part of my question. I have found the package "cleveref" (yes there's no double ‘r’), which sort of does some of the other things I was asking about (e.g. it is able to spit out the type of section which has been labelled — chapter, section, table, etc.). The question about the contents line thing still remains. –  R17 May 13 '11 at 3:08