[Tex/LaTex] How to reference part of a theorem

counterscross-referencingnumberingtheorems

I have a corollary with a number of parts whose parts need to be referenced individually later on, so something like:

\begin{cor}\label{cor}
   \begin{enumerate}
       \item Part one \label{partone}
       \item Part two \label{parttwo}
   \end{enumerate}
\end{cor}

Ideally, I want \ref{partone} to produce 2.1 (supposing it were Corollary 2 for the sake of argument), but, of course, \ref{partone} gives 1, as it's referencing the enumi counter.

Is there a way to get \ref to somehow combine the enumi and cor counters?

Best Answer

This can also be achieved by using the enumitem package:

\documentclass{article}
\usepackage{amsthm}
\usepackage{enumitem}

\newtheorem{cor}{Corolary}

\begin{document}

\begin{cor}\label{cor}
   \begin{enumerate}[label={\thecor.\arabic*}]
       \item Part one \label{partone}
       \item Part two \label{parttwo}
   \end{enumerate}
\end{cor}
As we see in part~\ref{partone}

\end{document}
Related Question