[l2h] \verbatim and \endverbatim

Jens Lehmann jens.lehmann at goldmail.de
Wed Jan 7 10:55:03 CET 2004


Ross Moore wrote:
> Hi Jens,
> 
> On Fri, 2 Jan 2004, Jens Lehmann wrote:
> 
> 
> I've done a lot more experimenting and fiddling around with the code.
> First of all, let me explain an undocumented feature:
> 
>   any environment, whose name ends in  verbatim  or  Verbatim
>   is automatically treated as a  \begin{verbatim}...\end{verbatim}
> 
> Try it out, define an environment:
>    \newenvironment{myverbatim}
>      {\begin{center}\color{red}}
>      {\end{center}}
> 
> What do you expect to get from:
> 
>  \begin{myverbatim}
>   Hello world!
>  \end{myverbatim}
> 
> 
> 
> In fact you get just plain unformatted {verbatim} text.
>                            ^^^^^^^^^^^

This explains the behaviour of Roland's example in the Debian bug 
report. Personally I'd prefer to avoid this undocumented feature for 
your next release.

> Today I made a few simple edits in the  latex2html  script,
> and renamed your environment to   {codeblockverbatim} in test5.tex .
> 
> Here's the result:
> 
>    http://www-texdev.ics.mq.edu.au:LEHMANN/test5/
> 
> (source at http://www-texdev.ics.mq.edu.au:LEHMANN/test5.tex )
> 

I get only 404 errors trying to access the documents above.

> My edits to  latex2html  (5 simple edits) effect the following.
> 
> 
> Environments with names ending:   ....verbatim  or  ....Verbatim
> have
>   1.  their contents placed 'verbatim'  (ie. in <PRE>....</PRE> tags)
>        (as at present)
> 
> as well as
> 
>   2.  their  \newenvironment  replacements interpreted, both before
>       and after;
>   3.  occurrences of  \verbatim  and  \endverbatim  are ignored.
> 
> 
> Thus the following kind of definition works as expected:
> 
> \newenvironment{\myverbatim}
>   {... some stuff before ..  e.g., for stylish purposes ...
>    \verbatim }
>   {\endverbatim
>    ... and closing stuff afterwards ... }
> 
> 
> However, the following is not quite right:
> 
> \newenvironment{\myverbatim}
>   {... some stuff before ..  e.g., for stylish purposes ...
>    \verbatim
>    Start the verbatim with this:}
>   { Finish it with this.
>    \endverbatim
>    ... and closing stuff afterwards ... }
> 
> In this case, the constant phrases 'Start the verbatim with this:'
> and 'Finish it with this.' are in fact *not* treated as part of
> the {verbatim} text. They are styled along with the 'stuff before',
> since only the contents of the environment are treated {verbatim}.
> 
> 
> 
> The 5 short edits are not yet committed to the repository
> at  www.latex2html.org ,  but I'll send them to you if you
> are prepared to implement them yourself.

Personally I'm quite happy that you added support for this environment. 
For the future of latex2html in general it would be better to add real 
support for \verbatim and \endverbatim, if this is possible. Please send 
me the patch along with some short instructions, so I can test it.

> Within the next few weeks (maybe as many as 6 or 7 !)
> I'll be announcing a new version of LaTeX2HTML, which will
> have numerous small bug-fixes and improvements, and other
> extended functionality (e.g. support for .jpg images/icons
> thanks to coding contributed by Shigeharu TAKENO).

It's good to hear that. Maybe it's time for me to mail you more feature 
requests to get them in the release. :-) I didn't report every problem I 
encountered to the mailing list, because the verbatim-problem and 
mnemonic anchor problem are the most important for me.

I don't want to go offtopic, but one of the things, which would be nice 
is to put the content of every html-page in a table and specify its 
width (optionally configured by an option). (CSS even allows to specify 
min-width and max-width, which is supported by Mozilla!) For some 
documents it's better to have a max width of say 750, because otherwise 
documents are difficult to read for people with a 1600x1200 resolution.

If you want I can try to find out more issues. The Debian bug tracking 
system is also a good resource.

Jens


-- 
PGP Public Key: http://studenten-dresden.de/public_key.asc



More information about the latex2html mailing list