# How to get \ref to automatically output Table, Appendix etc.? [duplicate]

When I use \ref my output is just the number of the table or letter of the appendix. So for example in my MWE below when I enter See \ref{Test1} my output is See 1.1 and for See \ref{AppendixA} output is See A.

Is there a way to have the output to be See Table 1.1 and See Appendix A?

\documentclass[11pt, a4paper, oneside, oldfontcommands]{memoir}
\usepackage{lipsum} % just for dummy text

\begin{document}
\chapter{This is a test chapter}

\begin{table}[h]
\centering
\begin{tabular}{ll}
Test & Table \\
1    & 2     \\
3    &
\end{tabular}
\caption{Test Table}
\label{Test1}
\end{table}

\appendix
\chapter{This is a test Appendix} % Main appendix title
\label{AppendixA} % For referencing this appendix elsewhere, use \ref{AppendixA}
\lipsum[1]
\end{document}


## marked as duplicate by Werner, lockstep, Andrew, Henri Menke, Maarten DhondtJun 16 '15 at 20:44

There are several packages which can achieve this, cleveref seems to be the most advanced and most customizable one.

At least if the chapter in their documentation fits:

Given how useful automated cross-reference typesetting is, there are naturally a number of other LaTeX packages with similar goals to cleveref, most notably varioref, fancyref, hyperref’s \autoref command, and (for theorem-like environments) ntheorem with the thref option. (There are many others, but these come closest to providing similar features to cleveref.) However, all have certain deficiencies which cleveref attempts to overcome.

If you want to use cleveref for the start just replace your \ref commands with \cref.

Important note: cleveref should be the last package you load, even after hyperref

\documentclass[11pt, a4paper, oneside, oldfontcommands]{memoir}
\usepackage{lipsum} % just for dummy text

%% All you packages here

\usepackage{hyperref}
\usepackage{cleveref}

\begin{document}
\chapter{This is a test chapter}

\begin{table}[h]
\centering
\begin{tabular}{ll}
Test & Table \\
1    & 2     \\
3    &
\end{tabular}
\caption{Test Table}
\label{Test1}
\end{table}