For my document, I like to have all my theorem environments be counted consecutively as definition 1, definition 2, ..., theorem 1, theorem 2, ....
I created a tcb theorem environment that does this, however, whenever I reference a theorem it only gives the section + subsection that theorem is under.
\documentclass[reqno, 11pt]{amsart}
\usepackage[margin=0.75in]{geometry}
\usepackage{tcolorbox}
\usepackage{hyperref}
\usepackage{nameref}
\tcbuselibrary{theorems}
\hypersetup{
colorlinks = true,
linkcolor={red!50!black}
}
\newtcbtheorem[auto counter]{thm}{Theorem}
{theorem style=plain,colframe=red!50!black,colback=red!5!white,
coltitle=red!50!black,fonttitle=\upshape\bfseries,fontupper=\itshape,boxrule=0.5pt}{}
\begin{document}
\section{First Section}
\subsection{Subsection One} \hfill
\begin{thm}{Theorem 1 Name}{} \label{thm:1}
Theorem here
\end{thm}
\begin{thm}{Theorem 2 name}{} \label{thm:2}
Theorem here
\end{thm}
By Theorem ~\ref{thm:1}, ... By Theorem ~\ref{thm:2},...
\end{document}
In this example, the reference renders the 1.1 for both Theorems 1 and 2. I would like it to render 1 for Theorem 1 and 2 for Theorem 2. I obviously would like this to not reset when going into another section.
\begin{thm}[label=thm:1]{Theorem 1 Name}{}– Ulrike Fischer Dec 21 '23 at 19:53