On Wednesday 24 February 2010 10:21:35 pm rgheck wrote: <snip> > Come to think of it, there's an even easier way to do this: Just define > the ltx2 format, as before, but now use an appropriate modification of > IncludeBib.py as a LaTeX --> ltx2 *converter*. I think you can just > remove the LyxToTeX stuff, and it will more or less work, given an > appropriate converter definition. Much simpler. Including it with LyX > then just means shipping the script and messing with configure.py. > > rh
This works in that the correct latex file with the inlined refs is created but there is some problem with the copying that follows. Here is the stderr log output by lyx in the process: ../../../src/support/FileName.cpp(254): Could not move file /tmp/lyx_tmpdir.T12182/lyx_tmpbuf0/tmpfile.out to /tmp/lyx_tmpdir.T12182/lyx_tmpbuf0/issues-with-single-band-eff-mass-TISE-approach.tex Error: Cannot convert file ---------------------------------------- Here is how I have set up the LTX2 format: 1. create new format named LTX2 in Tools->Preferences...->File handling->File formats with the following settings: check "Document format", Short name = ltx2, Extension = tex, (everything else blank, including the "copier" field) 2. Create LaTeX (plain) -> LTX2 converter with following settings Converter: python /home/rmanoj/Temp/InlineBib.py $$i $$o Extra flag: needaux My analysis: ------------------ I have attached InlineBib.py (which is a modified version of the earlier script). Listing the temporary directory, (/tmp/lyx_tmpdir.T12182/lyx_tmpbuf0/) I find that this script has run successfully and the final .tex file contains all inlined refs which is compilable to DVI etc. The error therefore is in the following step of copying this .tex file from the temp dir to the final dir. The LyX export logic (in Buffer::doExport() and related) seem to analyze a graph looking for path from source format to destination format and possibly invoke a sequence of format conversions. In this chain, there is possibly some assumption about temporary filenames that could be causing the above error? I fail to see why the source file name should be "tmpfile.out" at all. I am using variables like $$i and $$o that should pass around correct filenames generated by LyX. Have I uncovered a bug? thanks, Manoj
InlineBib.py
Description: application/python