I am writing a document with the amsbook class. I have defined a macro
\newcommand{\thmref}[1]{Theorem~\ref{#1}}
I would like to include the chapter number as follows: "(4, Theorem 2.7.6)", not just "Theorem 2.7.6".
So I need some macro like
\newcommand{\thmref}[1]{(\chapterNumber{#1}, Theorem~\ref{#1})}
with some definition of \chapterNumber. This command should accept a reference key like thm:very impportant theorem and print out the number of the chapter which contains it. I'm sure this must be very simple, but I don't know it. Can you help? Thank you!
--
Here is a working example:
\documentclass{amsbook}
\newtheorem{thm}[subsubsection]{Theorem}
\newcommand{\thmref}[1]{Theorem~\ref{#1}}
\begin{document}
\chapter{First}
\section{Alpha}
\subsection{Beta}
\begin{thm} \label{thm:important theorem}
Blah blah
\end{thm}
\chapter{Second}
\section{Gamma}
\subsection{Phi}
\begin{thm}
Foo bar
\end{thm}
This follows from \thmref{thm:important theorem}.
\end{document}

4.2.7.6, i.e. with leading chapter number much easier? ;-) – Jul 12 '16 at 23:301.1.1scheme forsection.subsection.thmnumber, but justchapter.thmetc. – Jul 12 '16 at 23:46