Hi,

I wanted to define a new LaTeX environment which does nothing but set its
contents (probably several paragraphs) in italic.  By now I have come up with
(not quite) half a dozen ways that work in LaTeX, but don't work with
LaTeX2HTML due to two separate bugs...

First I turned to the way that the LaTeX "blue book" would suggest:

\newenvironment{note}{\begin{trivlist}\itshape\item }{\end{trivlist}}

Here the trivlist environment does nothing but delimit the scope of the
\itshape declaration.  (Of course I cannot use the braces {...} in a
\newenvironment definition without...)

Bug #1: It turns out that LaTeX2HTML does not understand the trivlist
environment, and chooses to generate an image, rather than simply inserting <I>
and </I> tags.

So I tried something else:

\newenvironment{note}{\itshape}{\normalfont}
....
\begin{note}
Inside note.
\end{note}


Bug #2: When I run this, LaTeX2HTML will issue: "Unknown commands:
itshapeInside", and only the text "note." will appear in the output.  In other
words, when the replacement of the new environment happens, no space is added
between the \itshape and the contents of the environment.  Some intermediate
stage of the translation must look like:
\itshapeInside note.\normalfont

Even if I add a space, as in:

\newenvironment{note}{\itshape }{\normalfont}

LaTeX2HTML will eat that space and produce the same error.


Workaround: Of course there is a workaround, namely

\newenvironment{note}{\itshape{}}{\normalfont}

but I think these are two significant bugs that should be fixed in a future
release.

Below I attach a simple LaTeX that you can use to test this.

Regards,

Sven Heemeyer

PS:

If you are wondering about other possibilities:

\newenvironment{note}{\begingroup\itshape}{\endgroup}

works in LaTeX, too, but falls in the "missing space" trap in LaTeX2HTML.

\newenvironment{note}{\begingroup\itshape{}}{\endgroup}

circumvents the "space" problem, but still fails because LaTeX2HTML ignores
\begingroup ... \endgroup


------- Cut here
\documentclass[11pt,twoside]{report}
%
%\newenvironment{note}{\begin{trivlist}\itshape\item }{\end{trivlist}}
\newenvironment{note}{\itshape}{\normalfont}
%\newenvironment{note}{\itshape{}}{\normalfont}
%\newenvironment{note}{\begingroup\itshape{}}{\endgroup}
%
\begin{document}
First paragraph.

\begin{note}
Inside note.
\end{note}

Third paragraph.
\end{document}

Reply via email to