Hi Richard, Ehud (and other lyx users),

   Based on Richard's suggestions below, I have worked out a way to inline the 
refs.

> > 2. How and when is a copier invoked? For exporting latex with inline
> > bibliography, I will need to:
> > (1) generate the latex file from lyx,
> > (2) run latex on this file to generate the .aux file,
> > (3) run bibtex on the .aux file,
> > (4) replace the bibtex bibliography command with the .bbl file text as
> > you mentioned.
>
> The first two are easy. We define a new format, say ltx2, and define a
> LyX-->ltx2 converter, with the "needaux" extra flag set. (See
> Customization, section 3.3.) The last is of course what your python
> script will do. The third will probably also have to be done from your
> python script, though this shouldn't be very difficult. You might also
> want to suggest a new flag, bibtex, that would cause LyX to run bibtex
> as well as latex. This would be useful in other situations, I am sure.
>

   I created a new output format like you mentioned in 
Tools->Preferences->File handling->File formats and then created a new 
converter definition in Tools->Preferences->File handling->Converters 
providing the command:

    python <path>/IncludeBib.py $$i $$o

  I got the file IncludeBib.py from the log for issue #4624 in trac: 

    http://www.lyx.org/trac/ticket/4624

I can now choose File->Export->ltx2 and I get my .tex file with references 
inlined. Since the IncludeBib.py takes care of running latex to get the .aux 
I didn't need the "needaux" flag. I get a status-bar message saying 
conversion failed but the .tex is created just fine so this issue can be 
lived with.

I'm in the process of creating a FAQ item that I intend to post on the wiki, 
with screenshots.

Thanks,
Manoj

Reply via email to