Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to reference named (but unnumbered theorems) with a hyperlink. I have a solution which I consider at least a semi-hack:

\documentclass{amsart}
\usepackage[colorlinks=true]{hyperref}
\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem*{Zorn}{Zorn's lemma}

\begin{document}
\begin{Zorn}
\hypertarget{lem:Zorn}{}
This is Zorn's lemma
\end{Zorn}

That was \hyperlink{lem:Zorn}{Zorn's lemma}.
\end{document}

However I wonder if there is a neater solution (possibly using thmtools or cleveref) that would reference back to a \label for the unnumbered theorem?

share|improve this question
1  
I don't think this is a hack. However, you could use \newtheorem*{lemma}{Lemma} and then \begin{lemma}[Zorn]\label{lem:zorn}...\end{lemma} with \nameref{lem:zorn}. It would change the display of the lemma's though (with the name in brackets. –  Werner Feb 10 at 21:08
add comment

1 Answer

up vote 7 down vote accepted

Use a fake counter to keep hyperref happy:

\documentclass{amsart}
\usepackage{amsthm,lipsum}

\usepackage[colorlinks=true]{hyperref}

\theoremstyle{plain}
\newtheorem*{namedthm}{\namedthmname}
\newcounter{namedthm}

\makeatletter
\newenvironment{named}[1]
  {\def\namedthmname{#1}%
   \refstepcounter{namedthm}%
   \namedthm\def\@currentlabel{#1}}
  {\endnamedthm}
\makeatother

\begin{document}

\begin{named}{Zorn's lemma}\label{lem:Zorn}
This is Zorn's lemma
\end{named}

\lipsum[1-6]

That was \ref{lem:Zorn}.

\end{document}

You can have as many unnumbered theorems as you want.

enter image description here

share|improve this answer
    
This is exactly what I wanted, thanks. However... when I insert it to the long book I am writing I get two "undefined control sequence" errors pointing to the line containing the \newcounter. Quite possibly this is related to me using thmtools and cleveref? –  Noam Feb 13 at 7:15
    
@Noam That's a possibility; try with \newtheorem*{namedthm}{\protect\namedthmname} –  egreg Feb 13 at 10:10
    
This seems to work. Thanks! –  Noam Feb 16 at 6:36
add comment

Your Answer

 
discard

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.