Thanks for the technical advice! In cases where a document has been converted from natbib it will be the case that one has to find all the bibliographies by looking through the entire document. However, what should be done if one starts with a new document or when adding more bibliographies to a converted document? All the bib-database-files are available to all bibliographies throughout the document, so it would be rather confusing if the GUI makes it look as if individual bib-database-files are directly connected to individual bibliographies. The bibliography-creating command also takes a few options (such as whether a bibliography for the entire document or just a section should be created, what its title should be, etc.), but all the style related options as well as the list of bibliographies is defined on a epr docuemnt basis.
I am not even sure how this should be resolved even if we were just talking about biblatex and wouldn't have to consider any of the legacy systems. One way would of course be to have all the global options set inside of Document->Settings->Bibliography. However, I wonder if that is a bit too hidden away. Basically anyone creating a new document would need to set these options, as they also include the name of the database. One option would be to have a link to global options show up somewhere in the menu system (and greyed out/removed in case another database system is used) and when the user clicks on an individual bibliography he gets a two-tabbed dialog of which the first tab shows the local options for that particular bibliography, and the second tab shows the global options for all bibliographies. On Tue, Mar 29, 2011 at 11:03 PM, Richard Heck <rgh...@comcast.net> wrote: > On 03/29/2011 05:09 PM, Jean-Marc Lasgouttes wrote: > >> Le 29/03/11 19:06, Johannes Wilm a écrit : >> >>> . Now I however have to think through some somewhat more fundamental >>> questions on how to continue: The \bibliography{XXX} should go into the >>> preamble. I'm not really sure how I can throw it up there from an inset, >>> but also it is not clear what to do if a document has different >>> bibliography files that are referenced in different parts of the >>> document. >>> >> >> I cannot answer the second question (I do not know biblatex), but the >> first one is easy enough for me. You shall implement that in the validate() >> method of the inset, using the LaTeXFeatures::addPreambleSnippet() method. >> >> The validate() methods are run in a first pass over the whole buffer, >> before the real latex export is done. >> >> I'm not as familiar with biblatex as I should be, either, but is the > point that you could have bibliography insets at different places in the > document, and all of them need to add the files they reference to a SINGLE > command? If you can have a sequence of \bibliography{XXX} commands, then, as > JMarc said, you can just add each one from the InsetBibtex::validate() > routine, which is called as part of a tour of the entire buffer that happens > before any kind of export. > > If you have to have just one \bibliography{} command that lists all the > files, then what you have to do is collect them during the validation > process---you might add a std::vector to LaTeXFeatures to receive the list > of files---and then, when it is over, call > LaTeXFeatures::addPreambleSnippet(). This would happen right after the call > to Buffer::validate()---that is what begins the tour---at the beginning of > Buffer::writeLaTeXSource(). > > Richard > > -- Johannes Wilm http://www.johanneswilm.org tel: +1 (520) 399 8880