Background
Using LyX and KOMA Script to author a technical manual.
Problem
The documents are strewn with the following references:
\ref{fig:Example-Database-Type}
When converted to PDF, this results in "1.1" for the figure number, whereas I would prefer it to read "Figure 1.1". Similarly, for Tables and Listings, they should read "Table 1.1" and "Listing 1.1", respectively.
Code
The caption code is:
\caption{\label{fig:Example-Query-Statement}Example Query Statement}
The reference code is:
\ref{fig:Example-Query-Statement}
The document preamble includes:
\usepackage{hyperref}
The result is: "The screen shot in 1.1 shows ..."
The desired result is: "The screen shot in Figure 1.1 shows ..."
Ideas
Tried:
\let\oldref=\ref
\renewcommand{\ref}[1]{Figure {\oldref{#1}}}
Tried:
\usepackage{fancyref}
\renewcommand{\ref}[1]{\fref{#1}}
Tried:
\usepackage{hyperref}
Question
How do you change the \ref
command to include a \figurename
prefix without having to edit (and thus duplicate) the code for every figure (that already has the \ref
)?
Thank you!