5

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

12

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.

  • is there an option to change the color of the links? right now they are coming as light green. – ankhi Aug 13 '14 at 8:57
  • 1
    @ankhi - Your follow-up question is really about hyperref rather than about cleveref. If you want to change the color of all link types to, say, blue, you could do so by specifying the option allcolors=blue. Please study the hyperref manual for the full details; there are lots and lots of possibilities. – Mico Aug 13 '14 at 9:09
3

You can define those terms by yourself:

\crefname{equation}{equation}{equations}
\Crefname{equation}{Equation}{Equations}
\crefname{table}{table}{tables}
\Crefname{table}{Table}{Tables}

\crefname{figure}{figure}{figures}
\Crefname{figure}{Figure}{Figures}

To get Table 1 etc, you have to use \Cref instead of \cref.

\documentclass[12pt,a4paper,fleqn]{book}
%
\usepackage{amsmath,amssymb}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{cleveref}
\crefname{equation}{equation}{equations}
\Crefname{equation}{Equation}{Equations}
\crefname{table}{table}{tables}
\Crefname{table}{Table}{Tables}

\crefname{figure}{figure}{figures}
\Crefname{figure}{Figure}{Figures}

\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{tabularx}{\textwidth}{llX}
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{tabularx}%

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

\cref{esrg} \Cref{esrg}

\cref{eq1} \Cref{eq1}


\end{document}

enter image description here

I have also changed tabular to tabularx and made third column X type so that text wraps there.

  • 2
    While it's certainly possible to change the output of \cref by executing some low-level commands, I think it's far more convenient to do so by passing options to the cleveref package. – Mico Aug 12 '14 at 12:49

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.