On Mon, Oct 12, 2026 at 05:17:16PM +0100, Gavin Smith wrote:
> It is close to what I was going to suggest: add an anchor to the tag
> table giving the location of an index.  The anchor name wouldn't usually
> be visible to users.
> 
> I know you referenced a mail where you opposed checking for "Index" in
> an anchor name, but I also didn't go into any detail on that occasion (I
> can't remember what I was thinking at the time).

I thought that you were proposing an @anchor added by the user.  An
anchor added by texi2any seems good.

> It could look something like:
> 
> Ref: Index cp^??894490
> 
> It could reference the exact byte of where the output from @printindex
> started, rather than just the node.

Indeed, that would be even more efficient, and since there is a special
markup for indices it could be made robust to offsets, like nodes are.

> This has the advantage of also recording the name of the index from the
> Texinfo source ("cp" in this example for the "concept index").
> 
> (We'd have to have appropriate checks that this didn't clash with user
> defined node or anchor names, etc.).
> 
> The use of the English word "Index" in this context would be part of the
> the Info format, similar to other words such as "Node" or "Next".  It does
> not mean that we are showing that word to users - the word "index" could
> be something completely different in a different language.

Ok.

> If we thought a clash with a user-defined target name was likely we could
> use something more distinctive, like "Texi Index cp"  maybe using control
> characters as Eli suggested.

I would be in favor of always using control characters, to avoid name
clash, but more importantly, to mark it as an Info format generated
feature.  In a distant future I think that it would even be better if a
tag was used, we could simply make the keyword Index the tag name and
keep the same information, except without control character.

Another optimization could also be to allow a such as special tag to be
empty and associated to 0 to mean that the feature is present but there
are no indices in the file, in order not to reproduce the situation with
index markup for which we have to find some markup to know if there is
some markup, which is ok if there is actually an index, but inconvenient
if there is no index at all.

-- 
Pat

Reply via email to