I have an enumerated list with the labels in parentheses. I want to reuse a label using \ref but with a prime symbol or a subscript. How do I do this?
\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate,1]{label={(\arabic*)}}
\begin{document}
\begin{enumerate}
\item This is the first sentence.
\item\label{toprime} I will give a variant of this sentence soon.
\end{enumerate}
Now here's some intervening material.
\begin{enumerate}[resume]
\item Let's stick another sentence in.
\item[\ref{toprime}$'$] I am now giving a variant of the original
sentence.
\item[\ref{toprime}$_2$] I would also like to tack on subscripts.
\end{enumerate}
\end{document}
This gives:
I want the prime symbol and the subscript to appear inside the parentheses. How do I do that?