Richard Heck wrote:

> 
> This is the result of a problem that Uwe noticed the other day with the
> MikTeX implementation of the htlatex scripts: The scripts will not run
> properly unless they are run in the same directory as the original file.

Several other converters (e.g. lilypond) have the same limitation. Therefore
LyX changes to the temp dir before running the converter. It would even be
possible to call the converter with relative filenames, I am not sure
anymore why absolute paths are used. IMHO if you create a subdirectory LyX
should change to that subdirectory before running the converter.

> So you can't run e.g. htlatex C:/path/to/file.tex. You can only run
> htlatex file.tex. The reason is here:
>> System call: dvips -E -Ppdf -mode ibmvga -D 110 -f
>> C:/tmp/lyx_tmpdir2696a00632/l yx_tmpbuf1/teachers.idv -pp 1 >
>> zzC:/tmp/lyx_tmpdir2696a00632/lyx_tmpbuf1/teache rs.ps
>> The filename, directory name, or volume label syntax is incorrect.
>> --- Warning --- System return: 1
>>   
> zzC:/... indeed isn't a valid path. The solution suggested in some
> earlier discussion was to ship a small shell script with LyX that would
> copy the .tex file to the temporary directory and then run htlatex on
> that file. Thoughts?

The .tex file _is_ in the temporary direcory. All conversions are run in the
temp dir, I hope you did not change that.


BTW this wrapper

bool Converters::convert(Buffer const * buffer,
                FileName const & from_file, FileName const & to_file,
                FileName const & orig_from,
                string const & from_format, string const & to_format,
                ErrorList & errorList, int conversionflags)
{
        FileName tmp_to_file = to_file;
        bool trash;
        return convert(buffer, from_file, tmp_to_file, orig_from, trash,
                       from_format, to_format, errorList, conversionflags);
}


assumes that tmp_to_file is always set to to_file by the real conversion
function. If that assumption is safe then you don't need the wrapper and
can as well call the real function directly.
If it is not safe then something like

        if (!fs::equivalent(to_file, tmp_to_file))
                copy_file(tmp_to_file, to_file);

is missing.


Georg

Reply via email to