\
ref
and \
pageref
in ways that make
(etc.) not work; thus the technique may not be relied upon. The solution is to use the refcount package (incidentally, by the author of hyperref). The package provides four commands, all similar to:\setcounter{foo}{\ref{bar}}
(the other three are\usepackage{refcount} ... \label{bar} ... \setcounterref{foo}{bar}
\
addtocounterref
, \
setcounterpageref
and \
addtocounterpageref
).
The package also provides a command
\
getrefnumber{
label-name}
that may be used where a
‘number’ value is needed. For example:
which gives you a second footnote mark reference the the footnote. (There is also a command... \footnote{foo bar ...\label{foofoot}} ... \footnotemark[\getrefnumber{foofoot}]
\
getpagerefnumber
, of course).
The commands could be used by one determined not to use
changepage to determine whether
the current page is odd, but it’s probably no more
trouble to use the fully-developed tool in this case.
This answer was added: 2011-09-08
This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=labelcount