John McCabe-Dansted | 1 Mar 06:57 2007
Picon

"An error occurred whilst running -f 'newfile4.tex' 'newfile4.lyx'"

Howdy, I created a new file type "LyXt" and a converter from LyX to
LyXt. Regardless of what I set the converter to (e.g. cp $$i $$o),
when I do a File->Export->LyXt I get the following error:

sh: -f: command not found
Error: Cannot convert file
----------------------------------------
An error occurred whilst running  -f 'newfile4.tex' 'newfile4.lyx'

I have no idea as to why it is attempting to covert a tex file to a
lyx file or why LyX does not prefix '-f' with some sort of command.
The -f appears to come from the line
    cmdmap["-f"] = parse_force;
in
    src/tex2lyx/tex2lyx.C

I have replicated this with LyX 1.4.4 and the current LyX 1.5.0svn. It
does not go away if I move ~/.lyx out of the way. I do not get this
error if I convert to lyx13 or lyx14, although lyxt is the same as
these two fileformats in all the ways I can see through the gui. If I
call lyxt something else (e.g. lyxBAK), I still get the error.

Is this a bug in LyX? Can other people replicate it?

--

-- 
John C. McCabe-Dansted
PhD Student
University of Western Australia

(Continue reading)

Georg Baum | 1 Mar 17:13 2007
Picon
Picon

Re: "An error occurred whilst running -f 'newfile4.tex' 'newfile4.lyx'"

John McCabe-Dansted wrote:

> Howdy, I created a new file type "LyXt" and a converter from LyX to
> LyXt. Regardless of what I set the converter to (e.g. cp $$i $$o),
> when I do a File->Export->LyXt I get the following error:
> 
> sh: -f: command not found
> Error: Cannot convert file
> ----------------------------------------
> An error occurred whilst running  -f 'newfile4.tex' 'newfile4.lyx'
> 
> I have no idea as to why it is attempting to covert a tex file to a
> lyx file

This is because up to 1.4.x the exporter chooses the first conversion path
that it finds, not the shortest one. In this case that is export to tex ->
lyx -> LyXt. In 1.5 the shortest path is used instead, so your new format
should work in 1.5.

> or why LyX does not prefix '-f' with some sort of command. 

That I don't understand. Obviously it tries to run tex2lyx, but for some
reason it only gives the argument, not the command name.

> The -f appears to come from the line
>     cmdmap["-f"] = parse_force;
> in
>     src/tex2lyx/tex2lyx.C

No. It comes from the tex -> lyx converter in the preferences.
(Continue reading)

John McCabe-Dansted | 2 Mar 05:39 2007
Picon

Re: "An error occurred whilst running -f 'newfile4.tex' 'newfile4.lyx'"

On 3/2/07, Georg Baum <Georg.Baum@...> wrote:
> This is because up to 1.4.x the exporter chooses the first conversion path
> that it finds, not the shortest one. In this case that is export to tex ->
> lyx -> LyXt. In 1.5 the shortest path is used instead, so your new format
> should work in 1.5.

This was cause by me using a -target flag in ./configure (see below),
however I had the same  problem with the latest 1.5.0svn.

> > or why LyX does not prefix '-f' with some sort of command.
>
> That I don't understand. Obviously it tries to run tex2lyx, but for some
> reason it only gives the argument, not the command name.

It if probably because in ~/.lyx/configure.log I have:
checking for a LaTeX/Noweb -> LyX converter...
+checking for "tex2lyx"...   no
+checking for "tex2lyx"...   no

I presume that configure did not find tex2lyx because my tex2lyx is called
   i786-pc-linux-gnu-tex2lyx
because I configured using
  -target=i786-pc-linux-gnu

I removed the -target, and reinstalled, and now it works. However
perhaps if tex2lyx is not found, configure should do something other
than setting the TeX to LyX converter to "-f".

> No. It comes from the tex -> lyx converter in the preferences.

(Continue reading)

Georg Baum | 2 Mar 09:35 2007
Picon
Picon

Re: "An error occurred whilst running -f 'newfile4.tex' 'newfile4.lyx'"

John McCabe-Dansted wrote:

> On 3/2/07, Georg Baum
> <Georg.Baum@...> wrote:
>> This is because up to 1.4.x the exporter chooses the first conversion
>> path that it finds, not the shortest one. In this case that is export to
>> tex -> lyx -> LyXt. In 1.5 the shortest path is used instead, so your new
>> format should work in 1.5.
> 
> This was cause by me using a -target flag in ./configure (see below),
> however I had the same  problem with the latest 1.5.0svn.

Strange. tex2lyx should not be used in 1.5. What output do you get with the
-dbg files flag?

> I presume that configure did not find tex2lyx because my tex2lyx is called
>    i786-pc-linux-gnu-tex2lyx
> because I configured using
>   -target=i786-pc-linux-gnu

I don't think that -target is supported (I don't know what it does either).

> I removed the -target, and reinstalled, and now it works. However
> perhaps if tex2lyx is not found, configure should do something other
> than setting the TeX to LyX converter to "-f".

Indeed. Could you file a bug report please?

Georg

(Continue reading)


Gmane