I have some more information...I made a copy of the hyperref package and started makeing a few changes. I found some interesting things, but still got a dead end:
1. Changed all \thepage to \pagetoref (\def\pagetoref{\thepage}} for default usage). This did change the table of contents and all warning messages after \def\pagetoref{\theminipage}. Did not change \pageref.
2. On line 6188 of hyperref.sty
Code: Select all
\let\real@setref\@setref
\def\@setref#1#2#3{% csname, extract group, refname
% #1 contains string of tokens, second is pageref% - Added by JCK
(% - Added by JCK
\expandafter\@firstoffive#1,% - Added by JCK
\expandafter\@secondoffive#1,% - Added by JCK, this is the \pageref
\expandafter\@thirdoffive#1,% - Added by JCK
\expandafter\@fourthoffive#1,% - Added by JCK
\expandafter\@fifthoffive#1)% - Added by JCK
\ifx#1\relax
\protect\G@refundefinedtrue
\nfss@text{\reset@font\bfseries ?XX?}%
\@latex@warning{%
Reference `#3' on page \pagetoref \space undefined%
}%
\else
\expandafter\Hy@setref@link#1\@empty\@empty\@nil{#2}%
\fi
}
\def\Hy@setref@link#1#2#3#4#5#6\@nil#7{%
\begingroup
\toks0={\hyper@@link{#5}{#4}}%
% #2 contains pageref% - Added by JCK
\toks1=\expandafter{#7{#1}{#2}{#3}{#4}{#5}}%
\edef\x{\endgroup
\the\toks0 {\the\toks1 }%
}%
\x
}
So this function \@setref is called with all this information passed to it {the \@secondoffive of the first argument), but where is it called? I think I'm too deep and need to burrow my way up until I find out where the text for the \pageref is getting set.