[l2h] Controlling generation of CLASS and ID attributes from within LaTeX files

Travis Spencer travislspencer at gmail.com
Fri Jul 29 08:00:40 CEST 2005


Hey,

I have a few dozen LaTeX documents that I want to style the same way. 
To do this, I am invoking latex2html with the `-style' option, so they
all use the same CSS stylesheet.  No problem there; however, I need
some way to control how latex2html generates ID and CLASS attributes,
so I have some "hooks" to grab onto when applying styles.  I read in
the mailing list archive that any `\text' command will generate a
unique ID.  I'm not sure what that means though. (My LaTeX still isn't
that good, but I'm getting there.)

Here is an example of what I am trying to do:

Suppose I have this LaTeX source code:

\title{Getting Started With Unix}
\author{Tim Welch\\
\small{CS Tutors -- Portland State University}}
\date{\today}
\maketitle

Currently, latex2html is generating this HTML:

<P>

<H1 ALIGN="CENTER">Getting Started With Unix</H1>
<DIV CLASS="author_info">

<P ALIGN="CENTER"><STRONG>Tim Welch</STRONG></P>
<P ALIGN="CENTER"><I><SMALL CLASS="SMALL">CS Tutors - Portland State
University</I></P>
<P ALIGN="CENTER"><STRONG>July 28, 2005</STRONG></P>

What I would like is a way to instruct latex2html to give that first
H1 an ID attribute with a value of DocTitle by inserting some LaTeX
code like this:

\title{Getting Started With Unix}\html_id{DocTitle}

Which would produce this HTML:

<H1 ALIGN="CENTER" ID="DocTitle">Getting Started With Unix</H1>
 
Similarly, it would be handy to be able to do the same thing for CLASS
attribute and values.  This example seems like something latex2html
should just do for me, but that is another issue I think.

All this said, I am open to other suggestions on how to style dozens
of documents uni formally.  I've read about the \htmlsetstyle command,
but that isn't really what I'm looking for I don't think.

Also, in case it helps, I invoke html2latex in a Makefile like so:

$(LATEX2HTML) \
        -discard \
        -nofootnode \
        -font_size 12pt \
        -noaddress \
        -nobottom_navigation \
        -noinfo \
        -local_icons \
        -nonavigation \
        -noshort_index \
        -nosubdir \
        -auto_prefix \
        -show_section_numbers \
        -split 0 \
        -style $(STYLESHEET) \
        -white \
        -html_version "4.0" \
        $< ;

-- 

Regards,

Travis Spencer



More information about the latex2html mailing list