I'm trying to implement and customize the solution that admits cross-referencing in the theorem environment.
The following attempt is extracted from my thesis template (so some packages might not be used, but they are necessary for me).
\documentclass[11pt,a4paper,twoside,final]{book}
\usepackage[utf8]{inputenc}
\usepackage[IL2]{fontenc}
\usepackage[czech]{babel}
\usepackage{lmodern}
\usepackage{longtable}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{thmtools}
\usepackage{mathtools}
\usepackage{hyperref}
\declaretheoremstyle[bodyfont=\slshape]{slshape}
\declaretheorem[style=slshape,name=Theorem,numberwithin=chapter]{thm}
\declaretheorem[style=slshape,name=Lemma,numberlike=thm]{lem}
\usepackage{enumitem}
\newlist{thmlist}{enumerate}{1}
\setlist[thmlist]{label=(\roman{thmlisti}),noitemsep}
\usepackage[capitalize]{cleveref}
\newcounter{listthm}
\newcounter{listlem}
\Crefname{thm}{Theorem}{Theorems}
\Crefname{lem}{Lemma}{Lemmas}
\Crefname{listthm}{Theorem}{Theorems}
\Crefname{listlem}{Lemma}{Lemmas}
\addtotheorempostheadhook[thm]{\crefalias{thmlisti}{listthm}}
\addtotheorempostheadhook[lem]{\crefalias{thmlisti}{listlem}}
\creflabelformat{listthm}{#2\thethm.#1#3}
\creflabelformat{listlem}{#2\thethm.#1#3}
\begin{document}
\chapter{Peek-a-boo}
\begin{thm}\label{thm:A}
Assumptions
\begin{thmlist}
\item Statment 1\label{thm:A1}
\item Statment 2\label{thm:A2}
\end{thmlist}
\end{thm}
\begin{lem}\label{thm:B}
Assumptions
\begin{thmlist}
\item Statment 1\label{thm:B1}
\item Statment 2\label{thm:B2}
\end{thmlist}
\end{lem}
\begin{thm}\label{thm:C}
Assumptions
\begin{thmlist}
\item Statment 1\label{thm:C1}
\item Statment 2\label{thm:C2}
\end{thmlist}
\end{thm}
\begin{thm}\label{thm:D}
Assumptions
\begin{thmlist}
\item Statment 1\label{thm:D1}
\item Statment 2\label{thm:D2}
\end{thmlist}
\end{thm}
\begin{enumerate}
\item That's how I refer to theorems and their like: \cref{thm:A}, \cref{thm:B} and \cref{thm:C}.
\item Referring to parts of theorems works like a charm with \verb+\cref{•}:+
\begin{itemize}
\item \cref{thm:A1}
\item \cref{thm:B1}
\item \cref{thm:C}
\item \cref{thm:C1}
\item \cref{thm:C2}
\end{itemize}
\item If I use \verb+\ref{•}+ to refer to a part of a theorem \LaTeX{} returns \ref{thm:A1} and \ref{thm:B2} and \ref{thm:A}.
\end{enumerate}
\newpage
aaa
\end{document}
All links refer to parts that they are meant to refer, but there is a problem with counters (I guess?). That is, all the following cref
s
\cref{thm:A1}
\cref{thm:B1}
\cref{thm:C1}
\cref{thm:C2}
print number of the very last theorem. So the natural question, how/what to fix there, please?
\creflabelformat{listthm}{#2\thethm.#1#3}
is simply wrong. \thethm doesn't refer to a labeled value, it will print the current value of the thm-counter.