# DESCRIPTION: this patch is against TeXmacs-1.0.1 and improves # bibliography generation by # 1: allowing multiple *.bib files. In a BibTex tradition these # multiple bibliography files are listed without .bib extension # and separated by commas with no intervening white space # 2: *.bib files do not need to be in the same directory as # the document's *.tm file. According to the standard # BiBTeX phylosophy .bib files can be anywhere in BIBINPUTS path. # Naturally, the directory of a *.tm document file is searched first. # The same is true for *.bst style files. # # COPYRIGHT: (C) 2003 by Leo Razoumov # # INSTALLING: This patch is a self-applying shell script. # From the TeXmacs main build directory (ex.: TeXmacs-1.0.1-src) # simply execute this patch file as a shell script. # # sh$ sh this_file_name # # Enjoy! ######################################################################## patch -p1 -b -V t < $0 exit ######################################################################## --- TeXmacs-1.0.1-src/src/Edit/Process/edit_aux.cc Sat Nov 30 09:54:57 2002 +++ TeXmacs-1.0.1-LR/src/Edit/Process/edit_aux.cc Tue Jan 14 16:35:19 2003 @@ -42,14 +42,20 @@ string bib_s= "\\bibstyle{" * style * "}\n"; tree bib_t= buf->aux[bib]; for (i=0; iname, fname, false); - if ((N(rel_name) >= 4) && (rel_name (N(rel_name)-4, N(rel_name)) == ".bib")) - rel_name= rel_name (0, N(rel_name)- 4); - bib_s << "\\bibdata{" << rel_name << "}\n"; + + string dir= get_relative_file_name(buf->name, "A", false); + dir= (N(dir)>2)? dir(0, N(dir)-2) * ':' : string(); + + string cmdln= "cd $TEXMACS_HOME_PATH/system; BIBINPUTS="; + cmdln << dir << "$BIBINPUTS BSTINPUTS=" << dir + << ":$BSTINPUTS bibtex temp" << '\0';//append \0 just in case + + bib_s << "\\bibdata{" << fname << "}\n"; save_string ("$TEXMACS_HOME_PATH/system/temp.aux", bib_s); - system ("cd $TEXMACS_HOME_PATH/system; bibtex temp"); + cerr << "TeXmacs-dbg] " << &cmdln[0] << endl; // + system( &cmdln[0] ); string result; if (load_string ("$TEXMACS_HOME_PATH/system/temp.bbl", result)) { set_message ("Error: bibtex failed to create bibliography", "compile bibliography"); /*EOF*/