I forgot to mention, this patch also includes an update to UserGuide.lyx - the appendix section which explains file formats, I have made entries there.
The patch was created from within lib/ -- Manoj On Tuesday 02 March 2010 11:48:09 am Manoj Rajagopalan wrote: > Attaching patch with suggested modifications. The file include_bib.py is a > modified version of IncludeBib.py first created by Manolo Martínez (user > SchAirport) and posted on trac as part of ticket #4624 > (http://www.lyx.org/trac/ticket/4624) and this has been approved by the > author for modification and release under GPL v2 in a previous email. > > I hereby grant permission to license my contributions to LyX under the Gnu > General Public Licence, version 2 or later. > > @Vincent: > > >+ if len(sys.argv) >= 3: > > >+ outputfile = str(sys.argv[2]) > > > > Shouldn't this be 2 then ? > > IIUC, should be >2 or >=3. This creates the outputfile name if one is not > supplied. My python isn't very good but argv[0] should be the script name > itself unless the python shell has been invoked. Then argv[1] == inputfile > > Thanks, > Manoj > > On Tuesday 02 March 2010 11:16:46 am Vincent van Ravesteijn - TNW wrote: > > >+ > > >+# author user SchAirport on trac > > > > I'm not sure what to do with this. > > > > >+def make_bbl(name): #Creates .bbl from .tex > > >+ arg = "bibtex " + name[:-4] #name[:-4] is the name of the file > > > > without extension > > > > >+ os.system(arg) > > >+ > > > > This is not necessary (and wrong). The bbl file is generated anyway, and > > we might have specified a custom bibtex command. > > > > >+ > > >+def insert_bib(name,outputfilename): #Inserts the contents of the > > > > .bbl file instead of the bibliography in a new .tex file > > > > >+ fileold = name[:-4] + ".tex" #The old .tex file > > >+ texfile = open(fileold, 'r') > > > > The filename is supplied as the first parameter to the script right, so > > there is no need to do this. > > > > >+def make_clean(name): #Cleans files created in the process > > >+ extensions = ['aux', 'bbl', 'blg', 'dvi', 'log', 'spl'] > > >+ files = [f for f in os.listdir(os.getcwd()) if os.path.isfile(f)] > > > > #puts every filename in the current directory in a list > > > > >+ filesinteresting = [f for f in files if name[:-4] in f] #Every > > > > file with the same name as the original file > > > > >+ for f in filesinteresting: > > >+ overall = sum([(f[-3:]==ext) for ext in extensions]) #Is 1 if > > > > f has any of the extensions, 0 otherwise > > > > >+ if overall: > > >+ os.remove(f) > > > > This is not necessary, we're working in the temp directory anyway. > > > > >+ if len(sys.argv) >= 3: > > >+ outputfile = str(sys.argv[2]) > > > > Shouldn't this be 2 then ? > > > > >+\Format ltxbib tex "LaTeX (plain,embed bib)" "" "" "%%" > > > > "document" > > > > > \Format pdflatex tex "LaTeX (pdflatex)" "" "" "%%" > > > > "document" > > > > >+\Format pdfltxbib tex "LaTeX (pdflatex,embed bib)" "" "" > > > > "%%" "document" > > > > Why, maybe again, do we need a pdflatex version ? > > > > >- scripts/tex_copy.py > > >+ scripts/tex_copy.py \ > > >+ scripts/inline_bib.py > > > > A little glitch. I guess we keep this file sorted alphabetically, but > > don't hold me to that. > > > > Vincent