1

This question already has an answer here:

I would like to reference the name of a theorem in a section title. Everything about this works fine, but on the page headers, one sees (??) instead of the Theorem number in the displayed section title.

I realize that this question has been asked before, but the answers did not enable me to solve my particular problem. The consensus on the other questions seems to be that one should "use protect" to fix this, but that is not working.

(1) Most likely, this is because I misunderstood the other answers -- this seems to be a rather complicated issue with TeX, and, even after reading other posts, I still really don't understand the underlying difficulty, or, for that matter, why there should even be an problem. It doesn't seem like this should be hard for TeX to implement: scan for uses of \label to generate a list of labels. Then, any time \ref is used, substitute the appropriate label -- I don't see why it should matter that \ref is being called in some subroutine, e.g. the one that generates page headers.

(2) Possibly because one needs to modify things somewhat in the amsbook document class, which is the class in which I am working.

Here is a MWE which illustrates the problem:

\documentclass{amsbook}

\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}

\section{Section One}

\begin{theorem}\label{t:foo}
Cookies are tasty.
\end{theorem}

\section{Proof of Theorem \protect\ref{t:foo}}

\end{document}

EDIT: One should insert some text into the above example in order to see the failed page headers in the compiled document.

Thank you!

marked as duplicate by barbara beeton, user31729, Masroor, Mensch, Svend Tveskæg Aug 6 '14 at 13:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • welcome to the forum. take a look at Reference undefined in \section with amsbook -- the problem is that when a section heading is put into a running head, everything but math is uppercased. – barbara beeton Aug 6 '14 at 12:36
  • @Barbara -- thanks very much! That completely fixed the problem. – Saul Aug 6 '14 at 12:51

Browse other questions tagged or ask your own question.