Re: Relating multiple index entries to one table item

Gavin Smith <[email protected]>
Newsgroups gmane.comp.tex.texinfo.general
Message-ID <Y35kRulruiom0O+D@starmint>
On Wed, Nov 23, 2022 at 07:57:16AM +0100, Arsen Arsenović wrote:
> Hi,
> 
> Gavin Smith <[email protected]> writes:
> 
> > I think deciding on the right output for the existing usage and
> > implementing such is more important than devising and implementing
> > new language constructs.
> 
> I understood you to mean that a list of index entries that follows a
> list of items should get the index automatically distributed.  I'm not
> sure if that's what you mean (my apologies, I've not been following with
> full attention).
> 
> I'm not sure that's quite possible in this instance.  In the example I
> was using, there's a different number of index entries versus items,
> since there isn't an item added for -Wno-..., despite there being an
> index entry to it.

I think all the index entries should link to the first @item.  I didn't
mean that there would be one index entry per @item/@itemx.



> The @itemindex proposal also seems to assume one index per item.  Maybe
> some transformation could be added to associate N @XXindex calls with an
> @item[x] that follows it too?  I haven't seen this usage in the wild,
> but it would allow indices other than f and v to also have properly
> indexed tables.  What I mean is that maybe:
> 
>   @opindex Wpedantic
>   @opindex Wno-pedantic
>   @item -Wpedantic
>   @opindex pedantic
>   @itemx -pedantic
> 
> ... should produce:
> 
>   <dt>
>     <span id="index-Wpedantic"></span>
>     <span id="index-Wno-pedantic"></span>
>     <span>
>       <code>-Wpedantic</code>
>       <a href="#index-Wpedantic" class="copiable-anchor"> ¶</a>
>     </span>
>   </dt>
>   <dt>
>     <span id="index-pedantic"></span>
>     <span>
>       <code>-pedantic</code>
>       <a href="#index-pedantic" class="copiable-anchor"> ¶</a>
>     </span>
>   </dt>
> 
> (formatting added for clarity), though, this has the disadvantage of
> still needing some care to keep the indices and items in sync.  Maybe
> just adding the -Wno-... flags is worth it to get the right result here.

Yes, it may be possible to associate index commands with a following
@item, although as you say, existing manuals may not be written for
this possibility.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.