Possible Duplicate:
Table, Figure, and Listing prefixes
Automatically inserting “Section, Subsection, etc”
I'm using the package hyperref
.
When referencing my figure, I currently use code like
Figure \ref{fig:chorus-overview} gives an overview of the basic concept.
because \ref
will just yield a single integer 1
, as opposed to Figure 1
.
However, the word Figure
is auto-generated for the figure environment caption, so when using a package such as [ngerman]{babel}
, it's Abbildung
instead, and I need to fix the text before my reference.
Is there any way to directly get the Figure 1
text via \ref
or a similar command?
EDIT
Additionally to the steps described in Sveinung's answer (using \autoref from hyperref or \cref from cleveref), I needed to make sure to place the label before the caption in the figure environment, as pointed out by Werner, and to include babel before hyperref/cleveref.
\nameref
does not do what I need, since it copies the text of the caption instead.
babel
options, it is probably not an exact duplicate.