[NTG-context] Using \currentreferencenumber triggers “has a hidden number” in log file

Marco Patzer lists at homerow.info
Thu Jul 18 21:04:18 CEST 2019


Hi,

I use

  \enabletrackers
    [structures.referencing.empty]

to catch references by number to sections without a number. The log
file contains “has a hidden number…” in that case. I have a command
that uses \currentreferencenumber which triggers the “has a hidden
number…” warning in the log file. But that command takes care not to
output the contents of that variable. But merely using it in an
\doif\currentreferencenumber is sufficient to trigger the log
message. Example:

\enabletrackers
  [structures.referencing.empty]

\def\foo[#1]{%%
  \doifreferencefoundelse{#1}{%%
    \doifelse\currentreferencenumber\emptyreference
    {Foo}{Bar}}%%
}

\setuphead
  [section] [number=no]

\starttext
  \startsection [title=Foo, reference=sec:foo]
    \samplefile{knuth}
  \stopsection
  \foo[sec:foo]
\stoptext

Then check the log file for “has a hidden number”.

1) How to not trigger the log message when checking
   \currentreferencenumber? Or alternatively

2) Is there a better way to find invisible references?

Marco


More information about the ntg-context mailing list