Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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})?

share|improve this question
    
In addition to @lockstep's answer, plain LaTeX also has the \pageref command. –  Marc van Dongen Mar 21 '13 at 9:34
add comment

1 Answer 1

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}
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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