Re: tex2lyx.exe not working
Angus Leeming
Wed, 22 Jun 2005 03:48:59 -0700

Stephen Harris wrote:
> Hello from a tester,

Hello, Stephen.

> I did not meet with success in setting up tex2lyx.exe
> and tex2lyx.cmd.  I received the error message: "Cannot
> open specified file. Create new document with this name?"

Before we try and get tex2lyx working "automatically" from within LyX,
we should try and get it working from the command line where
debugging is much easier.SH: I forgot my first rule, Keep it simple, stupid.> 
> set PYTHONPATH=C:\tools\Python24\lib;C:\tools\Python24\dlls

I don't think that we should need to mess around with PYTHONPATH.
SH: I removed it from my bat file. I also move Python back into its c:\Python24 
directory and got rid of "Tools"; andthen took Lyx out of c:\program files\ and 
put it in C:\Lyx>From a cmd console can you run tex2lyx and lyx2lyx "by hand"?
PROMPT> C:\Program Files\lyx\bin\tex2lyx infile.tex > outfile_14x.lyx
PROMPT> C:\Python24\python.exe C:\Program
Files\lyx\Resources\lyx\lyx2lyx\lyx2lyx --to 221 --output
outfile_13x.lyx outfile_14x.lyxI may have the exact syntax wrong, but you get 
the idea. PROMPT> tex2lyx -help
PROMPT> python <path to>\lyx2lyx --help

SH: I didn't understand the syntax of that tex2lyx.cmd file, so I rewrote it so 
that I could understand it and put in a few more LyX references in XP's Path.

@echo off
    set LYX_DIR_=c:\lyx\resources\lyx
    
 c:\lyx\lyx\bin\tex2lyx.exe -f -sysdir C:\lyx\resources\lyx %1 > temp.lyx

C:\Python24\python c:\lyx\lyx\resources\lyx\lyx2lyx\lyx2lyx --to 221 
--output %2 temp.lyx 
    del temp.lyx

SH: You may think this is ugly coding but it tex2lyx now works automatically!

> I thought that in Windows that putting the prime directive
> in the path was sufficient since dos searches all the
> sub-directories unlike *nix? 

Really? Weird.-- Angus

SH: Asger is right, I mangled this idea:
"One problem that regularly crops up for users coming from a DOS 
environment is that the only place UNIX looks for commands is in 
your path. However, even if not specified in your path, the first 
place DOS looks is in your current directory. This is not so for 
UNIX. UNIX only looks in your path." 

Thanks for your pointers. tex2lyx.exe works well for me. Now I
will try your fix certified for FC3 on FC4 which I just installed.
And to install Lyx all I needed was, yum install lyx. What progress!

It is so much fun when it works, best regards,
Stephen

Reply via email to