[l2h] Adding html-code to the <HEAD> section

Ross Moore Ross Moore <ross@ics.mq.edu.au>
Tue, 3 Oct 2000 12:46:37 +1100 (EST)

> At 06:17 PM 3/1/2000 +0100, Thomas Anders wrote:
> >On Mar 1, 17:33, uliw@erdw.ethz.ch wrote:
> > > I wonder whether it is possible to add abitrary code (e.g. JavaScript),
> > > which is defined inside a latex-document, into the <HEAD> section of
> > > the generated html-doc? I looked through the manual, but without any
> > > luck...
> >
> >Define your own subroutine "meta_information" (use the one in
> >latex2html.config as a template) or use the variable $LATEX2HTML_META
> >(although I haven't tried the latter yet).
> In v99.2 beta 6, setting $LATEX2HTML_META cancels the existing setting, 
> which is (from latex2html.pin)
> v'.$TEX2HTMLV_SHORT.'">'
>          . "\n<META HTTP-EQUIV=\"Content-Style-Type\" CONTENT=\"text/css\">"
>                unless ($LATEX2HTML_META);
> Similarly, overriding &meta_information() seems to require rewriting the 
> whole thing.  It seems that what we really need is a new variable 
> $LATEX2HTML_META_HOOK and/or something like
>      . &custom_META_hook($_) if (defined &custom_META_hook)
> in the existing meta_information sub.

$LATEX2HTML_META  *is* the hook for this.

The default is constant (apart from the version of LaTeX2HTML)
so if you want something different, just put that into your
 .latex2html-init  file.

If you want the default + something extra, 
then just put Perl code into  .latex2html-init  that appends
to the default value (copied into your init file).

There are 3 other places where you can alter what goes into
the header:

 &meta_information(...)   Perl subroutine, taking $title as parameter
			called before a page is built
(use the existing one in  l2hconf.pm  as a template).

 $STYLESHEET_CASCADE   (default is empty)

 &replace_morelinks()     no parameter,
			called after a page has been built

(this subroutine replaces the $more_links_mark with  $more_links,
which is a collection of <LINK> tags, built-up for each HTML page.)
You could write an alternative subroutine that places these links,
as well as putting other things either before or after.
This can be used for information that is dependent upon other
material on the HTML page; that is, information that may not
have been available before the page has been processed.

Thus there are 2 variables and 2 subroutines that can be used
to affect what goes into the <HEAD> section.
I really don't see any need for more than this.

Hope this helps,

	Ross Moore

> Julius