bugtex4ht - Bugs: bug #146, index: div theindex is starting...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #146: index: div theindex is starting too late

Submitted by:  Akim Demaille <akim>
Submitted on:  Thu Sep 1 11:49:05 2011  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: CV Radhakrishnan <cvr>
Open/Closed: Open

Tue Sep 6 09:06:35 2011, comment #4:

Dear CV,

Thanks for the answer. Your latest proposal is much better, but there are still flaws.

First of all, when the ist is using \subsection*, the structure of the generated HTML file is broken and hard to read because of all the noindent stuff:

<h3 class="likesectionHead"><a id="x1-1000"></a>Index</h3>
<div class="index">
<!--l. 2--><p class="noindent" ></p>
<h4 class="likesubsectionHead"><a id="x1-2000"></a>A</h4>
<p class="idx">AA, <a href="index-headings.html#x1-2" >1</a></p>
<p class="idx">AB, <a href="index-headings.html#x1-3" >2</a></p>
<p class="idxsp"></p>
<h4 class="likesubsectionHead"><a id="x1-3000"></a>B</h4>
<p class="idx">
<!--l. 8-->
<p class="noindent">BA, <a href="index-headings.html#x1-4" >3</a></p>
<p class="idx">BB, <a href="index-headings.html#x1-5" >4</a></p>
<p class="idxsp"></p>
</p>
<!--l. 12--><p class="noindent" ></p>
<h4 class="likesubsectionHead"><a id="x1-4000"></a>C</h4>
<p class="idx">
<!--l. 13-->
<p class="noindent">CA, <a href="index-headings.html#x1-6" >5</a></p>
<p class="idx">CB, <a href="index-headings.html#x1-7" >6</a></p>
</div>
</p>

So really I think using \subsection* is smart and consistent with the expected output, but wrong for tex4ht, so I prefer an ist file as follows:

headings_flag 1
heading_prefix "\\textbf\{\\Large{}"
heading_suffix "\}"

which generates a more readable output (I can easily use a fresh macro instead of \textbf\Large to provide more configurability, like subsection* but without all the messing around noindent; that's really not the point here):

<h3 class="likesectionHead"><a id="x1-1000"></a>Index</h3>
<div class="index">
<!--l. 2--><p class="noindent" >
<span class="cmbx-12x-x-120">A</span>
<p class="idx">AA, <a href="index-headings.html#x1-2" >1</a> </p>
<p class="idx">AB, <a href="index-headings.html#x1-3" >2</a> </p>
<p class="idxsp"></p>
<span class="cmbx-12x-x-120">B</span>
<p class="idx">BA, <a href="index-headings.html#x1-4" >3</a> </p>
<p class="idx">BB, <a href="index-headings.html#x1-5" >4</a> </p>
<p class="idxsp"></p>
<span class="cmbx-12x-x-120">C</span>
<p class="idx">CA, <a href="index-headings.html#x1-6" >5</a> </p>
<p class="idx">CB, <a href="index-headings.html#x1-7" >6</a> </p>
</div>
</p>

Yet, as you can see, the structure is still broken: <div class="index"><p>...</div></p>.

Thanks again.

Attached another version of the tarball (index-headings-2011-09-06.tar.bz2), with the current status of the files.

(file #110)

Akim Demaille <akim>
Sat Sep 3 10:26:09 2011, comment #3:

Dear Akim,

It is perfectly OK to call me, CV or CVR or whatever is convenient to you.

I got your problem precisely. For some reason, the first heading gets out of the <div class="idx">. We might now employ another configure hook:

We will nullify the first two hooks of \Configure{theindex}

\Configure{theindex}
{}%\Tg<div class="idx">} % before env
{}%\Tg</div>} % after env
{\Tg<p class="idx">} % before item
{\Tg</p>} % after item
{\Tg<p class="subidx">} % before subitem
{\Tg</p>} % after subitem
{\Tg<p class="ssubidx">} % before subsubitem
{\Tg</p>} % after subsubitem
{\Tg<p class="idxsp">\Tg</p>} % at-index space

Instead, we will use:

\ConfigureEnv{theindex}{\Tg<div class="index">}
{\Tg</div>}
{}{}

With the new setup, I got the following result which was what you wanted:

<h3 class="likesectionHead"><a id="x1-1000" name=
"x1-1000"></a>Index</h3>

<div class="index">
<p class="noindent"></p>
<h4 class="likesubsectionHead"><a id="x1-2000" name=
"x1-2000"></a>A</h4>
<p class="idx">AA, <a href="index-headings.html#x1-2">1</a></p>

...
...
<h4 class="likesubsectionHead"><a id="x1-5000" name=
"x1-5000"></a>I</h4>
<p class="idx"><!--l. 18--></p>
<p class="noindent">index-headings.html, <a href=
"index-headings.html#x1-2">7</a>, <a href=
"index-headings.html#x1-4">8</a>, <a href=
"index-headings.html#x1-6">9</a></p>
</div>

Hope, this helps you.

CV Radhakrishnan <cvr>
Project AdministratorIn charge of this item.
Fri Sep 2 08:45:56 2011, comment #2:

Hi CV (is this the right way to name you?)

while your suggestion definitely provides something better that what I did, it does not change what I mean to report as a bug.

The diff looks like:

@@ -28,23 +28,33 @@
id="x1-7"></a>
<h3 class="likesectionHead"><a
id="x1-1000"></a>Index</h3>
-<!--l. 2--><p class="noindent" ><span
-class="cmbx-12x-x-120">A</span> </p><div class="theindex"><span class="index-item">AA, <a
+<!--l. 2--><p class="noindent" >
+</p>
+ <h4 class="likesubsectionHead"><a
+ id="x1-2000"></a>A</h4>
+ <div class="theindex"><span class="index-item">AA, <a
href="#x1-2" >1</a> <br /></span>
<span class="index-item">AB, <a
href="#x1-3" >2</a> <br /></span>
-<p class="theindex"><span
-class="cmbx-12x-x-120">B</span> <span class="index-item">BA, <a
+<p class="theindex">
+ <h4 class="likesubsectionHead"><a
+ id="x1-3000"></a>B</h4>
+<span class="index-item">BA, <a
href="#x1-4" >3</a> <br /></span>

What I'm reporting is that the structure is

<h3 class="likesectionHead"><a id="x1-1000"></a>Index</h3>
<p class="noindent" ></p>
<h4 class="likesubsectionHead"><a id="x1-2000"></a>A</h4>
<div class="theindex">
<span class="index-item">AA, <a href="#x1-2" >1</a> <br /></span>
<span class="index-item">AB, <a href="#x1-3" >2</a> <br /></span>
<p class="theindex">
<h4 class="likesubsectionHead"><a id="x1-3000"></a>B</h4>
<span class="index-item">BA, <a href="#x1-4" >3</a> <br /></span>
<p class="noindent" >
<span class="index-item">BB, <a href="#x1-5" >4</a> <br /></span>
</p>
<p class="theindex">
</p>

I.e. in the case of the first heading (A), it is outside its theindex environment:

while in the case of the others, the heading (B) is inside. Actually, looking at the output, the result is more confusing with subsection* because of all the "noindent" that are then output. Of course, I can define a new command and Configure it, but really, that's not the problem here. The problem is the structure: there are one theindex per non-first heading which embedded in a global theindex corresponding to the first heading.

I don't know how to describe simply :( You really have to look at the structure here:

<h3 class="likesectionHead"><a id="x1-1000"></a>Index</h3>
<p class="noindent" >
<span class="cmbx-12x-x-120">A</span>
</p>
<div class="theindex">
<span class="index-item">AA, <a href="#x1-2" >1</a> <br /></span>
<span class="index-item">AB, <a href="#x1-3" >2</a> <br /></span>
<p class="theindex">
<span class="cmbx-12x-x-120">B</span>
<span class="index-item">BA, <a href="#x1-4" >3</a> <br /></span>
<span class="index-item">BB, <a href="#x1-5" >4</a> <br /></span>
</p>
<p class="theindex">
<span class="cmbx-12x-x-120">C</span>
<span class="index-item">CA, <a href="#x1-6" >5</a> <br /></span>
<span class="index-item">CB, <a href="#x1-7" >6</a> <br /></span>
</p>
</div>

Cheers!

Akim Demaille <akim>
Fri Sep 2 06:55:40 2011, comment #1:

If you change the index-headings.ist to the following:

heading_prefix "\\subsection*\{"
heading_suffix "\}"

It will change the style of tagging the index headings with the possibility of fine control.

And you may also make use of the configure hooks for 'theindex' environment which is given below:

\Configure{theindex}
{\Tg<div class="idx">} % before env
{\Tg</div>} % after env
{\Tg<p class="idx">} % before item
{\Tg</p>} % after item
{\Tg<p class="subidx">} % before subitem
{\Tg</p>} % after subitem
{\Tg<p class="ssubidx">} % before subsubitem
{\Tg</p>} % after subsubitem
{\Tg<p class="idxsp">\Tg</p>} % at-index space

Hope this should solve your problem.

CV Radhakrishnan <cvr>
Project AdministratorIn charge of this item.
Thu Sep 1 11:49:05 2011, original submission:

Hi!

When generating an index with headings (i.e., a Capital "A" starting the list of all the entries starting with A, then "B" etc.), the first heading is not part of the class theindex, which is troublesome to make a nice CSS.

If you run "make" in the following tarball, you'll have an index-heading.html file which includes the following piece of HTML (edited to be more readable):

{{{
<h3 class="likesectionHead"><a id="x1-1000"></a>Index</h3>
<!--l. 2-->
<p class="noindent"><span class="cmbx-12x-x-120">A</span> </p>
<div class="theindex">
<span class="index-item">AA, <a href="#x1-2" >1</a> <br /></span>
<span class="index-item">AB, <a href="#x1-3" >2</a> <br /></span>
<p class="theindex"><span class="cmbx-12x-x-120">B</span>
<span class="index-item">BA, <a href="#x1-4" >3</a> <br /></span>
<span class="index-item">BB, <a href="#x1-5" >4</a> <br /></span>
</p>
<p class="theindex"><span class="cmbx-12x-x-120">C</span>
<span class="index-item">CA, <a href="#x1-6" >5</a> <br /></span>
<span class="index-item">CB, <a href="#x1-7" >6</a> <br /></span>
</p>
</div>
}}}

As you can see, the first heading is handled in a very different way.

Thanks a lot!

Akim Demaille <akim>

 

Attached Files
file #110:  index-headings-2011-09-06.tar.bz2 added by akim (1000B - application/x-bzip2 - Updated tarball that exhibits the bad structure)
file #109:  index-headings.tar.bz2 added by akim (773B - application/x-bzip2)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cvr (Updated the item)
  • -unavailable- added by akim (Submitted the item)
  • -unavailable- added by akim
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    5 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Sep 6 09:06:35 2011akimAttached File-=>Added index-headings-2011-09-06.tar.bz2, #110
    Fri Sep 2 06:57:27 2011cvrStatusNone=>Fixed
    Fri Sep 2 06:28:18 2011cvrAssigned toNone=>cvr
    Thu Sep 1 11:49:05 2011akimAttached File-=>Added index-headings.tar.bz2, #109
      Carbon-Copy-=>Added -unavailable-
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray