Hi again Jonathan,
> 
> Hi, I am new to this list, so please let me know if this is a FAQ: it has
> been asked in the mailing-list archive, but never answered.
> 
> Simply, I want to have latex2html produce JavaScript as part of it's
> output. The JavaScript code must appear between the <HEAD> and </HEAD>
> tags to be interpreted correctly. (How) can I achieve this? I have written
> a "my-style.perl" file which outputs the JavaScript okay, but is there a
> way to get it to go in the document header? At the moment I have to
> post-edit the HTML.
> 

My previous reply tells of an easy way to put a constant string
on all HTML pages of a document.

The easiest way to put something that varies with each page
is to redefine the  &replace_morelinks  subroutine,
which currently is defined as follows:

sub replace_morelinks {
    $_ =~ s/$more_links_mark/$more_links/e;
}

This is what is used to put the  <LINK ...> tags into the <HEAD>....</HEAD>

e.g. override it as follows, within your  my-style.perl  or elsewhere:

sub replace_morelinks {
    $_ =~ s/$more_links_mark/$more_links."\n".&java_script_header()/e;
}
sub java_script_header {
       ....  code to produce the desired header ...
}


I'll leave it to you to work out appropriate customised values;
e.g. name of the current/next/previous HTML pages, etc.
which are accessible at this point.  ;-)


All the best.

        Ross Moore

Reply via email to