[l2h] custom_titles affects counters in image file
Dr Nicola L C Talbot
nlct at cmp.uea.ac.uk
Tue Jan 15 11:59:21 CET 2008
Hi Ross,
Thanks for your reply.
On Tue, 15 Jan 2008, Ross Moore wrote:
> Yes, that may be so.
> But with serious mathematics, you should be using the advanced
> mathematics features that parse equations for their structure,
> rather than making images.
>
I'm not doing any serious mathematics for this document ;-) It's for my
on-line beginners LaTeX tutorial, and I wanted images to illustrate
exactly how the example output will appear in the document. (There is also
a PDF version of the document, but not everyone can read PDF. I've turned
the more complicated images into links to a page describing the image for
users who can't see the images - I'm trying to find the balance between
showing exactly how LaTeX code is typeset, whilst ensuring accessibility
and browser independence.)
The following fix works for my document (although I'm not sure if it will
work in general)
sub make_name {
local($sec_name, $packed_curr_sec_id) = @_;
local($title,$making_name,$saved) = ('',1,'');
if ($LONG_TITLES) {
$saved = $_;
&set_sectioning_title($_) if /^$sections_rx/; # modified
$title = &make_long_title($TITLE)
unless ((! $TITLE) || ($TITLE eq $default_title));
$_ = $saved;
} elsif ($CUSTOM_TITLES) {
$saved = $_;
&set_sectioning_title($_) if /^$sections_rx/; # modified
$title = &custom_title_hook($TITLE)
unless ((! $TITLE) || ($TITLE eq $default_title));
$_ = $saved;
}
if ($title) {
#ensure no more than 32 characters, including .html extension
$title =~ s/^(.{1,27}).*$/$1/;
++$OUT_NODE;
join("", ${PREFIX}, $title, $EXTN);
} else {
# Remove 0's from the end of $packed_curr_sec_id
$packed_curr_sec_id =~ s/(_0)*$//;
$packed_curr_sec_id =~ s/^\d+$//o; # Top level file
join("",($packed_curr_sec_id ?
"${PREFIX}$NODE_NAME". ++$OUT_NODE : $sec_name), $EXTN);
}
}
sub set_sectioning_title{
local($_) = @_;
if (/$section_rx/)
{
($before, $cmd, $after) = ($`, $1.$2, $4.$');
if (defined($unnumbered_section_commands{$cmd}))
{
&process_command($section_rx, $_[0]);
}
else
{
local($align, $dummy) = &get_next_optional_argument;
$TITLE = &missing_braces
unless $after=~s/$next_pair_rx/$TITLE=$2;''/eo;
}
$br_id = ++$global{'max_id'};
$TITLE = &translate_environments("$O$br_id$C$TITLE$O$br_id$C");
$TITLE = &simplify($TITLE);
}
}
Thanks for your advice.
Regards
Nicola Talbot
____________________________________________
Dr Nicola Talbot
School of Computing Sciences
University of East Anglia
Norwich. NR4 7TJ. UK
web : http://theoval.cmp.uea.ac.uk/~nlct/
email : nlct at cmp.uea.ac.uk
More information about the latex2html
mailing list