Hi Igor,
On 15/02/2005, at 5:09 AM, Igor Pechtchanski wrote:
Hi,
I'm attempting to convert a LaTeX file that has custom picture commands
into HTML. The images in the file should ideally be generated from the
LaTeX version of the commands. However, latex2html includes the HTML
(!)
versions of the commands, which results in invalid images. Manually
editing images.tex to include the LaTeX versions of the commands does
produce the correct images.
Below is the minimal example (with the actual command definition, FWIW,
but that's largely irrelevant, I think). Yes, I realize that it's
LaTeX
hackery, and that LaTeX2HTML can't be expected to parse that,
Firstly, you need to:
\usepackage{html}
then use the special environment:
\begin{imagesonly}
...
\end{imagesonly}
as follows:
\documentclass{article}
\usepackage{html}
%begin{latexonly}
\makeatletter
% Define \ovalbox (an oval framebox)
\def\ovalbox{%
[EMAIL PROTECTED]@[EMAIL PROTECTED]@x}
[EMAIL PROTECTED]@[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]@tempboxa\vbox{%
\vskip\fboxsep
\hbox{%
[EMAIL PROTECTED]
\kern\fboxsep{#2}\kern\fboxsep
[EMAIL PROTECTED]
\vskip\fboxsep
}%
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]@veunitlength}%
\setlength{\unitlength}{1pt}%
\oval([EMAIL PROTECTED],\hgt)\makebox(0,0)[EMAIL PROTECTED]
[EMAIL PROTECTED]@tempboxa%
}
\makeatother
%end{latexonly}
\begin{imagesonly}
\makeatletter
% Define \ovalbox (an oval framebox)
\def\ovalbox{%
[EMAIL PROTECTED]@[EMAIL PROTECTED]@x}
[EMAIL PROTECTED]@[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]@tempboxa\vbox{%
\vskip\fboxsep
\hbox{%
[EMAIL PROTECTED]
\kern\fboxsep{#2}\kern\fboxsep
[EMAIL PROTECTED]
\vskip\fboxsep
}%
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]@veunitlength}%
\setlength{\unitlength}{1pt}%
\oval([EMAIL PROTECTED],\hgt)\makebox(0,0)[EMAIL PROTECTED]
[EMAIL PROTECTED]@tempboxa%
}
\makeatother
\end{imagesonly}
\begin{document}
\begin{figure}
\begin{picture}(100,20)(0,0)
\put(50,10){\ovalbox{Testing \string\ovalbox}}
\end{picture}
\end{figure}
\end{document}
Alternatively, put your definitions into a .sty file,
mydefs.sty say, and then \usepackage{mydefs} .
You will need to place mydefs.sty in a place where it
can be found by LaTeX when needed.
but I
thought that's exactly what image generation was all about -- passing
the
bits that LaTeX2HTML doesn't understand to the actual LaTeX for
processing...
The \begin{latexonly} and %begin{latexonly} environments
are only included when LaTeX is in control of the complete
document. These are *not* included as part of images.tex .
The \begin{imagesonly} environment passes extra material
to images.tex but should be ignored by LaTeX when doing
the whole document.
In this case it means duplicating your definitions, but
this isn't the only use for such an environment.
I'm also attaching the generated images.tex file. Please let me know
if
more detail is needed. Thanks,
Igor
Hope this helps,
Ross
------------------------------------------------------------------------
Ross Moore [EMAIL PROTECTED]
Mathematics Department office: E7A-419
Macquarie University tel: +61 +2 9850 8955
Sydney, Australia fax: +61 +2 9850 8114
------------------------------------------------------------------------
_______________________________________________
latex2html mailing list
[email protected]
http://tug.org/mailman/listinfo/latex2html