I have multiple sections with enumerations in them. Given a reference, is it possible to get the section name it belongs to? And also the item number as well.
For example, given this code (with fictionary commands itemref
and secref
)
\section*{Example title}
\begin{enumerate}
\item first one
\item second one \label{ref:anchor}
\end{enumerate}
\section*{Second title}
See item \itemref{ref:anchor} in section \secref{ref:anchor}.
the result would be
Example title
1. first one
2. second oneSecond title
See item 2 in section "Example title".
I've found numerous ways to reference a section name, but as I understand it, the anchor must be the section itself, which wouldn't work in my case since I move items around in this document and I'd like it to be dynamic.
EDIT: I have a working solution with the enumitem
package for the item number reference, so only the section name is missing.
\section*
, you're not going to have a section number.