[l2h] Index entries include trailing format specifications such as '|textbf'

Julius Smith jos@w3k.org
Sun, 28 Oct 2001 13:09:45 -0800

I discovered that index entries including a format specification, such as


produce keys in the HTML index including the format spec, i.e., 
"keyword|textbf" appears in the final Index.html entries generated by 
latex2html.  This problem does not appear to occur when the makeidx package 
is used (invoking styles/makeidx.perl).  Below is a one-line fix that works 
in all cases I have tested:

*** latex2html~	Fri Sep 28 14:17:52 2001
--- latex2html	Sun Oct 28 12:30:44 2001
*** 8322,8327 ****
--- 8322,8328 ----
   	$str = $current[$#current];
   	$str =~ s/\#\#\#\d+$//o; # Remove the unique id's
+ 	$str =~ s/\|(.*)$//; # Remove any trailing macro wrapper spec (NEW)
   	$index .= $index{$key} .
   	    # If it's the same string don't start a new line
   	    (&index_key_eq(join('',@current), join('',@previous)) ?

Note that page 154 of Lamport (1994) gives some "fine print" about the 
behavior of '|' in an index entry.  E.g., it can be quoted by a preceding 
`"' unless the `"' is preceded by `\'.  Since this fine print does not seem 
to be supported for `!', I didn't try to add it here.  Due to prior 
transformations on the index key strings, it would take 	a bit of research 
to get this right.