[l2h] style-sheet question

Ross Moore ross@ics.mq.edu.au
Thu, 28 Mar 2002 12:30:22 +1100 (EST)


> Hi,
> 
> is there a commandline option to LaTeX2HTML
> to include the generated style-sheet into
> the html document(s) instead of linking it
> from an extra file?

There is no explicit option for this, but there is a Perl
hook which you can use.

There is a subroutine  meta_information  defined in
 l2hconf.pin  as follows:

### Meta Information #####################################################
#
# This information will be inserted in the HEAD of the generated
# HTML file. It can be used by automatic indexing scripts (eg
# site-index.pl at http://www.ai.mit.edu/tools/site-index.html)
# You can change the description, keywords, etc. values.
#
sub meta_information {
    local($_) = @_;
    # Cannot have nested HTML tags...
    do { s/<[^>]*>//g;
        "<META NAME=\"description\" CONTENT=\"$_\">\n" .
        "<META NAME=\"keywords\" CONTENT=\"$FILE\">\n" .
        "<META NAME=\"resource-type\" CONTENT=\"document\">\n" .
        "<META NAME=\"distribution\" CONTENT=\"global\">\n"
    } if $_;
}

This is called as  &meta_information($title)  where the single parameter 
 $title  is the filename of your document without any suffix.


It gets called when the page header information is being constructed;
this is after the contents have been finalised.

The fact that this subroutine is defined within  l2hconf.pin
is meant to imply that you can customise it there.

Alternatively, you can override its definition within a 
 .latex2html-init  file, either for specific jobs or for
all jobs at a site, or all jobs by a specific user.

For example, if you don't want any of that default information,
and you want to suppress the stylesheet link, then use simply:


sub meta_information { $STYLESHEET = ''; }


Or to keep the above <META> tags, but kill the stylesheet link,
use:

sub meta_information {
    local($_) = @_;
    $STYLESHEET = '';
    # Cannot have nested HTML tags...
    do { s/<[^>]*>//g;
        "<META NAME=\"description\" CONTENT=\"$_\">\n" .
        "<META NAME=\"keywords\" CONTENT=\"$FILE\">\n" .
        "<META NAME=\"resource-type\" CONTENT=\"document\">\n" .
        "<META NAME=\"distribution\" CONTENT=\"global\">\n"
    } if $_;
}


 
> If not, perhaps take this as a suggestion to
> implement that feature ;-) 

There is no need to implement anything new.
With the above subroutine hook you can organise a large part
of the header information in whatever way you please.

Defining a new option would be a limiting, cumbersome way to
tackle the problem, when a general method already exists.

 
> Including the style-sheet into the html document
> could be the default with LaTeX2HTML option
> "-split 0".

No; such defaults should not be changed at this late stage.
You can (and *should*) customise for the special requirements
of your own site, using the methods that are already available.


> In my special case, I need a *single* html file
> which I can give away to others for information
> purposes, so I am using option "-split 0". It is
> a bit annoying that I always have to send them
> two files (the html and the css file), especially
> as the css file is nearly empty. In fact,
> I removed the link to the css file from my
> html document by hand, and it still works fine.
> 
> Thanks for your response!


Hope this helps,

	Ross Moore

 
> Best regards
> Ulrich
> 
> -- 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  Ulrich Gruenebaum (grueneba@zkom.de)
>  Tel. +49/(0)231/9700-337
>  FAX  +49/(0)231/9700-474
> 
>  ZKOM GmbH
>  State Diagnostic Systems and Computer Networks
>  Joseph-von-Fraunhofer-Str. 20
>  D-44227 Dortmund (Germany)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> _______________________________________________
> latex2html mailing list
> latex2html@tug.org
> http://tug.org/mailman/listinfo/latex2html