[l2h] Section numbering patch

Bruce Miller bruce.miller@nist.gov
Tue, 23 Jan 2001 12:58:55 -0500


Hi Ross; Hi All;
  I've been using $SHOW_SECTION_NUMBERS.   Getting section numbers from
the aux
file is problematic because it uses the title text as the hash key; 
sections (at different parts of the tree) can legitimately have the same
title.

However, l2h prefers the appropriate \thesection command, if one has
been defined.
So that should be ok ... well almost.  Unfortunately, if \thesection
returns an 
empty value, it still falls back to the aux data (getting the wrong
number).

I'd suggest rewriting this portion of do_cmd_section_helper:
    $thehead = ((defined &$thehead)||(defined &$whead)
	? &translate_commands("\\the$key") : '');
    $thehead .= $SECNUM_PUNCT
	if ($SECNUM_PUNCT &&($thehead)&& !($thehead =~ /\./));
    $section_number = $thehead if (($thehead)&&($SHOW_SECTION_NUMBERS));
as follows:
    if((defined &$thehead)||(defined &$whead)){
      $thehead = &translate_commands("\\the$key");
      $thehead .= $SECNUM_PUNCT
	if ($SECNUM_PUNCT &&($thehead)&& !($thehead =~ /\./));
      $section_number = $thehead if ($SHOW_SECTION_NUMBERS);

Does that work for you?

-----------
Bruce Miller
<bruce.miller@nist.gov>  http://math.nist.gov/~BMiller/