0

How can one make LaTeX insert Figure into \ref calls automatically, i.e. instead of writing:

See data in Figure \ref{fig:JobInformationDialog}

simply write:

See data in \ref{fig:jobInformationDialog}

and have LaTeX insert Figure [fignum] when it gets compiled?

  • Package cleveref might be of interest here. – cjorssen May 13 '14 at 14:51
3

You can use the \autoref command from the hyperref package. If you want to change the Figure part of the reference you

\documentclass{article}
\usepackage{hyperref}

\begin{document}

See data in Figure \ref{fig:JobInformationDialog}

See data in \autoref{fig:JobInformationDialog}

\begin{figure}
    \centering
    \fbox{JobInformationDialog}
    \caption{The Caption}
    \label{fig:JobInformationDialog}
\end{figure}

\end{document}

If you want to change the Figure part of the reference you can redefine \figureautorefname

\renewcommand{\figureautorefname}{Illustration}

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.