[l2h] Including fields in the head section
Ross Moore
ross@ics.mq.edu.au
Fri, 16 Nov 2001 07:11:37 +1100 (EST)
Hi Jaime,
You wrote:
> And i tried to redefine it in my .latex2html-init as:
>
> 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" .
> "<LINK REL=\"STYLESHEET\" HREF=\"/estilos/general.css\">\n"
> } if $_;
> }
>
> As you can notice i'm trying to add my site general style sheet to the
> generated documents, but it does not works. How can i achieve that and, if
LaTeX2HTML already has a mechanism for linking to stylesheets.
There is the $STYLESHEET variable, which (like many other variables) can
be set either on the command-line: -style "style sheet name"
or in an initialisation file.
By the way, after redefining meta_information as above,
did you look at the HTML source ?
I suspect that it ended up with 2 <LINK> tags for .css style-sheets.
> As you can notice i'm trying to add my site general style sheet to the
> generated documents, but it does not works. How can i achieve that and, if
> it is not possible, why don't you (latex2html developers) redefine this
> function as something like:
>
> 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" .
> $EXTRA_HEADING_INFO
> } if $_;
> }
>
> So we (latex2html users) can define $EXTRA_HEADING_INFO in our
> .latex2html-init files to something like:
>
> $EXTRA_HEADING_INFO='<link REL="STYLESHEET"
> HREF="/estilos/general.css">\n'
This ability is already built-in.
The variable to use is called: $LATEX2HTML_META .
It comes *after* all the other meta-informatin that is generated
by routines that come with LaTeX2HTML, but before the stylesheet;
viz. (from latex2html.pin):
join("\n", (($DOCTYPE)? $DTDcomment : '' )
,"<!--Converted with LaTeX2HTML $TEX2HTMLVERSION"
, "original version by: Nikos Drakos, CBLU, University of Leeds"
, "* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan"
, "* with significant contributions from:"
, " Jens Lippmann, Marek Rouchal, Martin Wilck and others"
. " -->\n<HTML>\n<HEAD>\n<TITLE>".$title."</TITLE>"
, &meta_information($title)
, ($CHARSET && $HTML_VERSION ge "2.1" ?
"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=$this_charset\">"
: "" )
, $LATEX2HTML_META
, ($BASE ? "<BASE HREF=\"$BASE\">" : "" )
, $STYLESHEET_CASCADE
, ($STYLESHEET ? "<LINK REL=\"STYLESHEET\" HREF=\"$STYLESHEET\">" : '' )
, $more_links_mark
, "</HEAD>" , ($before_body? $before_body : '')
, "<BODY $body>", '');
}
Notice that there are 4 ways to add extra stuff in the <HEAD> section:
a. redefine &meta_information
b. provide whatever you like as: $LATEX2HTML_META
c. provide whatever you like as: $STYLESHEET_CASCADE
d. give a file name to $STYLESHEET
The $more_links_mark indicates where the automatically-generated <LINK> tags
will be placed, once these have been constructed from the document's structure.
Hope this helps,
Ross Moore
>
> --
> Jaime Alberto Silva Colorado
> Administrador servidores Linux
> grupo DESOFMAT
> Universidad Tecnológica de Pereira
> ICQ# 75722794
> AOL Messenger screen name: el mono jaime
> _______________________________________________
> latex2html mailing list
> latex2html@tug.org
> http://tug.org/mailman/listinfo/latex2html