Inconsistent Reference Counting
References are classified as forward or backward based on comparison of \crossreferencenumber against the sequence number of the reference loaded from the previous pass. \crossreferencenumber is incremented on all reference definition writes including duplicates. References loaded from the previous pass do not include duplicates. Thus forward/backward classification (e.g. in \somewhere) is wrong in the presence of duplicate references. One fix would be to not increment \crossreferencenumber if this reference has already been written to the file. Does anyone have any suggestions how to do this? Thanks, --Mike Bird
I was mistaken about the duplicate references. It is footnotes which are interfering with the reference counters. Test case: \starttext \chapter[A]{One} \footnote{foot} \somewhere{before}{after}[B] \chapter[B]{Two} \stoptext Any thoughts on a solution? Thanks, --Mike Bird
FWIW: Using \Footnote defined as below in a document with about 70 footnotes seems to correct all the \somewhere problems. \def\Footnote#1% {\global\advance\crossreferencenumber\minusone\relax% \footnote{#1}} Presumably \footnote is indirectly calling \dodowritereference although I haven't traced the full invocation path yet. --Mike Bird
Mike Bird wrote:
FWIW:
Using \Footnote defined as below in a document with about 70 footnotes seems to correct all the \somewhere problems.
\def\Footnote#1% {\global\advance\crossreferencenumber\minusone\relax% \footnote{#1}}
Presumably \footnote is indirectly calling \dodowritereference although I haven't traced the full invocation path yet.
this is related to footnotes having two references (to/from); the attached version may perform better but may interfere with other footnote things; i didn't test it that well Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Mike Bird wrote:
FWIW:
Using \Footnote defined as below in a document with about 70 footnotes seems to correct all the \somewhere problems.
\def\Footnote#1% {\global\advance\crossreferencenumber\minusone\relax% \footnote{#1}}
Presumably \footnote is indirectly calling \dodowritereference although I haven't traced the full invocation path yet.
remind me later this year ... in luatex we can use relatiev positions for this; in luatex i user a different way to store things and we can have way more data moving around Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Mike Bird