TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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):

\usepackage{graphicx}   % if you want to include graphics files


    \@removefromreset{theorem}{chapter}% just in case ... (no harm done)
    \@removefromreset{theorem}{section}% just in case ... (no harm done)

   % 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{\N}{{\mathbb N}}
      \newcommand{\A}{{\marhcal A}}
share|improve this question
You can use the command \href. Try \href{einstein}{y Einsteins Theorem}. – Marco Daniel May 2 '12 at 9:42
@MarcoDaniel: You surely meant \hyperref[einstein]{by Einsteins Theorem}, didn’t you? – Speravir May 2 '12 at 18:17
@Speravir: I didn't test it ;-). I can do a test. – Marco Daniel May 2 '12 at 18:18
up vote 9 down vote accepted

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

%------------------for refering to Einstein-----------------------------
\newtheorem{lemmaa}[lemmaa]{Einstein's theorem}
\providecommand*{\lemmaaautorefname}{Einstein's theorem}
%------------------for using lemma-----------------------------
We will use \autoref{a} to prove \autoref{b}.
Nobody knows.
Nobody ever knows anything.
Nobody is right.
My reference~\autoref{a} says that~\autoref{c} is wrong. 

enter image description here

share|improve this answer
@ Harish Kumar: Thank you for your answer. How ever, I've some question. How do I have to change my preamble, see my code, added in my question. I do not know why you are defining a new lemmaa? Thanks for your help – m. th May 2 '12 at 12:08
@math: I defined lemmaa so that you can still use lemma. Put the lines enclosed between dashed lines in my code preamble right after \newtheorem{theorem}{Theorem}[section] in your preamble. – Harish Kumar May 2 '12 at 14:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.