I create a link with \nameref
:
\section*{\Huge {\color{DarkRed}This is a headline}}
\label{sec:headline}
When I reference to this section with
\nameref{sec:headline}
The link is displayed the same size (Huge) and color (Dark Red) as the section title.
The hyperref setup is:
\usepackage[colorlinks=true,linkcolor=black]{hyperref}
How can I avoid that link color and size are taken from the section setup. I want to keep them independent from one another.
EDIT: Minimal working example:
\documentclass{article}
\usepackage[colorlinks=true,linkcolor=black]{hyperref}
\begin{document}
\nameref{sec:headline}
\newpage
\section*{\Huge {\color{red}This is a headline}}
\label{sec:headline}
\end{document}
Best Answer
If you want to change the appearance in general, then use a more powerful class (
scrartcl
/KOMA-Script
,memoir
, …) or a package (sectsty
, …):Package
gettitlestring
Package
hyperref
uses packagenameref
. Since 2009/12/08 it uses packagegettitlestring
to get and process the title data. With methodexpand
commands can be redefined via\GetTitleStringDisableCommands
similar tohyperref
's\pdfstringdefDisableCommands
for bookmarks.However, only expandable redefinitions can be used. LaTeX's scanning for optional arguments does not work.