I would like the norm-symbol \left\| \right\|_p
to be linked to its definition, but I don't want its interior (x for example) to be linked. (And of course I want them to adjust their size automatically - that's why I use \left
and \right
)
Something like \hyperref[def:norm1]{\left\| {\suspendHyperref #1} \continueHyperref \right\|_1 }
would be great! (firefox' build in pdf-reader hilights links on mouseover - so it would be awesome if the right side of the norm symbol \right_p
also highlights, when I move the mouse over the left side of the norm symbol \left\|
in firefox, but this is not my number 1 priority)
At least something like \hyperref[def:norm2]{\left\| } #1 \hyperref[def:norm2]{\right\|_2 }
would be quite good, but this doesn't work because \left
and \right
form a group (like described in this post)
The following MWE produces a result that looks like I want it to look, but doesn't link correctly. Especially in eq. (1) the inner l_2-norm in the nested norms isn't linked correctly (because everything inside the outer l_1-norm is linked to the l_1-norm).
\documentclass[a4paper,11pt]{report}
\usepackage[colorlinks=true]{hyperref}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}[theorem]{Definition}
\newcommand{\normOne}[1]{\hyperref[def:norm1]{\left\| {\normalcolor #1} \right\|_1 }}
\newcommand{\normTwo}[1]{\hyperref[def:norm2]{\left\| {\normalcolor #1} \right\|_2 }}
\begin{document}
\begin{definition}[$\ell_1-Norm$]\label{def:norm1}
\[ \normOne{x} := \sum_{i=1}^{n} \left| x_i \right| \]
\end{definition}
\begin{definition}[$\ell_2-Norm$]\label{def:norm2}
\[ \normTwo{x} := \left( \sum_{i=1}^{n} \left| x_i \right|^2 \right)^{\frac{1}{2}} \]
\end{definition}
many pages later...
\begin{equation}
\normOne{ \left( \normTwo{y} - 3 \right) \hat{A}x}
\end{equation}
\end{document}
Maybe the idea of one of the answers to this question can be adopted to my problem, but unfortunately I don't understand all of these solutions well enough to know how to adopt them properly.