On 02/24/2010 09:49 PM, Manoj Rajagopalan wrote:


On Wednesday 24 February 2010 04:43:23 pm Vincent van Ravesteijn wrote:
Manoj Rajagopalan schreef:
1. Is this change acceptable?
I think so.

2. This feature requires the IncludeBib.py script submitted by another
user/developer in the issue-log on trac:
http://www.lyx.org/trac/ticket/4624 Can the IncludeBib.py script be
bundled with the lyx distribution now? I didn't see the author permitting
the use of this script under GPL (maybe I missed it) but if this is the
case, I could write a script and submit that under GPL. Are there any
other adoption problems?
I'm not sure you should use this script.

We can export LaTeX, we can run LaTeX, we can run bibtex
(LaTeX::runBibTeX), we can do something similar for bbl files as for aux
files (LaTeX::scanAuxFile).

So, can't we do it without python scripts ?

Vincent
I'm a C++ guy to the core but playing devil's advocate, here are reasons why I
think Python might be a good idea:

(1) Python is portable and the performance hit in using a script instead of
compiled C++ might be negligible/acceptable in this case

(2) Richard Heck mentioned that the invasive approach of creating another
native format will then also rope in PDF and DVI issues among other things

(3) text find-and-replace for the final step (replacing the bibtex
bibliography command with the contents of the .bbl file) might be simpler to
code in python (unless the paragraph-iteration in Buffer::doExport() is
modified to detect the bibliography and follow a different code path)

(4) The framework to invoke scripts as filters already exists, so the python
approach might involve fewer changes and bug-possibilities

(5) The developer learning curve to implement this change is small

I'll add that this just seems conceptually right to me. Copiers are used for precisely this kind of reason, to make simplistic changes to things we already know how to export. The C++ code needed to do it would be more complicated than it seems. We can do all the things Vincent mentions, but the trigger to do them is some graph between formats. (Actually, I'm not entirely sure what the trigger to run BibTeX is. That's a special case, as presently handled, for sure.) You don't want to mess with the exporter code just for this purpose. It's crazy enough already.

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

Reply via email to