I have a section that is devoted to the proof of a theorem, and hence I used
\section{Proof of Theorem~\ref{thm}}
Of course, because of the headers that are capitalized, it asks for \ref{THM} when producing the header, and I get an obvious error. What is the proper way to handle such a case? Below is a MWE:
\documentclass{amsbook}
\usepackage{lipsum}
\newtheorem{thm}{Theorem}
\begin{document}
\chapter{First Chapter}
\section{The Theorem}
\begin{thm}[Lipsum Theorem]
\label{thm}
\lipsum[1]
\end{thm}
\section{Proof of Theorem~\ref{thm}}
\lipsum[1-23]
\end{document}
When compiling I get:
LaTeX Warning: Reference `THM' on page 3 undefined on input line 14.
(each time it produces a header), and the header shows
`2. PROOF OF THEOREM ??'
amsbook
.textcase
package is loaded, amsmath uses its\MakeTextUppercase
. This could be used to work out a solution, sincetextcase
respects\ref
, and it further provides a\NoCaseChange
macro.