On 01/02/2012 06:57 PM, Bogdan wrote:
On 02-Jan-12 10:32 pm, Richard Heck wrote:
On 01/02/2012 05:10 PM, Richard Heck wrote:
On 01/02/2012 04:35 PM, Bogdan Roman wrote:
- create format "foo" with short name "pdf7" and extension "pdf" and
check all 3 checkboxes
- create a converter Latex (pdflatex) -> foo with the command
"pdflatexfoo $$i 20 20" and the extra flag "latex=pdflatex"
- create a batch file pdflatexfoo.bat and place it in lyx\bin with
the following contents:
@echo off
echo %* > c:\args.txt

save, make a change and then do "Update foo". If you look in
c:\args.txt you'll see "20 20 file.tex"

I did exactly the above steps and that's what I see on Win7 x64 with
latest stable LyX 2.0.2 which is consistent with my findings from
yesterday.

It seems to be the latex=pdflatex flag that is triggering the bug.
Please file a bug.

Actually, I think you do not want this latex flag here at all. That
means you want LyX to run LaTeX for you, and the argument (if any) tells
LyX which flavor to run. Lots of magic happens then. If you are running
LaTeX on your own, you don't want this flag.


I might be misunderstanding you so please correct me if I'm wrong.

But according to the docs, the "latex=pdflatex" only informs LyX about the output type of the tool in order to parse errors. If I remove the flag, LyX won't even execute the converter and gives a crude error "An error occured while running: pdflatex "sheet.tex"". It seems we need that flag ...

I had my dummy converter running without it, and most converters don't have it.

Also, if you look at my last message in the other thread about code before \documentclass{}, you will see that I defined a converter that is in fact a shell script which launches an executable itself and it runs just fine with the "latex=pdflatex" flag present.

My converter is lyxwrap.bat and looking at what happens with Process Explorer, it doesn't seem that LyX would try to execute pdflatex but correctly executes lyxwrap.bat.

Yes, but a lot else is going on behind the scenes in LyX.

Regardless, I think the above quoted behavior is still a bug that should be fixed, i.e. the $$i placeholder should not be moved around to the end of the argument list.

You're welcome to send a note to the devel list about this and see if anyone there has thoughts. I'm not an expert on this part of the LyX code. But if you have a look at Converter.cpp, at the convert() routine, you will see an if-else that tests on conv.latex, which is set when the latex flag is present, and what a huge difference that ends up making. I don't think it's as easy as it seems.

Richard

Reply via email to