[Tex/LaTex] Distinguish \nameref references in print version

formattinghyperreflinks

I used the \nameref command to reference to names of captions etc.
I also used the option colorlinks=true so I have colored references which can be distinguished form "normal" text.

In my print version of the document I colored the links to black.
Now I'd like to set them to italic or surround them with apostrophes or something like that.

I already tried to renew the \nameref command, but I didn't get it to work

\renewcommand{\nameref}{\emph{\nameref{#1}}}

I allways get an error message, which says

LaTeX Error: \namref undefined.

Any ideas?

Best Answer

Option hidelinks is available since hyperref 2011/02/05 v6.82a. \nameref can be redefined the following way (assuming the star form is not needed):

\documentclass{article}
\usepackage{hyperref}[2011/02/05]

\hypersetup{hidelinks}
\usepackage{letltxmacro}
\makeatletter
\AtBeginDocument{%
  \@ifdefinable{\myorg@nameref}{%
    \LetLtxMacro\myorg@nameref\nameref
    \DeclareRobustCommand*{\nameref}[1]{%
      \emph{\myorg@nameref{#1}}%
    }%
  }%
}
\makeatother

\begin{document}
\section{Hello World}
\label{sec:hello}
This is section \nameref{sec:hello}.
\end{document}

Result