This is a continuation of my previous question on manually increasing the theorem counter.
So I was able to manually increase and then access the theorem counter, but I am not able to make reference to it using \ref. Here is a minimal NON-WORKING example:
\documentclass{amsart}
\usepackage{amsmath}
\newtheorem{thm}{Theorem}
\begin{document}
\begin{thm}
\label{first}
First theorem.
\end{thm}
\stepcounter{thm}
\label{special}
\begin{quote}
Here is an in-text theorem: \textbf{Theorem \thethm.} \textit{Special one!}
\end{quote}
Make reference to theorem \ref{first} and my special theorem \ref{special}.
\end{document}
It is NOT WORKING because it could not print the second \ref. I tried moving the \label line within the \begin{quote} ... \end{quote}, but to no avail.
Many thanks for your help!
EDIT: Turns out my MWE is too minimal. Here is an expanded example that better illustrates the problem:
\documentclass{amsbook}
\usepackage{amsthm,fancyhdr}
\newtheorem{thm}{Theorem}[chapter]
\begin{document}
\chapter{New Chapter}
\refstepcounter{thm}
\label{manual}
\textbf{Theorem \thethm.} \textit{blah blah}.
\begin{thm}
\label{second}
Second theorem.
\end{thm}
\[
\begin{array}{c|c}
A & B
\\ \hline
x=y
&
\refstepcounter{thm}
\label{special}
\text{\textbf{Special Theorem \thethm}.}
\end{array}
\]
\begin{thm}
\label{last}
Last theorem.
\end{thm}
Refer to theorem \ref{manual}, theorem \ref{second}, Special Theorem \ref{special},
and last theorem \ref{last}.
\end{document}
In this version I use \refstepcounter, but it does not seem to record the correct theorem number.
Many thanks for your help!