[l2h] \htmlmeta usage for META "keywords" in html?

Ross Moore Ross Moore <ross@ics.mq.edu.au>
Tue, 28 Nov 2000 15:08:47 +1100 (EST)


> For inserting <META...> tags, I gather one can somehow use the code in 
>    /usr/share/latex2html/styles/html.perl
> namely
>  sub do_cmd_htmlmeta {
>   local($_) = @_;
>   s/$next_pair_pr_rx/$HTML_META .= join('',&revert_to_raw_tex($2),"\n");''/e;
>   $_;
>  }

All this definition does is to append a text-string to the $HTML_META variable.
As such, it will be used verbatim, in the appropriate place.
The &revert_to_raw_tex is to undo any translation of special characters,
such as < " ' > that may have occurred already.


Thus you would have to give the complete string as an argument:

\htmlmeta{<META NAME="keywords" CONTENT="longkeyword, nasslug, first, second">}

You could try using macros within the argument:

\newcommand{\METANAME}[1]{<META NAME="#1" }
\newcommand{\MCONTENT}[1]{CONTENT="#1" }

then use:

\htmlmeta{\METANAME{keywords}\MCONTENT{longkeyword, nasslug, first, second}>}

or

\newcommand{\namedmeta}[2]{\htmlmeta{\METANAME{#1}\MCONTENT{#2}>}}

then:

\namedmeta{keywords}{longkeyword, nasslug, first, second}

 
> Without fully understanding this brief code, 
> I tried adding possible META tags.
> I tried each of the following successively but unsuccessfully,
>  \htmlmeta[keyords]{longkeyword, nasslug, first, second}
>  \htmlmeta{keywords}{longkeyword, nasslug, first, second}
>  \htmlmeta[GLOBAL]{keywords}{longkeyword, nasslug, first, second}
>  \htmlmeta[GLOBAL]["keywords"]{"longkeyword, nasslug, first, second"}

No. There is just a single mandatory argument, and no optional one.
The syntax and possible usage of META commands is so broad that I didn't want
to restrict usage by imposing too much structure in the \htmlmeta macro itself.


> 
> All of these merely put something like the following 
> in the created html document's body,
>    [GLOBAL]["keywords"]"longkeyword, nasslug, first, second"
> 
> I was hoping to create 
>  <META NAME="keywords" CONTENT="longkeyword, nasslug, first, second">
> rather than latex2html's default,
>  <META NAME="keywords" CONTENT="nasslug">
> 
> CAN \htmlmeta SOMEHOW CREATE SUCH META HTML CODE?

I didn't do much work on this, as there was no compelling need.
Try the above suggestions and report back with the results.


> 
> Some of the latex2html email archives asked why one would 
> want META "keyword" and "description" entries.
> Some search engines look at these META entries.
> Indeed, the following site lists a frequency 
> of some searches (possible keywords); you might try "latex",
>   http://inventory.go2.com/inventory/Search_Suggestion.jhtml

Hmm. Of the thousands of entries recorded there,
there are  173 for latex tex   and  several for  latex manual .
The  366 for  latex pic  are ambiguous.
The rest mainly have a quite different slant.


 
> When one sets those "keywords" and "description", 
> then one submits the resulting web pages to
> over 70 search engines via, eg, the free service at
>   http://selfpromotion.com
> This site indicates the judicious use of keywords.

Suggestions on how to make use of this with LaTeX2HTML are most welcome.


Hope this helps,

	Ross Moore

 
> 
> -- 
> 
> Jameson C. Burt, NJ9L   Fairfax, Virginia, USA
> jameson@coost.com       http://www.coost.com
> (202) 690-0380 (work)
> 
> You can only find truth with logic if you have already found truth without it.
> -- G.K. Chesterton
>