[Tex/LaTex] Using extended theorem names with \hyperref

hyperreftheorems

I've a question about the usepackage hyperref. I just link to the different theorems, lemmas etc. in my paper, writing

Theorem \ref{text}

I get a red or green (depends if it is a literature reference or not) box around the accordant number of the Theorem. Suppose there are Theorems, named after a Person. Is it possible to get this red box around the name? For example, suppose I stated the Einsteins Theorem on page 2, \label{einstein}. On page 10 I refer to this Theorem. I would like to write, "by Einsteins Theorem" an get a red box around Einstein. How can I do this?

Edit: Here is my preamble (a part of it):

\documentclass[10pt,twoside,openright]{thesis}
\usepackage{graphicx}   % if you want to include graphics files
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
\usepackage[pdftex,citecolor=green,linkcolor=red]{hyperref}
\usepackage{aliascnt}
      \theoremstyle{plain}
      \newtheorem{theorem}{Theorem}[section]
      \newtheorem{lemma}[theorem]{Lemma}
      \newtheorem{corollary}[theorem]{Corollary}
      \newtheorem*{claim}{Claim}
      \theoremstyle{definition}
      \newtheorem{definition}[theorem]{Definition}

      \theoremstyle{remark}
      \newtheorem{remark}[theorem]{Remark}

      \makeatletter
      \newcommand\settheoremtochp{%
    \@removefromreset{theorem}{chapter}% just in case ... (no harm done)
    \@removefromreset{theorem}{section}%
    \@addtoreset{theorem}{chapter}%
    \renewcommand\thetheorem{\thechapter.\arabic{theorem}}}
  \newcommand\settheoremtosec{%
    \@removefromreset{theorem}{chapter}%
    \@removefromreset{theorem}{section}% just in case ... (no harm done)
    \@addtoreset{theorem}{section}%
    \renewcommand\thetheorem{\thesection.\arabic{theorem}}}
  \makeatother


   % The preamble is also a good place to define new commands and macros.
   % This part of the preamble is strictly optional according to your taste.

      \newcommand{\R}{{\mathbb R}}
      \newcommand{\nil}{\varnothing}
      \newcommand{\N}{{\mathbb N}}
      \newcommand{\A}{{\marhcal A}}

Best Answer

You can use aliascnt to create a counter similar to theorem.

\documentclass{article}
\usepackage{aliascnt}
\usepackage{hyperref}
\newtheorem{theorem}{Theorem}
%------------------for refering to Einstein-----------------------------
\newaliascnt{lemmaa}{theorem}
\newtheorem{lemmaa}[lemmaa]{Einstein's theorem}
\aliascntresetthe{lemmaa}
\providecommand*{\lemmaaautorefname}{Einstein's theorem}
%------------------for using lemma-----------------------------
\newaliascnt{lemma}{theorem}
\newtheorem{lemma}[lemma]{Lemma}
\aliascntresetthe{lemma}
\providecommand*{\lemmaautorefname}{Lemma}
%-----------------------------------------------
\begin{document}
We will use \autoref{a} to prove \autoref{b}.
\begin{lemmaa}\label{a}
Nobody knows.
\end{lemmaa}
\begin{lemma}\label{c}
Nobody ever knows anything.
\end{lemma}
\aliascntresetthe{lemma}
\begin{theorem}\label{b}
Nobody is right.
\end{theorem}
My reference~\autoref{a} says that~\autoref{c} is wrong. 
\end{document}

enter image description here

Related Question