On Wed, May 23, 2007 at 12:00:58PM -0400, Richard Heck wrote:
> Enrico Forestieri wrote:
> > Unfortunately, htlatex on Windows only works when you call it with a
> > simple filename without a path (either absolute or relative), so the
> > tempdir approach will not work the way you thought it. However, thanks
> > to your patch, I modified my htlatex script (I attach it here) and now
> > I am able to both view and export to html.
> >
> > I know that it is cumbersome, but may be the same logic could be adopted
> > in the LyX sources, i.e., take a snapshot of what files are present before
> > calling htlatex and then move any generated file in the conversion dir.
> > Anyway, the script works like a charm and could be translated in python
> > in order to use it in native Windows builds in place of htlatex.exe. 
> >   
> This seems like a lot of work in the LyX code to fix what is clearly a 
> bug in an external converter. What we could do, however, and what would 
> help (as Georg mentioned elsewhere) with other converters, too, is to 
> copy the input file to the new temporary directory and then run the 
> conversion against it, in which case we can do it using just the 
> filename. Indeed, we can just create a soft link (this works on Windows, 
> right?), so as not to have the file-copying overhead, and then delete it 
> when we're done. Then, I think, everything will work as it should. (And 
> man, won't it be nice to have working HTML export?)

I tested the patch on linux and I found some quirks. The least important
is that when exporting to html, the export dir is filled with byproduct
files such as .dvi, .aux, .log, .idv, and others which have nothing to
do with the export itself. The most important is that dvipng cannot find
graphics files, which are therefore left blank. I think that this is due
to the fact that they are not in the directory which is the current one
when htlatex is called.

Notice that both problems above are avoided when using the wrapper for
htlatex that I posted previously. So, my proposal is to convert that
script in python, place it in the lib/scripts directory and use it as
the converter on all platforms when htlatex is detected.

As regards symlinks, they only work with cygwin, not in a native
environment. Windows shortcuts are something different and are not
really symlinks. However, I heard that symlinks are supported in Vista.

> I'll implement this when I get a chance, probably tonight. Should be 
> pretty painless.

Mmm... my impression is that this is less straightforward than it seems...

-- 
Enrico

Reply via email to