On May 21, 4:29pm, John Turner wrote:
> Note the misnumbering of Appendix Glop in the TOC and in its own
> heading. The reference, however, correctly appears as A.
I had the same problem; L2h gets labels from internal counters sometimes and
uses the ones from the *.aux file other times.
The following redefinition seems to work by doing the same things LaTeX does:
redefines \thesection (or \thechapter) to use \Alph and resets the counter.
There's 2 (potential) catches:
1) It should only affect \thesection for article styles or \thechapter for
book styles. But how to tell which is the case? The best I could find was
using $outermost_level and hope the user structured the doc `right'.
2) I was worried that reseting the counter would screw up L2h's bookkeeping
(the keys it uses to record various sectional units), but apparently l2h
increments those separately. Ross was once trying to explain to me why the
counters & keys could get `out of sync'; I think he was trying to tell me it
was for my own good, but I didn't believe him at the time! :>
sub do_cmd_appendix {
$latex_body .= "\\appendix\n";
# This is a gamble: It should ONLY be chapter (for book) or section (for
article)!!!
local $key= $outermost_level;
local $cmd="the$key";
eval <<EODef;
sub do_cmd_$cmd {
local(\$after, *open_tags) = \@_;
&do_cmd_Alph(\"<<0>>$key<<0>>\").\$after; };
EODef
print STDERR "\n*** sub do_cmd_$cmd failed:\n$@\n" if ($@);
$global{$key} = 0; # is this safe ?!?
# would do_cmd_setcounter be preferable?
$_[0];
}
--
--
[EMAIL PROTECTED]
http://math.nist.gov/~BMiller/