# How do I make sure that \pageref{LastPage} doesn't get colored like the other links identified by hyperref?

I am using hyperref together with lastpage. My problem is that \pageref{LastPage} gets the same color as the links identified with hyperref. I want it to be just the ordinary color (e.g. black)

Allow me to adapt the chosen answer to my previous question about lastpage:

\documentclass{scrartcl}

\usepackage{hyperref}
urlcolor=Maroon,

\usepackage{lastpage}
\usepackage{scrpage2}

\cfoot{\thepage\ of \pageref{LastPage}}

\begin{document}

\href{mailto:my_email@email.com}{my_email@email.com}

\newpage
text
\newpage
text
\end{document}


I tried \usepackage{color} and then modifying the \cfoot... line to \cfoot{\thepage\ of \color{black}\pageref{LastPage}}, but to no avail.

-

Use \pageref* as described in the hyperref manual.

-
(I made the assumption that you also do not want the page number of the last page to be a link.) –  Willie Wong Oct 26 '10 at 15:25

In case you do want the page number of the last page to be a link, you nearly got it: \usepackage{color} (or xcolor) and

\cfoot{\thepage\ of {\hypersetup{linkcolor=black}\pageref{LastPage}}}


\cfoot{\thepage\ of \color{black}\pageref{LastPage}}

Additionally you need to change \href{mailto:my_email@email.com}{my_email@email.com} to \href{mailto:my_email@email.com}{my\_email@email.com} and Maroon needs to be defined as colour.
@Jed: Yes, there seem to have been introduced some changes in the recent version of hyperref. Also _ must be changed into \_ and Maroon is no longer recognized. Thanks for pointing this out! I updated my answer. –  Stephen May 31 '12 at 15:10