help-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relating multiple index entries to one table item


From: Patrice Dumas
Subject: Re: Relating multiple index entries to one table item
Date: Sun, 27 Nov 2022 14:39:25 +0100

On Sun, Nov 27, 2022 at 10:34:15AM +0000, Gavin Smith wrote:
> On Sat, Nov 26, 2022 at 11:11:52PM +0100, Patrice Dumas wrote:
> > I spotted two cases for which the index entry could also be with the
> > table term (in xtables inter_item_commands_in_table test), with a
> > comment between index entry and @item or an empty line between index
> > entry and @item:
> > 
> > @table @code
> > @cindex cindex in table 
> > @c comment in table
> > @item abb
> > l--ine
> > @end table
> > 
> > @table @samp 
> > @cindex cindex before line
> > 
> > @item asamp--bb2
> > @end table
> 
> I had seen those but they didn't seem important.  They would need handling
> of the empty line and comments, which probably wouldn't be difficult.

I did it for the comments.  For empty lines, it does not seem that clear
actually, it could be considered as signaling that the index entry
should be with the text before.

> What is more awkward is when there is no blank line before the index command:
> 
>     @table @asis
>     @item aaa
>     text
>     @cindex XXX
>     @item bbb
>     text
>     @end table
> 
> producing
> 
>     <dl class="table">
>     <dt>aaa</dt>
>     <dd><p>text
>     <a class="index-entry-id" id="index-XXX"></a>
>     </p></dd>
>     <dt>bbb</dt>
>     <dd><p>text
>     </p></dd>
>     </dl>
> 
> There are several such usages in the Texinfo manual; for example, in the table
> of units in (texinfo)Image Scaling.  Adding an extra blank line before the
> index command adds an extra blank line in the Info output, which is not
> desired for some tables, in this case looking like
> 
>     pt
>          point (72.27pt = 1in)
>     pc
>          pica (1pc = 12pt)
>     bp
>          big point (72bp = 1in)
>     in
>          inch
> 
> and adding extra blank lines between the entries would waste space on the
> screen.
> 
> The issue is that @cindex is included with the paragraph.  This should be
> fixable by making index commands close a paragraph, although it would remove
> the possibility of having an index target part way through a paragraph, which
> could be important.  (For example, in paginated output with a paragraph
> crossing over a page, with the relevant material on the later page - the
> index entry should refer to the later page, not the earlier page.)
> In texinfo.tex output,
> 
>     aaa
>     @cindex foo
>     bbb
> 
> produces output that looks like, simply, "aaa bbb".
> 
> So I am not too keen on making index commands close paragraphs.
> 
> I don't have a good solution at the moment. Another idea that came to
> mind was to reparent trailing index entries in paragraphs, so that with
> 
>     aaa
>     @cindex foo
> 
>     bbb
> 
> the "foo" index entry isn't part of the first paragraph.

For such cases, it is not clear to me what the output should be
actually, the index entry could belong to the previous or next @item.
Since the result is ok, I think that we can leave it as it is.

-- 
Pat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]