[l2h] Re: latex2html, different version of tex-files

webmaster at steinam.de webmaster at steinam.de
Sun Nov 23 17:38:11 CET 2003


On 23 Nov 2003 at 12:00, 

many people wrote: 
> 
>   If I knew then what I know now, I would have said 'I don't recall'.
> -------------- next part -------------- #! /usr/bin/perl -w
> 
> use strict;
> 
> my $tex=join "",<>;
> my %opt;
> $opt{$2}=$1 eq "in" while $tex =~
> /\\(in|ex)cludecomment{\s*([^{}\s]+)\s*}/g; $tex =~
> s/\\begin{\s*\Q$_\E\s*}(.*?)\\end{\s*\Q$_\E\s*}/$opt{$_} ? $1 : ""/egs
> foreach keys %opt; print $tex;


that looks cool for me :-) but I prefer the solution from Ross :-)


another poster:
> 
> a minimal example:
> 
> ===================== start =====================
> \documentclass[a4paper]{article}
> 
> \usepackage{html}
> 
> \includecomment{versionpriv}
> \excludecomment{versionpub}
> %\includecomment{versionpub}
> %\excludecomment{versionpriv}
> 
> \begin{document}
> 
> \begin{versionpriv}Secret info
> \end{versionpriv}
> \begin{versionpub}[Omitted from online version]
> \end{versionpub}
> 
> \end{document}
> ====================== end ======================


well that generates images with the buildin text. 

> 
> Your code below simply says to include/exclude the environments.
> It doesn't say how to translate their contents; that's why you get the
> images.
> 
> You still need a \newenvironment definition, even if it
> doesn't do much; e.g.
> 
> \begin{htmlonly}
>  \newenvironment{versionpub}{\begin{flushleft}}{\end{flushleft}}
>  \newenvironment{versionpriv}{\begin{flushleft}}{\end{flushleft}}
> \end{htmlonly}
> 
> or
> 
> \begin{htmlonly}
>  \newenvironment{versionpub}{}{}
>  \newenvironment{versionpriv}{}{}
> \end{htmlonly}
> 
> The  \begin{htmlonly}...\end{htmlonly}  restricts this
> definition to processing by LaTeX2HTML, in case there
> is already a sensible definition for LaTeX.
> 
> 

Super  that worked for me for the small example above.

After that, i tried it out on my big work, and i found out some issues:


I don't need to write explicit \usepackage{comment} because \usepackage{html} 
makes it for me

I have to write once a time a htmlonly-Environment like this 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
>begin{htmlonly}
>  \newenvironment{versionpub}{}{}
>  \newenvironment{versionpriv}{}{}
	\begin{versionpub}
		write something
	\end{versionpub}

	\begin{versionpriv}
		write completely other things
	\end{versionpriv}


> \end{htmlonly}

Now, every time, when I'm using this environments, latex2html processes the right 
output, without the need to define a htmlonly-environment

Is that right, a bug, a feature ? Doesnt matter, it's great because it avoids me writing 
Text multiple times.

I have looked in the docs and faqs on latex2html.org and other websites, but I did 
not find an answer or example like in your email. Wouldn't it be worth to be included 
in the docs ?



Thank for your help, hints and informations

Very satisfied :-)

Karl










-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/latex2html/attachments/20031123/733362cb/attachment.htm


More information about the latex2html mailing list