At 5:37 PM +1000 23/9/98, [EMAIL PROTECTED] wrote:
>I hesitate to argue with such an eminent authority but I've been using
>customised alltt (not verbatim) environments in LaTeX for years and
>never had any problems at all. One of the main reasons I'm using alltt
>rather than verbatim is that I want to change the font characteristics
>inside the environment. The actual env I used that showed up the
>problem is something like
OK, let's not fight about it.
The alltt environment is a hybrid.
--- not truly a 'verbatim', which Michel rightly points out are generally
impossible to use in user-defined environments --- except by a TeX guru.
LaTeX meta-commands are not enough for these beasts.
--- but it *does* change some category codes, so needs special pre-processing
within LaTeX2HTML.
This pre-processing *must* come before general meta-command replacement,
which is why Graham's \newenvironment doesn't work as he desires.
>\newenvironment{doutput}{\begin{alltt}\bfseries\sffamily\color{firebrick4}}{\en
>d{alltt}\\}
I've just edited alltt.perl to include a variable $alltt_rx ,
by default adopts the value $alltt_rx = 'alltt';
If you change this in an -init file to: $alltt_rx = 'doutput';
or several such, as: $alltt_rx = 'doutput|myalltt|somett|foott';
then the special preprocessing is done also on the named environments.
In fact, after the alltt.perl file has loaded, the value becomes:
'alltt|doutput'
(or 'alltt|doutput|myalltt|somett|foott' ).
Notes:
1. the '|' character is *vital* as separator;
it acts as a logical 'or' within a Perl pattern-match.
2. the changed value to $alltt_rx *must* come within a Perl file;
(.config , .perl or .latex2html-init or -init_file <file>
switch )
since no processing of LaTeX macros has taken place at the point
when it is used.
Test example at: http://www-texdev.mpce.mq.edu.au/TURNER/arraytest/
>This works perfctly well in LaTeX.
...and shortly will too, in LaTeX2HTML, modulo the edit in an -init file.
I'll commit the modified alltt.perl file tonight.
Until then, I'd suggest Graham use a conditional in the definition:
\newcommand{\foo}{\ \htmladdimg{../return.gif}\ \html{\\}}
\begin{document}
\begin{myalltt}
one line \foo
another line \foo
and a third \foo
\end{myalltt}
\end{document}
Hope this helps,
Regards,
Ross
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ross Moore email: [EMAIL PROTECTED]
Mathematics Department phone: +612 9850 8955
Macquarie University fax: +612 9850 8114
Sydney, NSW 2109 office: E7A-419
Australia WWW: http://www-math.mpce.mq.edu.au/~ross/
***************************
for the best in (La)TeX-nical typesetting and Web page production
join the TeX Users Group (TUG) --- browse at http://www.tug.org
<[EMAIL PROTECTED]>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~