I'm using a custom counter which I increment every now and then :
\newcounter{MyCounter}[subsection]
\newcommand{\stepTheCounter}{%
% do stuff, whatever
\refstepcounter{MyCounter}
}
Then, if I use a \label{someLabel}
somewhere, I would like to be able to have a custom command \theReference{someLabel}
, so that if I have a line like Lorem ipsum dolor \theReference{someLabel} sit amet
, it shows something like
Lorem ipsum dolor
X
.Y
.Z
(pageW
) sit amet
where X
is the section number, Y
is the subsection number, Z
is the value gotten from \ref{someLabel}
, and W
is the value gotten from \pageref{someLabel}
.
So the thing is : there is a \pageref
command, but (supposedly ?) no \etionref
nor \subsectionref
commands. But I feel like it should be normal to be able to achieve this easily...
None of the threads opened on the TeXExchange helped me... Thanks for the kind replies !
\thesubsection.\arabic{MyCounter}
then\ref
will give the full section.subsection.Mycounter value