[Tex/LaTex] Change the output format of \cref from table to Table and from eq. to Equation

cleverefcross-referencinghyperref

if you use \cref then you get references as eq. (1) / table (1) / fig. (1)

but I want it to produce Equation 1 / Table 1 / Figure 1

how to I set this?

I also want to know if it is possible to use cleveref without hyperref … or change the link boxes to elegant underlines …

MWE:

\documentclass[12pt,a4paper,fleqn]{book}
%
\usepackage{amsmath,amssymb}
\usepackage{hyperref}
\usepackage{cleveref}

\title{hfvj}
\author{fgikf}
\date{}

\begin{document}

\begin{equation}
E=mc^2 \label{eq1}
\end{equation}

\begin{table}[htbp]
\scriptsize\addtolength{\tabcolsep}{-2pt}
\centering
\begin{tabular}{lll}
Cube  & CUBEMEMBER & Returns a member or tuple in a cube hierarchy \\
Cube  & CUBEVALUE & Returns an aggregated value from a cube \\
Cube  & CUBESET & Defines a calculated set of members or tuples by sending a set     expression to the cube on the server \\
Cube  & CUBERANKEDMEMBER & Returns the nth, or ranked, member in a set \\
Cube  & CUBEKPIMEMBER & Returns a key performance indicator name, property, and measure, and displays the name and property in the cell. \\
Cube  & CUBEMEMBERPROPERTY & Returns the value of a member property in the cube \\
Cube  & CUBESETCOUNT & Returns the number of items in a set \\
Database & DAVERAGE & Averages the values in a column of a list or database that match conditions you specify \\
\end{tabular}%

\caption{rsghs}\label{esrg}
\end{table} 

\cref{esrg}

\cref{eq1}


\end{document}

\cref format

Best Answer

I think there are four separate aspects to your posting. Three of the four objectives you've stated may be achieved by choosing the appropriate options when loading cleveref.

  • To produce full rather than abbreviated names of cross-referenced items, you could load the cleveref package with the option noabbrev:

    \usepackage[noabbrev]{cleveref}
    

    See also section 6.3 of the user guide of the cleveref package.

  • If you want all names of cross-referenced items to start with an uppercase letter, be sure to specify the option capitalize (capitalise works too) as well :

    \usepackage[noabbrev,capitalize]{cleveref}
    

    See also section 6.1 of the user guide of the cleveref package.

  • One can certainly use cleveref without the hyperref package. (Note that the appearance of hypertargets is governed by options passed to hyperref, regardless of whether or not cleveref is loaded. Load the hyperref package with the option colorlinks=true if you don't want color rectangles around the target but, rather, the hypertarget itself to be rendered in color.) Back to cleveref: be sure to load it after hyperref. And, if you want \cref to make both the name and the number of the cross-referenced object into a hypertarget, just spefify the option nameinlink when laoding cleveref:

    \usepackage[noabbrev,capitalize,nameinlink]{cleveref}
    

    See also section 6.2 of the user guide of the cleveref package.

  • If you want to suppress the automatic insertion of round parentheses around cross-reference equation numbers, i.e., if you prefer Equation 1 over Equation (1), you would need to add the following instruction to the preamble:

    \creflabelformat{equation}{#2\textup{#1}#3}
    

    The default setting is \creflabelformat{equation}{#2\textup{(#1)}#3} -- note the parentheses around #1 in the argument of \textup. Incidentally, you shoudn't be getting parentheses placed around the numbers of figures and tables, unless you've executed some code you haven't given us any information about so far.