Hello everyone,

I am trying to automatically build *two indexes* (nominum & rerum) from two lists (|nomen-list.txt| and |rerum-list.txt|) *without having to* manually tag the text.

 * *ConTeXt LMTX* (ConTeXt Process Management 1.06
 * mtx-context | current version: 2025.07.27 21:43
 * OS: Windows
 * Compile commands:

|context --purgeall MWE_setregisterentry.tex|

|context MWE_setregisterentry.tex|

Approach:

 * I use *|input.processors.add(“autoindex”, filter)|* +
   |\enabledirectives[input.processors=autoindex]| (no
   |callbacks.register|).
 * In the processor, I search for *literal* occurrences (accents OK;
   |'|/|’| and |-|/|–|/|—| tolerated).
 * Instead of injecting the classic command |\index[...]|, I call
   *|\setregisterentry|* to properly register the entry (key/display).
 * The registers are defined in the preamble, |state=stop| then
   *|state=start| just after |\starttext|*, and printed with
   |\placeregister[...]| in the backmatter.

Problem:

 * The MWE *compiles perfectly* (PDF produced, pages OK) but *both
   indexes remain empty*.
 * I wonder if the processor injects the command during a *preroll* (or
   “trial typesetting”), which would cause the entry to be “lost.” Is
   there a recommended *flag* (e.g., |\ifprerolling| or equivalent) to
   *neutralize* |\setregisterentry| during prerolls and execute it
   *only at the right time*?

Questions:

1. Is the approach via |input.processors.add| +
   |\enabledirectives[input.processors=autoindex]| the *right* one for
   LMTX (rather than the old callbacks)?
2. Is there a *recommended method* for calling |\setregisterentry| from
   an input processor in a *reliable* way?
3. Is the signature |\setregisterentry[reg][keys={...}][entries={...}]|
   preferable to the /n/-level form (|keys:1|, |entries:1|) in this use
   case?
4. Would you recommend *anchoring* detection on *short units* (e.g.,
   “Aquin,” “Augustin”) and then forcing the key/display for sorting
   (|Aquin, Thomas|Thomas d'Aquin|)? I know: French diacritical marks,
   apostrophes, and other characters add an additional constraint to
   the indexing of proper names and nouns (see the word “aujourd'hui”
   and others).

Thank you in advance for your insights!
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to