Re: Feature request: multilevel indexing for TeX

2019-05-19 Thread arnold
Glad to hear it!  Enjoy.

Arnold

Raymond Toy  wrote:

> On Sun, May 19, 2019 at 8:44 AM Raymond Toy  wrote:
>
> > Thanks for looking into this.  I think I'm getting confused on which
> > version of makeinfo and texindex.tex is getting used. (I have 3 version on
> > my system).
> >
>
> Redid this on a different system which had just one installed texinfo.  I
> installed the dev version into its own prefix, and everything works fine.
> The multi-level index looks great and of course works fine with html (in a
> different fashion, of course).
>
> Not sure what's going on with my other system, but I'm quite happy with the
> results on this system.
>
> Thanks for your hard work on this!
>
> >
> > I think the issue I reported here is that I was using pdftex to create the
> > doc.  Using makeinfo --pdf doesn't have that problem. But it complains
> > about something else. I want to make sure it's from the dev texinfo stuff
> > and not some older 6.6 (or earlier) version.
> >
> > On Sun, May 19, 2019 at 2:54 AM Gavin Smith 
> > wrote:
> >
> >> On 5/18/19, Raymond Toy  wrote:
> >> > With my old hack.  With the new texinfo, I changed the macro to say
> >> >
> >> > @cindex \topic\ @subentry \subtopic\
> >> >
> >> > makeinfo --pdf foo.texi
> >> >
> >> > has errors like:
> >> >
> >> > Unde
> >> > fined control sequence.
> >> > \temp ->\xeatspaces {unix} \subentry
> >> >  \xeatspaces { pathnames}
> >> > \dosubindwrite ...mpty \xdef \indexsortkey {\temp
> >> >   }\ifx \indexsortkey
> >> > \empty...
> >> >
> >> > \safewhatsit ... \else \vskip -\whatsitskip \fi #1
> >> >   \ifx \lastskipmacro
> >> > \zeros...
> >> >
> >> > \dosubind ...dcsname }\safewhatsit \dosubindwrite
> >> >   }\fi
> >> > l.2 ...s {unix} @subentry @xeatspaces { pathnames}
> >> >
> >> > \scanmacro ...\\=\active \scantokens {#1@texinfoc}
> >> >   \aftermacro \catcode
> >> > `\@=\...
> >> > l.1657 @cpsubindex{unix, pathnames}
> >>
> >> I couldn't reproduce the problem. I found that @subentry worked OK
> >> with macros, although it is not surprising that there should be a
> >> problem here.
> >>
> >
> >
> > --
> > Ray
> >
>
>
> -- 
> Ray



Re: Feature request: multilevel indexing for TeX

2019-05-19 Thread Raymond Toy
On Sun, May 19, 2019 at 8:44 AM Raymond Toy  wrote:

> Thanks for looking into this.  I think I'm getting confused on which
> version of makeinfo and texindex.tex is getting used. (I have 3 version on
> my system).
>

Redid this on a different system which had just one installed texinfo.  I
installed the dev version into its own prefix, and everything works fine.
The multi-level index looks great and of course works fine with html (in a
different fashion, of course).

Not sure what's going on with my other system, but I'm quite happy with the
results on this system.

Thanks for your hard work on this!

>
> I think the issue I reported here is that I was using pdftex to create the
> doc.  Using makeinfo --pdf doesn't have that problem. But it complains
> about something else. I want to make sure it's from the dev texinfo stuff
> and not some older 6.6 (or earlier) version.
>
> On Sun, May 19, 2019 at 2:54 AM Gavin Smith 
> wrote:
>
>> On 5/18/19, Raymond Toy  wrote:
>> > With my old hack.  With the new texinfo, I changed the macro to say
>> >
>> > @cindex \topic\ @subentry \subtopic\
>> >
>> > makeinfo --pdf foo.texi
>> >
>> > has errors like:
>> >
>> > Unde
>> > fined control sequence.
>> > \temp ->\xeatspaces {unix} \subentry
>> >  \xeatspaces { pathnames}
>> > \dosubindwrite ...mpty \xdef \indexsortkey {\temp
>> >   }\ifx \indexsortkey
>> > \empty...
>> >
>> > \safewhatsit ... \else \vskip -\whatsitskip \fi #1
>> >   \ifx \lastskipmacro
>> > \zeros...
>> >
>> > \dosubind ...dcsname }\safewhatsit \dosubindwrite
>> >   }\fi
>> > l.2 ...s {unix} @subentry @xeatspaces { pathnames}
>> >
>> > \scanmacro ...\\=\active \scantokens {#1@texinfoc}
>> >   \aftermacro \catcode
>> > `\@=\...
>> > l.1657 @cpsubindex{unix, pathnames}
>>
>> I couldn't reproduce the problem. I found that @subentry worked OK
>> with macros, although it is not surprising that there should be a
>> problem here.
>>
>
>
> --
> Ray
>


-- 
Ray


Re: Feature request: multilevel indexing for TeX

2019-05-19 Thread Raymond Toy
Thanks for looking into this.  I think I'm getting confused on which
version of makeinfo and texindex.tex is getting used. (I have 3 version on
my system).

I think the issue I reported here is that I was using pdftex to create the
doc.  Using makeinfo --pdf doesn't have that problem. But it complains
about something else. I want to make sure it's from the dev texinfo stuff
and not some older 6.6 (or earlier) version.

On Sun, May 19, 2019 at 2:54 AM Gavin Smith 
wrote:

> On 5/18/19, Raymond Toy  wrote:
> > With my old hack.  With the new texinfo, I changed the macro to say
> >
> > @cindex \topic\ @subentry \subtopic\
> >
> > makeinfo --pdf foo.texi
> >
> > has errors like:
> >
> > Unde
> > fined control sequence.
> > \temp ->\xeatspaces {unix} \subentry
> >  \xeatspaces { pathnames}
> > \dosubindwrite ...mpty \xdef \indexsortkey {\temp
> >   }\ifx \indexsortkey
> > \empty...
> >
> > \safewhatsit ... \else \vskip -\whatsitskip \fi #1
> >   \ifx \lastskipmacro
> > \zeros...
> >
> > \dosubind ...dcsname }\safewhatsit \dosubindwrite
> >   }\fi
> > l.2 ...s {unix} @subentry @xeatspaces { pathnames}
> >
> > \scanmacro ...\\=\active \scantokens {#1@texinfoc}
> >   \aftermacro \catcode
> > `\@=\...
> > l.1657 @cpsubindex{unix, pathnames}
>
> I couldn't reproduce the problem. I found that @subentry worked OK
> with macros, although it is not surprising that there should be a
> problem here.
>


-- 
Ray


Re: Feature request: multilevel indexing for TeX

2019-05-19 Thread Gavin Smith
On 5/18/19, Raymond Toy  wrote:
> With my old hack.  With the new texinfo, I changed the macro to say
>
> @cindex \topic\ @subentry \subtopic\
>
> makeinfo --pdf foo.texi
>
> has errors like:
>
> Unde
> fined control sequence.
> \temp ->\xeatspaces {unix} \subentry
>  \xeatspaces { pathnames}
> \dosubindwrite ...mpty \xdef \indexsortkey {\temp
>   }\ifx \indexsortkey
> \empty...
>
> \safewhatsit ... \else \vskip -\whatsitskip \fi #1
>   \ifx \lastskipmacro
> \zeros...
>
> \dosubind ...dcsname }\safewhatsit \dosubindwrite
>   }\fi
> l.2 ...s {unix} @subentry @xeatspaces { pathnames}
>
> \scanmacro ...\\=\active \scantokens {#1@texinfoc}
>   \aftermacro \catcode
> `\@=\...
> l.1657 @cpsubindex{unix, pathnames}

I couldn't reproduce the problem. I found that @subentry worked OK
with macros, although it is not surprising that there should be a
problem here.



Re: Feature request: multilevel indexing for TeX

2019-05-19 Thread arnold
Hi.

Gavin is the TeXpert, but 

> It's easy enough for me to work around this by just globally replacing
> @cpsubindex{foo, bar} with @cindex foo @subentry bar

Doing that is probably your best bet, IMHO.

Arnold

Raymond Toy  wrote:

> Found a small issue and I'm not sure of the cause. I can easily workaround
> this since @subentry works for all output formats that I care about (pdf,
> html, info).
>
> Before @subentry was available I used this macro:
>
> @macro cpsubindex {topic,subtopic}
> @iftex
> @cindex \topic\!\subtopic\
> @end iftex
> @ifnottex
> @cindex \topic\, \subtopic\
> @end ifnottex
> @end macro
>
> With my old hack.  With the new texinfo, I changed the macro to say
>
> @cindex \topic\ @subentry \subtopic\
>
> makeinfo --pdf foo.texi
>
> has errors like:
>
> Unde
> fined control sequence.
> \temp ->\xeatspaces {unix} \subentry
>  \xeatspaces { pathnames}
> \dosubindwrite ...mpty \xdef \indexsortkey {\temp
>   }\ifx \indexsortkey
> \empty...
>
> \safewhatsit ... \else \vskip -\whatsitskip \fi #1
>   \ifx \lastskipmacro
> \zeros...
>
> \dosubind ...dcsname }\safewhatsit \dosubindwrite
>   }\fi
> l.2 ...s {unix} @subentry @xeatspaces { pathnames}
>
> \scanmacro ...\\=\active \scantokens {#1@texinfoc}
>   \aftermacro \catcode
> `\@=\...
> l.1657 @cpsubindex{unix, pathnames}
>
> I'm assuming the macro call @cpsubindex{unix, pathnames} expands into
>
> @cindex {unix} @subentry @xeatspaces { pathnames}
>
> and that @xeatspaces is causing problems.
>
> It's easy enough for me to work around this by just globally replacing
> @cpsubindex{foo, bar} with @cindex foo @subentry bar
>
>
> On Fri, May 10, 2019 at 12:41 AM  wrote:
>
> > You're welcome. Gavin did most of the work.
> >
> > I've revised (but not yet merged) the index for the gawk manual to take
> > advantage of the new features, and it too looks wonderful. I'm pleased
> > with the new features and am glad other people are using them too.
> >
> > Regards,
> >
> > Arnold
> >
> > Raymond Toy  wrote:
> >
> > > Thanks so much for implementing this!  I can get rid of the hacks I had
> > and
> > > make use of it in other docs.
> > >
> > > I did use this new version to generate Maxima's manual in pdf.  The index
> > > entries and subentries look fine for the most part, but there are a few
> > > oddities.  I don't know if I messed up or if it's a bug in texinfo.
> > When I
> > > isolate the problem, I'll let you know.
> > >
> > > But in general it looks fantastic!  And much better than the hack I was
> > > using!
> > >
> > >
> > > On Sun, Apr 28, 2019 at 2:20 AM Gavin Smith 
> > > wrote:
> > >
> > > > On Sun, Apr 28, 2019 at 02:33:25AM -0600, arn...@skeeve.com wrote:
> > > > > Gavin Smith  wrote:
> > > > >
> > > > > > On Sat, Mar 02, 2019 at 04:33:30PM +, Gavin Smith wrote:
> > > > > > > Implemented as @subentry in git commit 372cfab.
> > > > > > >
> > > > > > > A test file is attached. Please feel free to experiment.
> > > > > > >
> > > > > > > It still needs to be implemented in texi2any, once the syntax is
> > > > > > > finalised. Volunteers are welcome.
> > > > > >
> > > > > > I've added some support for @seeentry and @seealso in index
> > entries in
> > > > > > texi2any.  They are ignored except for DocBook output.
> > > > >
> > > > > Truly awesome!!!
> > > > >
> > > > > How do mean "ignored"?  Do you simply remove the @subentry and use
> > > > > the rest of the line as the index text, in Info, for example?
> > > >
> > > > I mean entries with @seeentry and @seealso do not add any index entries
> > > > for HTML and Info output.  @subentry isn't ignored.
> > > >
> > > > > I'd suggest something like  s/ *@subentry +/, /g   in sed syntax
> > > > > for Info, if that makes sense to you.
> > > >
> > > > In HTML and Info output, this is what is done already - the parts are
> > > > separated by commas.
> > > >
> > > > > And once again, a huge THANK YOU for working with me to add this
> > feature
> > > > > to Texinfo.  I have been working on the gawk manual's index to take
> > > > > advantage of this and it makes for an incredible improvement.
> > > >
> > > > That is very good to hear.  Thank you for suggesting the new features
> > > > and working to implement them in texindex.  I'm sure others will find
> > > > them useful too.
> > > >
> > > >
> > >
> > > --
> > > Ray
> >
>
>
> -- 
> Ray



Re: Feature request: multilevel indexing for TeX

2019-05-18 Thread Raymond Toy
Found a small issue and I'm not sure of the cause. I can easily workaround
this since @subentry works for all output formats that I care about (pdf,
html, info).

Before @subentry was available I used this macro:

@macro cpsubindex {topic,subtopic}
@iftex
@cindex \topic\!\subtopic\
@end iftex
@ifnottex
@cindex \topic\, \subtopic\
@end ifnottex
@end macro

With my old hack.  With the new texinfo, I changed the macro to say

@cindex \topic\ @subentry \subtopic\

makeinfo --pdf foo.texi

has errors like:

Unde
fined control sequence.
\temp ->\xeatspaces {unix} \subentry
 \xeatspaces { pathnames}
\dosubindwrite ...mpty \xdef \indexsortkey {\temp
  }\ifx \indexsortkey
\empty...

\safewhatsit ... \else \vskip -\whatsitskip \fi #1
  \ifx \lastskipmacro
\zeros...

\dosubind ...dcsname }\safewhatsit \dosubindwrite
  }\fi
l.2 ...s {unix} @subentry @xeatspaces { pathnames}

\scanmacro ...\\=\active \scantokens {#1@texinfoc}
  \aftermacro \catcode
`\@=\...
l.1657 @cpsubindex{unix, pathnames}

I'm assuming the macro call @cpsubindex{unix, pathnames} expands into

@cindex {unix} @subentry @xeatspaces { pathnames}

and that @xeatspaces is causing problems.

It's easy enough for me to work around this by just globally replacing
@cpsubindex{foo, bar} with @cindex foo @subentry bar


On Fri, May 10, 2019 at 12:41 AM  wrote:

> You're welcome. Gavin did most of the work.
>
> I've revised (but not yet merged) the index for the gawk manual to take
> advantage of the new features, and it too looks wonderful. I'm pleased
> with the new features and am glad other people are using them too.
>
> Regards,
>
> Arnold
>
> Raymond Toy  wrote:
>
> > Thanks so much for implementing this!  I can get rid of the hacks I had
> and
> > make use of it in other docs.
> >
> > I did use this new version to generate Maxima's manual in pdf.  The index
> > entries and subentries look fine for the most part, but there are a few
> > oddities.  I don't know if I messed up or if it's a bug in texinfo.
> When I
> > isolate the problem, I'll let you know.
> >
> > But in general it looks fantastic!  And much better than the hack I was
> > using!
> >
> >
> > On Sun, Apr 28, 2019 at 2:20 AM Gavin Smith 
> > wrote:
> >
> > > On Sun, Apr 28, 2019 at 02:33:25AM -0600, arn...@skeeve.com wrote:
> > > > Gavin Smith  wrote:
> > > >
> > > > > On Sat, Mar 02, 2019 at 04:33:30PM +, Gavin Smith wrote:
> > > > > > Implemented as @subentry in git commit 372cfab.
> > > > > >
> > > > > > A test file is attached. Please feel free to experiment.
> > > > > >
> > > > > > It still needs to be implemented in texi2any, once the syntax is
> > > > > > finalised. Volunteers are welcome.
> > > > >
> > > > > I've added some support for @seeentry and @seealso in index
> entries in
> > > > > texi2any.  They are ignored except for DocBook output.
> > > >
> > > > Truly awesome!!!
> > > >
> > > > How do mean "ignored"?  Do you simply remove the @subentry and use
> > > > the rest of the line as the index text, in Info, for example?
> > >
> > > I mean entries with @seeentry and @seealso do not add any index entries
> > > for HTML and Info output.  @subentry isn't ignored.
> > >
> > > > I'd suggest something like  s/ *@subentry +/, /g   in sed syntax
> > > > for Info, if that makes sense to you.
> > >
> > > In HTML and Info output, this is what is done already - the parts are
> > > separated by commas.
> > >
> > > > And once again, a huge THANK YOU for working with me to add this
> feature
> > > > to Texinfo.  I have been working on the gawk manual's index to take
> > > > advantage of this and it makes for an incredible improvement.
> > >
> > > That is very good to hear.  Thank you for suggesting the new features
> > > and working to implement them in texindex.  I'm sure others will find
> > > them useful too.
> > >
> > >
> >
> > --
> > Ray
>


-- 
Ray


Re: Feature request: multilevel indexing for TeX

2019-05-11 Thread Gavin Smith
On Thu, Mar 07, 2019 at 01:57:08PM -0700, arn...@skeeve.com wrote:
> Gavin Smith  wrote:
> 
> > On Mon, Mar 04, 2019 at 12:34:42AM -0700, arn...@skeeve.com wrote:
> > > No. As per the mail you discovered, Karl just said "make it work with 
> > > both"
> > > so I did. But we're five years later, let's just make the change, please.
> >
> > Made in commit 2405caa.
> 

Here we were discussing the escape character used in Texinfo index 
files, and changing it from \ to @.  Since texi2dvi didn't support @ as 
as the escape character (as it checked for "\entry" in the files, and not 
"@entry"), I think we should change back to \ so that new 
texinfo.tex works with old texi2dvi.  When the new version of texi2dvi 
has had a chance to become more prevalent, then the escape character can 
change back to @ again.

This should be an easy change to make now because both @ and \ are
only be used as escape characters in index files, never standing for 
themselves.  All that is needed is for the one-line change below.

diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index 4bc569a..0149ef6 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -5308,6 +5308,8 @@ end
 % the current value of \escapechar.
 \def\escapeisbackslash{\escapechar=`\\}
 
+\set txiindexescapeisbackslash
+
 % Write the entry in \indextext to the index file.
 %
 \def\doindwrite{%




Re: Feature request: multilevel indexing for TeX

2019-05-10 Thread arnold
You're welcome. Gavin did most of the work.

I've revised (but not yet merged) the index for the gawk manual to take
advantage of the new features, and it too looks wonderful. I'm pleased
with the new features and am glad other people are using them too.

Regards,

Arnold

Raymond Toy  wrote:

> Thanks so much for implementing this!  I can get rid of the hacks I had and
> make use of it in other docs.
>
> I did use this new version to generate Maxima's manual in pdf.  The index
> entries and subentries look fine for the most part, but there are a few
> oddities.  I don't know if I messed up or if it's a bug in texinfo.  When I
> isolate the problem, I'll let you know.
>
> But in general it looks fantastic!  And much better than the hack I was
> using!
>
>
> On Sun, Apr 28, 2019 at 2:20 AM Gavin Smith 
> wrote:
>
> > On Sun, Apr 28, 2019 at 02:33:25AM -0600, arn...@skeeve.com wrote:
> > > Gavin Smith  wrote:
> > >
> > > > On Sat, Mar 02, 2019 at 04:33:30PM +, Gavin Smith wrote:
> > > > > Implemented as @subentry in git commit 372cfab.
> > > > >
> > > > > A test file is attached. Please feel free to experiment.
> > > > >
> > > > > It still needs to be implemented in texi2any, once the syntax is
> > > > > finalised. Volunteers are welcome.
> > > >
> > > > I've added some support for @seeentry and @seealso in index entries in
> > > > texi2any.  They are ignored except for DocBook output.
> > >
> > > Truly awesome!!!
> > >
> > > How do mean "ignored"?  Do you simply remove the @subentry and use
> > > the rest of the line as the index text, in Info, for example?
> >
> > I mean entries with @seeentry and @seealso do not add any index entries
> > for HTML and Info output.  @subentry isn't ignored.
> >
> > > I'd suggest something like  s/ *@subentry +/, /g   in sed syntax
> > > for Info, if that makes sense to you.
> >
> > In HTML and Info output, this is what is done already - the parts are
> > separated by commas.
> >
> > > And once again, a huge THANK YOU for working with me to add this feature
> > > to Texinfo.  I have been working on the gawk manual's index to take
> > > advantage of this and it makes for an incredible improvement.
> >
> > That is very good to hear.  Thank you for suggesting the new features
> > and working to implement them in texindex.  I'm sure others will find
> > them useful too.
> >
> >
>
> -- 
> Ray



Re: Feature request: multilevel indexing for TeX

2019-05-09 Thread Raymond Toy
Thanks so much for implementing this!  I can get rid of the hacks I had and
make use of it in other docs.

I did use this new version to generate Maxima's manual in pdf.  The index
entries and subentries look fine for the most part, but there are a few
oddities.  I don't know if I messed up or if it's a bug in texinfo.  When I
isolate the problem, I'll let you know.

But in general it looks fantastic!  And much better than the hack I was
using!


On Sun, Apr 28, 2019 at 2:20 AM Gavin Smith 
wrote:

> On Sun, Apr 28, 2019 at 02:33:25AM -0600, arn...@skeeve.com wrote:
> > Gavin Smith  wrote:
> >
> > > On Sat, Mar 02, 2019 at 04:33:30PM +, Gavin Smith wrote:
> > > > Implemented as @subentry in git commit 372cfab.
> > > >
> > > > A test file is attached. Please feel free to experiment.
> > > >
> > > > It still needs to be implemented in texi2any, once the syntax is
> > > > finalised. Volunteers are welcome.
> > >
> > > I've added some support for @seeentry and @seealso in index entries in
> > > texi2any.  They are ignored except for DocBook output.
> >
> > Truly awesome!!!
> >
> > How do mean "ignored"?  Do you simply remove the @subentry and use
> > the rest of the line as the index text, in Info, for example?
>
> I mean entries with @seeentry and @seealso do not add any index entries
> for HTML and Info output.  @subentry isn't ignored.
>
> > I'd suggest something like  s/ *@subentry +/, /g   in sed syntax
> > for Info, if that makes sense to you.
>
> In HTML and Info output, this is what is done already - the parts are
> separated by commas.
>
> > And once again, a huge THANK YOU for working with me to add this feature
> > to Texinfo.  I have been working on the gawk manual's index to take
> > advantage of this and it makes for an incredible improvement.
>
> That is very good to hear.  Thank you for suggesting the new features
> and working to implement them in texindex.  I'm sure others will find
> them useful too.
>
>

-- 
Ray


Re: Feature request: multilevel indexing for TeX

2019-04-28 Thread Gavin Smith
On Sun, Apr 28, 2019 at 02:33:25AM -0600, arn...@skeeve.com wrote:
> Gavin Smith  wrote:
> 
> > On Sat, Mar 02, 2019 at 04:33:30PM +, Gavin Smith wrote:
> > > Implemented as @subentry in git commit 372cfab.
> > > 
> > > A test file is attached. Please feel free to experiment.
> > > 
> > > It still needs to be implemented in texi2any, once the syntax is
> > > finalised. Volunteers are welcome.
> >
> > I've added some support for @seeentry and @seealso in index entries in 
> > texi2any.  They are ignored except for DocBook output.
> 
> Truly awesome!!!
> 
> How do mean "ignored"?  Do you simply remove the @subentry and use
> the rest of the line as the index text, in Info, for example?

I mean entries with @seeentry and @seealso do not add any index entries 
for HTML and Info output.  @subentry isn't ignored.

> I'd suggest something like  s/ *@subentry +/, /g   in sed syntax
> for Info, if that makes sense to you.

In HTML and Info output, this is what is done already - the parts are 
separated by commas.

> And once again, a huge THANK YOU for working with me to add this feature
> to Texinfo.  I have been working on the gawk manual's index to take
> advantage of this and it makes for an incredible improvement.

That is very good to hear.  Thank you for suggesting the new features 
and working to implement them in texindex.  I'm sure others will find 
them useful too.



Re: Feature request: multilevel indexing for TeX

2019-04-28 Thread arnold
Gavin Smith  wrote:

> On Sat, Mar 02, 2019 at 04:33:30PM +, Gavin Smith wrote:
> > Implemented as @subentry in git commit 372cfab.
> > 
> > A test file is attached. Please feel free to experiment.
> > 
> > It still needs to be implemented in texi2any, once the syntax is
> > finalised. Volunteers are welcome.
>
> I've added some support for @seeentry and @seealso in index entries in 
> texi2any.  They are ignored except for DocBook output.

Truly awesome!!!

How do mean "ignored"?  Do you simply remove the @subentry and use
the rest of the line as the index text, in Info, for example?

I'd suggest something like  s/ *@subentry +/, /g   in sed syntax
for Info, if that makes sense to you.

Thanks!

And once again, a huge THANK YOU for working with me to add this feature
to Texinfo.  I have been working on the gawk manual's index to take
advantage of this and it makes for an incredible improvement.

Thanks again,

Arnold



Re: Feature request: multilevel indexing for TeX

2019-04-27 Thread Gavin Smith
On Sat, Mar 02, 2019 at 04:33:30PM +, Gavin Smith wrote:
> Implemented as @subentry in git commit 372cfab.
> 
> A test file is attached. Please feel free to experiment.
> 
> It still needs to be implemented in texi2any, once the syntax is
> finalised. Volunteers are welcome.

I've added some support for @seeentry and @seealso in index entries in 
texi2any.  They are ignored except for DocBook output.



Re: Feature request: multilevel indexing for TeX

2019-03-08 Thread Gavin Smith
On Thu, Mar 07, 2019 at 01:57:08PM -0700, arn...@skeeve.com wrote:
> OK. No problem. The number field must match /^([ivxdlcm]+|([0-9]+)$/
> to be a number. Otherwise it's a see/see also.

I found that text in the number field would have to be surrounded in 
braces, like this:

@entry{bbb}{{see also @code{ee@`e}}}{bbb}

otherwise the code in \pdfgettoks would make any spaces disappear, and 
"seealso" would appear.  This appears to work okay with texindex: the 
following in seealso.cp:

@entry{aaa}{1}{aaa}
@entry{bbb}{1}{bbb}
@entry{bbb}{{see also @code{ee@`e}}}{bbb}

produces the following in seealso.cps:

@initial {A}
@entry {aaa}{1}
@initial {B}
@entry {bbb}{1, {see also @code{ee@`e}}}

So there might not be much required in terms of changes to texindex to 
support this.

I am not sure about the regex for matching Roman numerals is a good 
idea.  There are more features for index formatting that we haven't 
considered: page numbers having styles such as bold or italic is 
something that occurs in some indices in books or articles.  Then we 
might want e.g. @b{23} or @i{56} in the number field - that wouldn't be 
a "see also".  I can imagine an obscure bug where the word "mix" appears 
in the page number field when it does not mean 1009.  I'd prefer 
something more explicit.



Re: Feature request: multilevel indexing for TeX

2019-03-07 Thread arnold
Gavin Smith  wrote:

> On Mon, Mar 04, 2019 at 12:34:42AM -0700, arn...@skeeve.com wrote:
> > No. As per the mail you discovered, Karl just said "make it work with both"
> > so I did. But we're five years later, let's just make the change, please.
>
> Made in commit 2405caa.

Awesome!

> texindex should continue to recognize \ as the escape character for
> compatibility with old versions of texinfo.tex.

OK. It complicates things some, but not terribly.

> > > > Or we could go with keywords, to ensure that the user gets what they
> > > > wanted:
> > > >
> > > > @cindex espresso makers @see{coffee makers}
> > > > @cindex coffee @seealso{instant coffee}
> > >
> > > I think keywords are the way to go here.
> > 
> > All sounds good.  I will assume that if the second entry doesn't
> > have a number in it that it's a "see" or "see also" entry and
> > treat it approriately.
> > 
> > Hmm. Do we ever get roman numerals in the number field of an entry?
>
> I tested it and yes, this can happen.

OK. No problem. The number field must match /^([ivxdlcm]+|([0-9]+)$/
to be a number. Otherwise it's a see/see also.

> Is the "see also" feature something that anybody 
> wants or is it just theoretical?

I want it. The gawk manual has both See and See Also in its index.

Hmm... Here are two entries in the current manual:

@cindex output record separator, See @code{ORS} variable
@cindex @code{print} statement, See Also redirection@comma{} of output

I guess these become:

@cindex output record separator @see{@code{ORS} variable}
@cindex @code{print} statement @seealso{redirection@comma{} of output}

(Can texinfo.tex add back the comma before the @see/@seealso?)

Leading to:

@entry{output record separator, See ORS variabale}{}{output record 
separator @see{@code{ORS} variable}}
@entry{print statement, See Also redirection, of output}{}{@code{print} 
statement @seealso{redirection@comma{} of output}}

Thoughts?

Thanks!

Arnold



Re: Feature request: multilevel indexing for TeX

2019-03-07 Thread Gavin Smith
On Mon, Mar 04, 2019 at 12:34:42AM -0700, arn...@skeeve.com wrote:
> No. As per the mail you discovered, Karl just said "make it work with both"
> so I did. But we're five years later, let's just make the change, please.

Made in commit 2405caa.  Provided the latest revision of texi2dvi is 
being used, old sorted index files should be painlessly updated to use 
the @ sign.  It is quite a complicated issue, and there is a significant 
risk of breakage.  Testing with various combinations of files and programs
would be useful.

Using @ as the escape character does appear to simplify matters a lot 
and reduce the need for special handling of backslashes.  Some more 
simplication of texinfo.tex might be possible around this area.

texindex should continue to recognize \ as the escape character for
compatibility with old versions of texinfo.tex.  Even if a new version is 
installed on a system, it is possible that an old version will be used 
instead if it is bundled along with a Texinfo file in the same 
directory, e.g. in old software releases.  I can't see that this would 
ever change.

> > > Or we could go with keywords, to ensure that the user gets what they
> > > wanted:
> > >
> > >   @cindex espresso makers @see{coffee makers}
> > >   @cindex coffee @seealso{instant coffee}
> >
> > I think keywords are the way to go here.
> 
> All sounds good.  I will assume that if the second entry doesn't
> have a number in it that it's a "see" or "see also" entry and
> treat it approriately.
> 
> Hmm. Do we ever get roman numerals in the number field of an entry?

I tested it and yes, this can happen.  With the input

\input texinfo.tex@c -*-texinfo-*-
@setfilename test.info

@cindex foo
@contents

@node Command and Variable Index
@unnumbered Command and Variable Index

This is an alphabetical list of all the @@-commands, assorted Emacs Lisp
functions, and several variables.  To make the list easier to use, the
commands are listed without their preceding @samp{@@}.


@printindex cp


@bye

at the end, test.cp contained:

@entry{foo}{i}{foo}

Is the "see also" feature something that anybody 
wants or is it just theoretical?

Even if it is theoretical, it is probably a good idea to think about it 
now, as it may be hard to add the feature later in a nice way if it is 
not well-thought out now.  It occurs to me that we have the option of 
changing the index file format quite a lot, as we have already made an 
incompatible change (changing \ to @).



Re: Feature request: multilevel indexing for TeX

2019-03-03 Thread Gavin Smith
On 3/3/19, Gavin Smith  wrote:
> I went looking for past emails about the reasoning behind the choices
> of escape char but found nothing. Did you look into this when you
> wrote texindex?

Karl wanted the escape character to change for index files:

http://lists.gnu.org/archive/html/bug-texinfo/2014-02/msg00052.html
http://lists.gnu.org/archive/html/bug-texinfo/2015-08/msg00162.html

As far as I know the only barrier to changing the escape character is
that old texindex is still installed.

At some point it would be good if texindex could be made faster -
possibly rewritten in a faster language than awk (or if awk itself
could be made faster) (go? haskell? although Texinfo may have too many
languages in it already). If C texindex is /usr/bin/texindex then
running

TEXINDEX=/usr/bin/texindex texi2pdf texinfo.texi

noticeably reduces the delay between runs of TeX (by a second or so)
(where texinfo.texi is Texinfo's own manual). It doesn't matter very
much of course, as TeX itself takes much longer to run than texindex
for large input files.



Index entry "see" or "see also" (was Feature request: multilevel indexing for TeX)

2019-03-03 Thread Gavin Smith
On 3/3/19, arn...@skeeve.com  wrote:
> If that's the case, then texindex could also special case stuff like
>
>   \entry {espresso makers, see coffee makers}{23}{espresso makers, see 
> coffee
> makers}
>
> as input and and turn it into
>
>   \entry {espresso makers, see coffee makers}{}
>
> on output.
>
> And similar for "see also".
That looks okay for the output but the input should be unambiguous, maybe

>   \entry {espresso makers}{see coffee makers}{espresso makers}

replacing the page number.

For non-English translations, a different word from "see" would have
to be used, using \putwordsee.

> Or we could go with keywords, to ensure that the user gets what they
> wanted:
>
>   @cindex espresso makers @see{coffee makers}
>   @cindex coffee @seealso{instant coffee}

I think keywords are the way to go here.



Re: Feature request: multilevel indexing for TeX

2019-03-03 Thread Gavin Smith
On 3/3/19, arn...@skeeve.com  wrote:
> A few questions.
>
> 1. texindex.awk has provision for both \ and @ to be the command character
> (\entry vs. @entry). Do we still need that? Or will it always be backslash?

I think it could change to @ at some point. The toc and aux files do
use @ as the escape character, so it would be more consistent to use
@.

There is this comment in the code:

  % Index files are almost Texinfo source, but we use \ as the escape
  % character.  It would be better to use @, but that's too big a change
  % to make right now.

I don't know when it got added, but it was present in Texinfo 3.9 from
1996. (It wasn't in Texinfo 3.1, and I don't have copies of anything
in between (does anybody know where I could get them?).)

For the toc files at least, this changed on 2005-02-19 according to
the ChangeLog (formerly it was the backslash). In the past, the aux
file used the apostrophe (') as the escape character - that changed on
2003-01-24.

I went looking for past emails about the reasoning behind the choices
of escape char but found nothing. Did you look into this when you
wrote texindex?

> 2. What do we wish to do about "see" and "see also"? I have a thought...
>
> With respect to output from texindex.awk, I suggest that each macro
> allow empty page number arguments.  Thus
>
>   @cindex coffee makers @subentry electic
>   @cindex coffee makers @subentry gerbel-driven
>
> with no
>
>   @cindex coffee makers
>
> would yield
>
>   \entry {coffee makers}{}
>   \secondary {electric}{3, 12}
>   \secondary {gerbel-driven}{9, 42}
>
> and similar for \secondary if there are following \tertiary entries.

I'd have to check if this was easy to implement in TeX, but it is
quite likely possible. (The formatting of index entries is already
quite complicated with dealing with line breaks inside index text
and/or the list of page numbers.) I see why you would want this:
otherwise, we would need two versions of \secondary.



Re: Feature request: multilevel indexing for TeX

2019-03-03 Thread arnold
Hi.

> Maybe it will just have to be accepted that out-of-date versions of
> texindex shouldn't be used with multi-level index entries, otherwise
> the index will appear somewhat mangled.

I think we just have to say that.

> Implemented as @subentry in git commit 372cfab.
>
> A test file is attached. Please feel free to experiment.

Excellent! Will do.

A few questions.

1. texindex.awk has provision for both \ and @ to be the command character
(\entry vs. @entry). Do we still need that? Or will it always be backslash?

2. What do we wish to do about "see" and "see also"? I have a thought...

With respect to output from texindex.awk, I suggest that each macro
allow empty page number arguments.  Thus

@cindex coffee makers @subentry electic
@cindex coffee makers @subentry gerbel-driven

with no

@cindex coffee makers

would yield

\entry {coffee makers}{}
\secondary {electric}{3, 12}
\secondary {gerbel-driven}{9, 42}

and similar for \secondary if there are following \tertiary entries.

If that's the case, then texindex could also special case stuff like

\entry {espresso makers, see coffee makers}{23}{espresso makers, see 
coffee makers}

as input and and turn it into

\entry {espresso makers, see coffee makers}{}

on output. 

And similar for "see also".

Or we could go with keywords, to ensure that the user gets what they
wanted:

@cindex espresso makers @see{coffee makers}
@cindex coffee @seealso{instant coffee}

How much of this works for you?

Thanks!

Arnold



Re: Feature request: multilevel indexing for TeX

2019-03-02 Thread Raymond Toy
I'm excited to see this supported in texinfo/texindex.

In the attachment, is @cindex the only way to get this or is this expected
to work with any user-defined index command?

Maxima will use a couple of user-defined indices to produce a nice
cross-reference of categories, so this is important.

On Sat, Mar 2, 2019 at 8:33 AM Gavin Smith  wrote:

> On 3/1/19, arn...@skeeve.com  wrote:
> > @indent makes sense, since that's what happens on the page, but I
> > can live with @tab also, or something like @subind might be good too.
> > I don't have strong feelings, as long as it makes reasonable sense
> > and is easy to convert an existing entry to it.
>
> Implemented as @subentry in git commit 372cfab.
>
> A test file is attached. Please feel free to experiment.
>
> It still needs to be implemented in texi2any, once the syntax is
> finalised. Volunteers are welcome.
>
> (I wrote a longer reply but GMail lost it when my internet went down.)
>


-- 
Ray


Re: Feature request: multilevel indexing for TeX

2019-03-02 Thread Gavin Smith
Yes, any index command.

On Sat, 2 Mar 2019, 18:04 Raymond Toy,  wrote:

> I'm excited to see this supported in texinfo/texindex.
>
> In the attachment, is @cindex the only way to get this or is this expected
> to work with any user-defined index command?
>
> Maxima will use a couple of user-defined indices to produce a nice
> cross-reference of categories, so this is important.
>
> On Sat, Mar 2, 2019 at 8:33 AM Gavin Smith 
> wrote:
>
>> On 3/1/19, arn...@skeeve.com  wrote:
>> > @indent makes sense, since that's what happens on the page, but I
>> > can live with @tab also, or something like @subind might be good too.
>> > I don't have strong feelings, as long as it makes reasonable sense
>> > and is easy to convert an existing entry to it.
>>
>> Implemented as @subentry in git commit 372cfab.
>>
>> A test file is attached. Please feel free to experiment.
>>
>> It still needs to be implemented in texi2any, once the syntax is
>> finalised. Volunteers are welcome.
>>
>> (I wrote a longer reply but GMail lost it when my internet went down.)
>>
>
>
> --
> Ray
>


Re: Feature request: multilevel indexing for TeX

2019-03-02 Thread Gavin Smith
On 3/1/19, arn...@skeeve.com  wrote:
> @indent makes sense, since that's what happens on the page, but I
> can live with @tab also, or something like @subind might be good too.
> I don't have strong feelings, as long as it makes reasonable sense
> and is easy to convert an existing entry to it.

Implemented as @subentry in git commit 372cfab.

A test file is attached. Please feel free to experiment.

It still needs to be implemented in texi2any, once the syntax is
finalised. Volunteers are welcome.

(I wrote a longer reply but GMail lost it when my internet went down.)


indextab.texi
Description: TeXInfo document


Re: Feature request: multilevel indexing for TeX

2019-03-01 Thread Gavin Smith
On 3/1/19, Gavin Smith  wrote:
> Whatever output is chosen, it would be good to check how existing
> versions of texindex deal with it: we should avoid completely breaking
> them if at all possible.

So awk texindex, given the input indextab.cp:

\entry{one}{1}{one}
\entry{one\subind two}{1}{one}{two}
\entry{one\subind twox\subind three}{1}{one}{twox}{three}
\entry{one\subind twox\subind bazinga}{1}{one}{twox}{bazinga}

produces the output indextab.cps:

\entry {one}{1}
\entry {one}{two}{1}
\entry {one}{twox}{bazinga}{1}
\entry {one}{twox}{three}{1}

which is not formatted properly when read back in, as \entry has to
take only two arguments: the extra arguments are typeset in the index,
which doesn't look good.

I found the output index file indextab.cp would in fact end up as an
empty file when @printindex cp was used when this kind of data
appeared in indextab.cps, although I didn't discover why.

Maybe it will just have to be accepted that out-of-date versions of
texindex shouldn't be used with multi-level index entries, otherwise
the index will appear somewhat mangled.



Re: Feature request: multilevel indexing for TeX

2019-03-01 Thread Gavin Smith
On Fri, Mar 01, 2019 at 02:25:29AM -0700, arn...@skeeve.com wrote:
> > Maybe a special marker character could be output that texindex treats 
> > specially: e.g. the above would be output as
> >
> > \entry{aa^_a}{1}{aa}{a}
> > \entry{aa^_z}{3}{aa}{z}
> > \entry{aah}{5}{aah}
> >
> > where ^_ is a 0x1F byte.
> 
> Yes, perfect, that's real easy to handle in awk.

Unfortunately, writing ASCII control characters to files is not reliable 
and the results vary depending on the TeX installation and options.  
Likely "^^_" is written instead.

See 
https://tex.stackexchange.com/questions/8729/write-non-printable-ascii-characters-to-a-file.

The only reliable alternative seems to be to use a control sequence, 
thus:

\entry{aa\subind a}{1}{aa}{a}
\entry{aa\subind z}{3}{aa}{z}

I assume awk can deal with that fine.

It could be a "control symbol" instead, e.g.:

\entry{aa\!a}{1}{aa}{a}
\entry{aa\!z}{3}{aa}{z}

But I don't think we should use a control symbol for this as it could 
clash with real or future Texinfo commands that might occur in an index 
entry.

Whatever output is chosen, it would be good to check how existing 
versions of texindex deal with it: we should avoid completely breaking 
them if at all possible.



Re: Feature request: multilevel indexing for TeX

2019-03-01 Thread Patrice Dumas
On Fri, Mar 01, 2019 at 02:25:29AM -0700, arn...@skeeve.com wrote:
> 
> @indent makes sense, since that's what happens on the page, but I
> can live with @tab also, or something like @subind might be good too.
> I don't have strong feelings, as long as it makes reasonable sense
> and is easy to convert an existing entry to it.

I think that a specific command should be used, so @subind looks good to
me, reusing @tab or @indent with a different meaning based on the
context should be avoid in my opinion.

-- 
Pat



Re: Feature request: multilevel indexing for TeX

2019-03-01 Thread arnold
Hi.

> * What happens if there is an index entry with no secondary term and an 
> identical index entry with a secondary term, e.g.
>
> @cindex foo
> @cindex foo @sub bar
>
> I think that both should be kept.  When I tested it with C texindex, one 
> of them was lost in the output.

I agree. We need to put together a "torture test" for texindex.

> * Do we keep @defop, and the other commands in texinfo.tex currently using 
> \dosubind, as creating single-level index entries?  I assume yes, even 
> if it was different before: no-one to my knowledge ever complained that 
> the behaviour changed, and it is more stable to keep things as they are, 
> even if in the past they were possibly different.  I suspect not many 
> are using these commands anyway.

I agree.

> Perhaps sort keys could be generated for primary, secondary and 
> tertiary entry text separately, and simply concatenated to produce the 
> sort key.

Separate keys, yes. Concatenataed, no.

> Maybe a special marker character could be output that texindex treats 
> specially: e.g. the above would be output as
>
> \entry{aa^_a}{1}{aa}{a}
> \entry{aa^_z}{3}{aa}{z}
> \entry{aah}{5}{aah}
>
> where ^_ is a 0x1F byte.

Yes, perfect, that's real easy to handle in awk.

> Using a space instead may even suffice:
>
> \entry{aa a}{1}{aa}{a}
> \entry{aa z}{3}{aa}{z}
> \entry{aah}{5}{aah}

I don't like that; if a sort key has spaces it, we're in trouble.

> * If somebody uses contradictory sort keys for the primary text: this 
> doesn't make sense, and unpredictable results are acceptable: e.g.
>
> @cindex foo @sortas{aaa} @sub one
> @cindex foo @sortas{zzz} @sub two
>
> Here the "foo" entries could be sorted as "aaa" or "zzz" and it wouldn't 
> matter much which.

Right. Garbage In, Garbage Out. No problem with that.

> * We cannot actually use @sub because this clashes with the subscript 
> command.  Using @tab or @indent instead may be a possibility.

@indent makes sense, since that's what happens on the page, but I
can live with @tab also, or something like @subind might be good too.
I don't have strong feelings, as long as it makes reasonable sense
and is easy to convert an existing entry to it.

This is starting to come together in my head, at least in terms of what
texindex will need to do.

Thanks!

Arnold



Re: Feature request: multilevel indexing for TeX

2019-02-28 Thread Gavin Smith
On Thu, Feb 28, 2019 at 04:50:38AM -0700, arn...@skeeve.com wrote:
> > I remember there were problems with the positioning of @sortas: I'd like 
> > to see if they could be fixed.
> 
> Can you elaborate?

@cindex aaa @sortas{bbb}

didn't work completely properly as it output the index entry as "bbb ", 
with a trailing space.  I've tried to fix it in commit 0539d4e

> > > Could we do \tertiary also? Or is that asking too much?
> >
> > I don't see why not, it would just require more sorting logic in 
> > texindex.
> 
> Excellent.  If you can give me a clear spec on the input and output
> to texindex I can dive into it. (When you have one, of cousre.)
> I'm pretty sure I still have committer rights to the project.

There are some questions we need to resolve:

* What happens if there is an index entry with no secondary term and an 
identical index entry with a secondary term, e.g.

@cindex foo
@cindex foo @sub bar

I think that both should be kept.  When I tested it with C texindex, one 
of them was lost in the output.

* Do we keep @defop, and the other commands in texinfo.tex currently using 
\dosubind, as creating single-level index entries?  I assume yes, even 
if it was different before: no-one to my knowledge ever complained that 
the behaviour changed, and it is more stable to keep things as they are, 
even if in the past they were possibly different.  I suspect not many 
are using these commands anyway.

* Sorting: The index auxiliary file format, with \entry, only supports a 
single index sort key.  If that is kept, what happens when index entries 
with the same primary text do not form a contiguous block within the 
sorted index, e.g.

@cindex foo @sub bar @sortas{A}
@cindex  @sortas{B}
@cindex foo @sub baz @sortas{C}

Should the entries for "foo" appear before or after those
for "" in the sorted index?

Perhaps sort keys could be generated for primary, secondary and 
tertiary entry text separately, and simply concatenated to produce the 
sort key.  @sortas would be local to each "segment", and if there was no 
@sortas command, the sort key for that segment would be generated in the 
usual way.

But simple concatenation wouldn't work: consider

@cindex aa @sub a   -- key is aaa
@cindex aa @sub z   -- key is aaz
@cindex aah -- key is aah

then the "aa" entries are split in two by the "aah" entry.

Maybe a special marker character could be output that texindex treats 
specially: e.g. the above would be output as

\entry{aa^_a}{1}{aa}{a}
\entry{aa^_z}{3}{aa}{z}
\entry{aah}{5}{aah}

where ^_ is a 0x1F byte.

Using a space instead may even suffice:

\entry{aa a}{1}{aa}{a}
\entry{aa z}{3}{aa}{z}
\entry{aah}{5}{aah}

* If somebody uses contradictory sort keys for the primary text: this 
doesn't make sense, and unpredictable results are acceptable: e.g.

@cindex foo @sortas{aaa} @sub one
@cindex foo @sortas{zzz} @sub two

Here the "foo" entries could be sorted as "aaa" or "zzz" and it wouldn't 
matter much which.

* We cannot actually use @sub because this clashes with the subscript 
command.  Using @tab or @indent instead may be a possibility.



Re: Feature request: multilevel indexing for TeX

2019-02-28 Thread arnold
Hi. Sorry for the slow reply.

Gavin Smith  wrote:

> The existing \primary macro does not take a page argument.  This could 
> be used to give you:
>
>   coffee makers
>  electric ... 32
>
> To get
>
>   coffee makers . 15, 21
>  electric ... 32
>
> you would use \entry instead of \primary.
>
> See attached files: these work with the current texinfo.tex.

Nice.

> Another idea:
>
> @cindex coffee makers @sub electric @sub pink

I like this one. It is similar to @tab in tables.

You could then do:

  @cindex @sortas{...} coffee makers @sub @sortas{...} electric @sub 
@sortas{...} pink

I.e., each term could have its own (optional) @sortas clause.

> I remember there were problems with the positioning of @sortas: I'd like 
> to see if they could be fixed.

Can you elaborate?

> > Could we do \tertiary also? Or is that asking too much?
>
> I don't see why not, it would just require more sorting logic in 
> texindex.

Excellent.  If you can give me a clear spec on the input and output
to texindex I can dive into it. (When you have one, of cousre.)
I'm pretty sure I still have committer rights to the project.

> > How do we move forward?
>
> Think of more problems that might occur and send mail about them.

See above. :-)

> Wait for me to implement it, or learn enough TeX and Perl, and enough
> about the Texinfo codebase to implement it yourself.  Otherwise it is
> quite likely I will get to this some time in the next month.

I am starting to learn about TeX. It's a hard hill to climb though...

Much thanks!

Arnold



Re: Feature request: multilevel indexing for TeX

2019-02-25 Thread Gavin Smith
On Mon, Feb 25, 2019 at 07:01:04AM -0700, arn...@skeeve.com wrote:
> So why not just make it work with @cindex?  Or do we really need
> a new command?

Existing index entries may have commas in them.

The existing \primary macro does not take a page argument.  This could 
be used to give you:

  coffee makers
 electric ... 32

To get

  coffee makers . 15, 21
 electric ... 32

you would use \entry instead of \primary.

See attached files: these work with the current texinfo.tex.

For subtopics, maybe the interface could be:

@cindex coffee makers @subtopic{electric}

and maybe for an extra level, it could be

@cindex coffee makers @subtopic{electric} @subsubtopic{pink}

or even just

@cindex coffee makers @subtopic{electric} @subtopic{pink}

(if that is easy to implement in TeX).

This would follow the pattern of the @sortas command.

Another idea:

@cindex coffee makers @sub electric @sub pink

Or maybe:

@cindex coffee makers @subtopic{electric @subtopic{pink}}

which would allow e.g.

@cindex coffee makers @subtopic{electric @subtopic{pink} @sortas{aaa}}

I remember there were problems with the positioning of @sortas: I'd like 
to see if they could be fixed.

There may be LaTeX packages that deal with similar situations; maybe we 
could take a clue from their interface.

> Could we do \tertiary also? Or is that asking too much?

I don't see why not, it would just require more sorting logic in 
texindex.

> How do we move forward?

Think of more problems that might occur and send mail about them.  Wait 
for me to implement it, or learn enough TeX and Perl, and enough about 
the Texinfo codebase to implement it yourself.  Otherwise it is quite 
likely I will get to this some time in the next month.

Thanks.


test.tex
Description: TeX document
\primary{coffee makers}
\secondary{electric}{32}

\entry{tea makers}{342}
\secondary{pink}{92}


Re: Feature request: multilevel indexing for TeX

2019-02-25 Thread arnold
Hi. Thanks for the answer.

Gavin Smith  wrote:

> On Thu, Feb 21, 2019 at 03:08:30AM -0700, arn...@skeeve.com wrote:
> > I have a feature request, please. It relates to indexing in texinfo.tex.
> > Packages like LaTeX and professional publishing packages provide for
> > multiple levels of index entries, usually up to three keys. For example
> > 
> > coffee makers . 15, 21
> >electric ... 32
> >   pink  45
> > 
> > I would very much like to see this available in texinfo.tex. In
> > the gawk manual I have up to three items, separated by commas; if
> > more are needed for what I want to say, I use @comma{}.
> > 
> > I took a look a texinfo.tex to see what's there for this kind of thing.
> > I'm not at all a TeX hacker, but it looks like there's some half-completed
> > support for two levels of items (not three).  Sort of like someone
> > thought about it, but it doesn't seem to have been carried through.
>
> If my understanding is correct, this code used to be used for some 
> of the commands for indexing methods in object-oriented languages, like 
> @defop, but these were changed long ago.  Possibly in the change on
> 2001-02-02 in the ChangeLog.
>
> 2001-02-02
>
> * texinfo.tex (\secondary): handle pdf case.
> (\dosubind): secondary index entry not written as separate arg for
> texindex.
> From: Trevin Beattie 
> Date: Tue, 21 Mar 2000 13:04:06 -0700
>
> I've attached the mail for historical interest, which Karl provided to me.
>
> The C implementation of texindex did actually sort \primary and \secondary
> correctly last time I checked (some years ago).

I took a quick look. It looks like the output was

\entry ...
\primary ...
\secondary ...
\secondary ...
\secondary ...

> > For backwards compatibility, this would probably have to be done as
> > a new command, something like
> > 
> > @cindex2 {coffee makers}{electic}{pink}
> > 
> > or more likely:
> > 
> > @cindex2{coffee makers, electic, pink}
> > 
> > (Yes, that's a bad name, it's just an example for discussion.)
>
> I think @cindextwo (no digits in TeX macro names) could be called as
>
> @cindextwo coffee makers, electic, pink
>
> This would be consistent with the arguments to @node, which are also separated
> by commas.  But let's make sure that the interface is as consistent as 
> possible
> with other Texinfo commands.

So why not just make it work with @cindex?  Or do we really need
a new command?

> > I would be willing to update texindex to support multiple sort
> > keys if this would help.  Unfortunately, I don't think I can help
> > with the TeX part or the makeinfo part.
>
> I think it should work with \primary and \secondary the same as C texindex 
> did.

Could we do \tertiary also? Or is that asking too much?

> I don't think implementing it would be too much of a barrier.  The more
> important thing is to get the interface right.
>
> > Does all this make sense?  Is it something that can be added to
> > the TODO list?
>
> Yes, I don't see why not.

How do we move forward?

Thanks!

Arnold



Re: Feature request: multilevel indexing for TeX

2019-02-21 Thread Gavin Smith
On Thu, Feb 21, 2019 at 03:08:30AM -0700, arn...@skeeve.com wrote:
> I have a feature request, please. It relates to indexing in texinfo.tex.
> Packages like LaTeX and professional publishing packages provide for
> multiple levels of index entries, usually up to three keys. For example
> 
>   coffee makers . 15, 21
>  electric ... 32
>   pink  45
> 
> I would very much like to see this available in texinfo.tex. In
> the gawk manual I have up to three items, separated by commas; if
> more are needed for what I want to say, I use @comma{}.
> 
> I took a look a texinfo.tex to see what's there for this kind of thing.
> I'm not at all a TeX hacker, but it looks like there's some half-completed
> support for two levels of items (not three).  Sort of like someone
> thought about it, but it doesn't seem to have been carried through.

If my understanding is correct, this code used to be used for some 
of the commands for indexing methods in object-oriented languages, like 
@defop, but these were changed long ago.  Possibly in the change on
2001-02-02 in the ChangeLog.

2001-02-02

* texinfo.tex (\secondary): handle pdf case.
(\dosubind): secondary index entry not written as separate arg for
texindex.
From: Trevin Beattie 
Date: Tue, 21 Mar 2000 13:04:06 -0700

I've attached the mail for historical interest, which Karl provided to me.

The C implementation of texindex did actually sort \primary and \secondary
correctly last time I checked (some years ago).

> For backwards compatibility, this would probably have to be done as
> a new command, something like
> 
>   @cindex2 {coffee makers}{electic}{pink}
> 
> or more likely:
> 
>   @cindex2{coffee makers, electic, pink}
> 
> (Yes, that's a bad name, it's just an example for discussion.)

I think @cindextwo (no digits in TeX macro names) could be called as

@cindextwo coffee makers, electic, pink

This would be consistent with the arguments to @node, which are also separated
by commas.  But let's make sure that the interface is as consistent as possible
with other Texinfo commands.

> I would be willing to update texindex to support multiple sort
> keys if this would help.  Unfortunately, I don't think I can help
> with the TeX part or the makeinfo part.

I think it should work with \primary and \secondary the same as C texindex did.

I don't think implementing it would be too much of a barrier.  The more
important thing is to get the interface right.

> Does all this make sense?  Is it something that can be added to
> the TODO list?

Yes, I don't see why not.
>From gnuli...@mescaline.gnu.org  Tue Mar 21 15:10:25 2000
Status: RO
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
[nil nil nil nil nil nil nil "Trevin Beattie" "tre...@eyring.com" nil 
nil nil "^Date:" nil nil nil "232120:04:06" nil nil nil nil]
nil)
X-VM-Summary-Format: "%n %*%a %-17.17F %-3.3m %2d %4l/%-5c %I\"%s\"\n"
X-VM-Labels: nil
X-VM-VHeader: ("Date:" "From:" "Apparently-To:" "To:" "Cc:" "Subject:") nil
X-VM-Last-Modified: (14552 53581 78344)
X-VM-IMAP-Retrieved: nil
X-VM-POP-Retrieved: nil
X-VM-Bookmark: 2
Return-Path: 
Received: from cs.umb.edu (r...@cs.umb.edu [158.121.104.2])
by freefriends.org (8.9.3/8.9.3) with ESMTP id PAA29764
for ; Tue, 21 Mar 2000 15:10:24 -0500
Received: from mescaline.gnu.org 
(we-refuse-to-spy-on-our-us...@mescaline.gnu.org [158.121.106.21])
by cs.umb.edu (8.8.8/8.8.8) with ESMTP id PAA08091
for ; Tue, 21 Mar 2000 15:10:33 -0500 (EST)
Received: (from slist@localhost)
by mescaline.gnu.org (8.9.1a/8.9.1) id PAA05759
for texinfo-maintainers; Tue, 21 Mar 2000 15:10:28 -0500
Resent-Date: Tue, 21 Mar 2000 15:10:28 -0500
Received: from nanook.eyring.com (nanook.eyring.com [192.77.10.202])
by mescaline.gnu.org (8.9.1a/8.9.1) with ESMTP id PAA05469
for ; Tue, 21 Mar 2000 15:04:21 -0500
Received: from trevin (trevin.eyring.com [192.77.10.241])
by nanook.eyring.com (8.9.3/8.9.3) with SMTP id NAA09024
for ; Tue, 21 Mar 2000 13:04:13 -0700 (MST)
Message-Id: <3.0.5.32.2321130406.00921...@eyring.com>
X-Sender: tre...@eyring.com
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Resent-Message-ID: <"p_AJR3.0.rL1.DNzru"@mescaline.gnu.org>
Resent-From: bug-texinfo@gnu.org
X-Mailing-List:  archive/latest/778
X-Loop: bug-texinfo@gnu.org
Precedence: list
Resent-Sender: bug-texinfo-requ...@gnu.org
Date: Tue, 21 Mar 2000 13:04:06 -0700
From: Trevin Beattie 
To: bug-texinfo@gnu.org
Subject: PDF destinations are in the wrong place

I prefer to use Acrobat Reader for viewing online documentation (it looks
prettier), so I have used pdftex to format all of our Gnu documentation
into PDF files.  One thing that I find very annoying in all of them is that
all of the hyperlinks (both cross-references and bookmarks) send 

Feature request: multilevel indexing for TeX

2019-02-21 Thread arnold
Hi.

I have a feature request, please. It relates to indexing in texinfo.tex.
Packages like LaTeX and professional publishing packages provide for
multiple levels of index entries, usually up to three keys. For example

coffee makers . 15, 21
   electric ... 32
  pink  45

I would very much like to see this available in texinfo.tex. In
the gawk manual I have up to three items, separated by commas; if
more are needed for what I want to say, I use @comma{}.

I took a look a texinfo.tex to see what's there for this kind of thing.
I'm not at all a TeX hacker, but it looks like there's some half-completed
support for two levels of items (not three).  Sort of like someone
thought about it, but it doesn't seem to have been carried through.

For backwards compatibility, this would probably have to be done as
a new command, something like

@cindex2 {coffee makers}{electic}{pink}

or more likely:

@cindex2{coffee makers, electic, pink}

(Yes, that's a bad name, it's just an example for discussion.)

I suspect that makeinfo could rewrite

@cindex2 {coffee makers}{electic}{pink}

as:

@cindex coffee makers, electic, pink

and things would be happy for Info and HTML; DocBook could certainly
leverage multilevel indexing since it has something like

coffee makers
   electric
   pink

I would be willing to update texindex to support multiple sort
keys if this would help.  Unfortunately, I don't think I can help
with the TeX part or the makeinfo part.

Does all this make sense?  Is it something that can be added to
the TODO list?

Please cc me on replies, as I'm not on this list.

Much thanks!

Arnold