The idea is to place \LBL{some_label_name}
in a paragraph so that I can refer back to the particular point inside that paragraph where the \LBL
was placed. I would like to define the macro for \LBL.
Unfortunately the \label
must be placed inside an environment with a counter. I tried phantomsection but the label picks up the true section counter. I'm using the hyperref package.
How can I achieve this, what would the \def
for \LBL
look like?
Best Answer
There are many ways. The following is using
\refstepcounter
that generates implicitly an anchor. Also instead of a section number\theword
is redefined to get the word instead, if called by\ref
.If the word is complicate that it cannot be used as label name, then the optional argument helps:
\LBL[labelword]{weird word}
…\ref{labelword}
.