]> git.lyx.org Git - features.git/commitdiff
add bibtopic support (bug 870).
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 29 Mar 2004 13:17:25 +0000 (13:17 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 29 Mar 2004 13:17:25 +0000 (13:17 +0000)
That's it for now.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8560 a592a061-630c-0410-9148-cb99ea01b6c8

30 files changed:
development/FORMAT
lib/ChangeLog
lib/doc/LaTeXConfig.lyx.in
lib/lyx2lyx/ChangeLog
lib/lyx2lyx/lyx2lyx
lib/lyx2lyx/lyxconvert_231.py [new file with mode: 0644]
lib/lyx2lyx/lyxrevert_232.py [new file with mode: 0644]
src/ChangeLog
src/LaTeXFeatures.C
src/buffer.C
src/bufferparams.C
src/bufferparams.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlBibtex.h
src/frontends/qt2/ChangeLog
src/frontends/qt2/QBibtex.C
src/frontends/qt2/QDocument.C
src/frontends/qt2/QDocumentDialog.C
src/frontends/qt2/ui/BiblioModuleBase.ui
src/frontends/qt2/ui/QBibtexDialogBase.ui
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormDocument.h
src/frontends/xforms/forms/form_bibtex.fd
src/frontends/xforms/forms/form_document.fd
src/insets/ChangeLog
src/insets/insetbibtex.C
src/insets/insetbibtex.h

index c8c5e76508dca9c93804cbb4de61be6f64e2738d..ad24e10799c78ba8d44bcf53394f2cf3bbec8e9e 100644 (file)
@@ -1,6 +1,27 @@
 LyX file-format changes
 -----------------------
 
+
+2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * format incremented to 232.
+       
+       * Support for bibtopic (sectioned bibliographies).
+         - bufferparam \use_bibtopic [1|0]
+         - the bibtex inset has a second argument for bibtopic's
+           btPrint{Cited|NotCited|All} command:
+           < 231:
+           \begin_inset LatexCommand \bibtex[<style>]{<database>}
+           now:
+           \begin_inset LatexCommand \bibtex[<style>][<btPrintX>]{<database>}
+         Forwards, there's nothing to be done. Backwards, \usepackage[dot]{bibtopic}
+         has to be inserted to the preamble. Instead of the bibtex inset, the LaTeX
+         \bibliographystyle{<style>}
+         \begin{btSect}{<database>}
+         \<btprintX>
+         \end{btSect}
+         has to be inserted.
+
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * format incremented to 231.
index 1415717447303790c665ed6bc93574f431ab6d80..dd2d3cac5e440da2feaec24325808b6fb8810732 100644 (file)
@@ -1,3 +1,7 @@
+2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * dco/LaTeXConfig.lyx.in: check for bibtopic.
+
 2004-03-22  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * lyxrc.example: remove \ps_command
index 0b3c18f80420e2287abcb8594e676da5390b6550..b37b7313386a02d1dc4a49bd7bcfa30dae482afc 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 1.4.0cvs created this file. For more info see http://www.lyx.org/
-\lyxformat 230
+\lyxformat 232
 \textclass article
 \language english
 \inputencoding default
@@ -14,6 +14,7 @@
 \use_natbib 0
 \use_numerical_citations 0
 \use_jurabib 0
+\use_bibtopic 0
 \paperorientation portrait
 \secnumdepth 2
 \tocdepth 3
@@ -2414,6 +2415,32 @@ index of algorithms
 
 \begin_layout Subsection
 
+bibtopic
+\end_layout
+
+\begin_layout Description
+
+Found: @chk_bibtopic@
+\end_layout
+
+\begin_layout Description
+
+CTAN: 
+\family typewriter 
+macros/latex/contrib/bibtopic/
+\end_layout
+
+\begin_layout Description
+
+Notes: The package 
+\family sans 
+bibtopic
+\family default 
+ is used to split BibTeX created bibliographies into sections.
+\end_layout
+
+\begin_layout Subsection
+
 fancyhdr
 \end_layout
 
@@ -2513,15 +2540,13 @@ jura
 bib
 \family default 
  
-\color None
+\color none
 (
 \begin_inset LatexCommand \url{http://www.jurabib.org}
 
 \end_inset 
 
-)
-\color default
- can be used as an alternative to 
+) can be used as an alternative to 
 \family sans 
 natbib
 \family default 
index e084d31cb6b7f3aa630c837efd05a9a0e74ee116..a3d7ace5a03b1bdb86110eab32ecd1ee18ba8920 100644 (file)
@@ -1,5 +1,7 @@
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * lyx2lyx: up the format to 232.
+       
        * lyx2lyx: up the format to 231.
 
 2004-03-26  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
index b973a626bf2d55502915f8643fd5e351426225f0..535ba1d97e83f41893ef8b8e5afb9416a181868e 100755 (executable)
@@ -41,7 +41,7 @@ opt.quiet = 0
 format = re.compile(r"(\d)[\.,]?(\d\d)")
 fileformat = re.compile(r"\\lyxformat\s*(\S*)")
 lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229, 
-          230, 231]
+          230, 231, 232]
 
 def usage():
     print """Usage: lyx2lyx [options] [file]
diff --git a/lib/lyx2lyx/lyxconvert_231.py b/lib/lyx2lyx/lyxconvert_231.py
new file mode 100644 (file)
index 0000000..22c7fc6
--- /dev/null
@@ -0,0 +1,29 @@
+# This file is part of lyx2lyx
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2003 José Matos <jamatos@fep.up.pt>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+
+
+import sys
+from parser_tools import find_token
+
+
+def convert(header, body):
+    pass
+
+if __name__ == "__main__":
+    pass
diff --git a/lib/lyx2lyx/lyxrevert_232.py b/lib/lyx2lyx/lyxrevert_232.py
new file mode 100644 (file)
index 0000000..22c7fc6
--- /dev/null
@@ -0,0 +1,29 @@
+# This file is part of lyx2lyx
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2003 José Matos <jamatos@fep.up.pt>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+
+
+import sys
+from parser_tools import find_token
+
+
+def convert(header, body):
+    pass
+
+if __name__ == "__main__":
+    pass
index 4e0b80731a7eb40a0ae981ac8f9a04a84ce06c73..82cf1c2b80eb4c65c0b92e29892c1fbb3eadb498 100644 (file)
@@ -1,5 +1,9 @@
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * buffer.C: increment file format to 232.
+       * LaTeXFeatures.C: add bibtopic package.
+       * bufferparams.[Ch]: param \use_bibtopic.
+       
        * lyxrc.[Ch]: add lyxrc bibtex_command
        * LaTeX.C: use rc.bibtex_command instead of hardcoded string.
        
index f01df1577ae1bceb3c118a38665582e4dfa24081..9120330be01930af27c54fd19dffa89ab7afda05 100644 (file)
@@ -306,6 +306,12 @@ string const LaTeXFeatures::getPackages() const
                }
                packages << "]{natbib}\n";
        }
+       
+       // bibtopic -- the dot provides the aux file naming which
+       // LyX can detect.
+       if (isRequired("bibtopic")) {
+               packages << "\\usepackage[dot]{bibtopic}\n";
+       }
 
        return packages.str();
 }
index f4318371a4ae0437f542ec5ac79e028ee4c3ad46..708222efaf400dee92b50f1be4b7fc6e3302838a 100644 (file)
@@ -130,7 +130,7 @@ extern BufferList bufferlist;
 
 namespace {
 
-const int LYX_FORMAT = 231;
+const int LYX_FORMAT = 232;
 
 } // namespace anon
 
index 8fc59082dc7359017ab7d9c98279176b8a484f07..bad20e7492d458e4d62fb330535dbabfdcf143b7 100644 (file)
@@ -116,6 +116,7 @@ BufferParams::BufferParams()
        use_natbib = false;
        use_numerical_citations = false;
        use_jurabib = false;
+       use_bibtopic = false;
        tracking_changes = false;
        secnumdepth = 3;
        tocdepth = 3;
@@ -325,6 +326,9 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
        } else if (token == "\\use_jurabib") {
                lex.nextToken();
                use_jurabib = lex.getInteger();
+       } else if (token == "\\use_bibtopic") {
+               lex.nextToken();
+               use_bibtopic = lex.getInteger();
        } else if (token == "\\tracking_changes") {
                lex.nextToken();
                tracking_changes = lex.getInteger();
@@ -543,6 +547,7 @@ void BufferParams::writeFile(ostream & os) const
           << "\n\\use_natbib " << use_natbib
           << "\n\\use_numerical_citations " << use_numerical_citations
           << "\n\\use_jurabib " << use_jurabib
+           << "\n\\use_bibtopic " << use_bibtopic
           << "\n\\paperorientation " << string_orientation[orientation]
           << '\n';
 
index 1c414881a3a339c83a26b0ea4bdcea0fe302ad2b..ab798b19b907082be424c27b200594bedf0e740f 100644 (file)
@@ -184,6 +184,8 @@ public:
        bool use_numerical_citations;
        ///
        bool use_jurabib;
+       ///
+       bool use_bibtopic;
        /// revision tracking for this buffer ?
        bool tracking_changes;
        /// Time ago we agreed that this was a buffer property [ale990407]
index 4cbfa0fd8e487fbe0a905412d218a6322840b3ba..27f3f01dc2f608524cba414f184f6b2e90a74228 100644 (file)
@@ -1,3 +1,7 @@
+2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * ControlBibtex.[Ch]: add member usingBibtopic().
+
 2004-03-28  Alfredo Braunstein  <abraunst@lyx.org>
 
        * ControlDocument.C:
index 79a813faf4cd70df3facd3e827573a530ce8a17d..933b666bea82f8f561a4e3b00e4789df56182b68 100644 (file)
@@ -14,6 +14,9 @@
 
 #include "ControlBibtex.h"
 
+#include "buffer.h"
+#include "bufferparams.h"
+
 #include "lyxrc.h"
 #include "helper_funcs.h"
 #include "tex_helpers.h"
@@ -86,3 +89,9 @@ void ControlBibtex::rescanBibStyles() const
 {
        rescanTexStyles();
 }
+
+
+bool ControlBibtex::usingBibtopic() const
+{
+    return kernel().buffer().params().use_bibtopic;
+}
index 7c0bf1826a1bbbb0dc5cd09d616f31f1523a72a4..405445d3be34f26b3dd6bb0ccdeba55c723934ff 100644 (file)
@@ -45,6 +45,8 @@ public:
        /// build filelists of all availabe bib/bst/cls/sty-files. done through
        /// kpsewhich and an external script, saved in *Files.lst
        void rescanBibStyles() const;
+       /// do we use bibtopic (for sectioned bibliography)?
+       bool usingBibtopic() const;
 };
 
 
index 87cef54e6274cf053cbee1baa91d3f57589474b1..6d94a8f9e30d32ee74e7c660be66d94b55d885d3 100644 (file)
@@ -1,5 +1,10 @@
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * QBibtex.C:
+       * QDocument.C:
+       * QDocumentDialog.C:
+       * ui/BiblioModuleBase.ui: bibtopic support.
+       
        * QPrefs.C:
        * QPrefsDialog.C:
        * ui/QPrefsLaTeXModule.ui: customize bibtex call.
index e296f8181f2257c0efc222f2fc11529ce4e0d31d..3bc72f18ae248693da5c4316e6f9d3be7c7be1d9 100644 (file)
@@ -5,6 +5,7 @@
  *
  * \author John Levon
  * \author Herbert Voß
+ * \author Jürgen Spitzmüller
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -64,6 +65,8 @@ void QBibtex::build_dialog()
 
 void QBibtex::update_contents()
 {
+       bool bibtopic = controller().usingBibtopic();
+
        dialog_->databaseLB->clear();
 
        string bibs(controller().params().getContents());
@@ -90,18 +93,31 @@ void QBibtex::update_contents()
        string bibstyle(controller().params().getOptions());
 
        // bibtotoc exists?
-       if (prefixIs(bibstyle, bibtotoc)) {
-               dialog_->bibtocCB->setChecked(true);
-
+       if (prefixIs(bibstyle, bibtotoc)){
                // bibstyle exists?
                if (contains(bibstyle,','))
                        bibstyle = split(bibstyle, bibtotoc, ',');
                else
                        bibstyle.erase();
-       } else
-               dialog_->bibtocCB->setChecked(false);
+       }
 
+       if (prefixIs(bibstyle, bibtotoc) && !bibtopic)
+               dialog_->bibtocCB->setChecked(true);
+       else
+               dialog_->bibtocCB->setChecked(false);
 
+       dialog_->bibtocCB->setEnabled(!bibtopic);
+       
+       string btprint(controller().params().getSecOptions());
+       int btp = 0;
+       if (btprint == "btPrintNotCited")
+               btp = 1;
+       else if (btprint == "btPrintAll")
+               btp = 2;
+       
+       dialog_->btPrintCO->setCurrentItem(btp);
+       dialog_->btPrintCO->setEnabled(bibtopic);
+               
        dialog_->styleCB->clear();
 
        int item_nr(-1);
@@ -152,6 +168,27 @@ void QBibtex::apply()
                // command!
                controller().params().setOptions(bibstyle);
        }
+       
+       // bibtopic allows three kinds of sections:
+       // 1. sections that include all cited references of the database(s)
+       // 2. sections that include all uncited references of the database(s)
+       // 3. sections that include all references of the database(s), cited or not
+       int btp = dialog_->btPrintCO->currentItem();
+       
+       switch (btp) {
+       case 0:
+               controller().params().setSecOptions("btPrintCited");
+               break;
+       case 1:
+               controller().params().setSecOptions("btPrintNotCited");
+               break;
+       case 2:
+               controller().params().setSecOptions("btPrintAll");
+               break;
+       }
+       
+       if (!controller().usingBibtopic())
+               controller().params().setSecOptions("");
 }
 
 
index 1fb8b1d65dba10006f8db9429f58ea7a833bb9cd..1109771c1b1b23194d5bc120fb84365d52ad119a 100644 (file)
@@ -194,6 +194,8 @@ void QDocument::apply()
                dialog_->biblioModule->citeStyleCO->currentItem();
        params.use_jurabib =
                dialog_->biblioModule->citeJurabibRB->isChecked();
+       params.use_bibtopic =
+               dialog_->biblioModule->bibtopicCB->isChecked();
 
        // language & quotes
        if (dialog_->langModule->defaultencodingCB->isChecked()) {
@@ -440,7 +442,7 @@ void QDocument::update_contents()
        dialog_->preambleModule->preambleMLE->setText(preamble);
 
        // biblio
-       dialog_->biblioModule->citeNatbibRB->setChecked(
+       dialog_->biblioModule->citeDefaultRB->setChecked(
                !params.use_natbib && !params.use_jurabib);
        dialog_->biblioModule->citeNatbibRB->setChecked(
                params.use_natbib);
@@ -448,6 +450,8 @@ void QDocument::update_contents()
                params.use_numerical_citations ? 1 : 0);
        dialog_->biblioModule->citeJurabibRB->setChecked(
                params.use_jurabib);
+       dialog_->biblioModule->bibtopicCB->setChecked(
+               params.use_bibtopic);
 
        // language & quotes
        int const pos = int(findPos(lang_,
index 7c6a649f4a6bb19a81efde8cc238fbcf5248818e..25dcf9edadbf54f5de2b8a216de756ffaf38c9c4 100644 (file)
@@ -89,6 +89,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
        connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
        connect(biblioModule->citeStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
        connect(biblioModule->citeJurabibRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
+       connect(biblioModule->bibtopicCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
        // language & quote
        connect(langModule->languageCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
        connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
index 483a076e876eea4ed6ccf8864a54dedc812219cc..b9fd26d3bdfc5e4336befb2dee381f9263ad1cae 100644 (file)
@@ -13,7 +13,7 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>426</width>
+            <width>418</width>
             <height>376</height>
         </rect>
     </property>
                 </widget>
             </grid>
         </widget>
-        <spacer row="1"  column="0" >
+        <spacer row="2"  column="0" >
             <property>
                 <name>name</name>
                 <cstring>Spacer2</cstring>
                 </size>
             </property>
         </spacer>
+        <widget row="1"  column="0" >
+            <class>QCheckBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>bibtopicCB</cstring>
+            </property>
+            <property stdset="1">
+                <name>text</name>
+                <string>S&amp;ectioned bibliography</string>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>Select this if you want to split your bibliography into sections</string>
+            </property>
+        </widget>
     </grid>
 </widget>
 <connections>
index 38a077332b59402d30b588d57ec67fc9ff7836d8..c934965ca7d69644c348b24cb8dcb361fbef37a4 100644 (file)
@@ -13,8 +13,8 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>306</width>
-            <height>279</height>
+            <width>298</width>
+            <height>313</height>
         </rect>
     </property>
     <property stdset="1">
@@ -34,7 +34,7 @@
             <name>spacing</name>
             <number>6</number>
         </property>
-        <widget row="4"  column="0" >
+        <widget row="4"  column="0"  rowspan="1"  colspan="2" >
             <class>QLabel</class>
             <property stdset="1">
                 <name>name</name>
@@ -60,7 +60,7 @@
                 <string>The BibTeX style</string>
             </property>
         </widget>
-        <widget row="7"  column="0"  rowspan="1"  colspan="2" >
+        <widget row="8"  column="0"  rowspan="1"  colspan="3" >
             <class>QLayoutWidget</class>
             <property stdset="1">
                 <name>name</name>
                 </widget>
             </hbox>
         </widget>
-        <widget row="0"  column="0"  rowspan="1"  colspan="2" >
+        <widget row="0"  column="0"  rowspan="1"  colspan="3" >
             <class>QLabel</class>
             <property stdset="1">
                 <name>name</name>
                 <name>vAlign</name>
             </property>
         </widget>
-        <widget row="1"  column="0"  rowspan="3"  colspan="1" >
+        <widget row="1"  column="0"  rowspan="3"  colspan="2" >
             <class>QListBox</class>
             <property stdset="1">
                 <name>name</name>
                 <string>Selected BibTeX databases</string>
             </property>
         </widget>
-        <widget row="1"  column="1" >
+        <widget row="1"  column="2" >
             <class>QPushButton</class>
             <property stdset="1">
                 <name>name</name>
                 <string>Add a BibTeX database file</string>
             </property>
         </widget>
-        <widget row="2"  column="1" >
+        <widget row="2"  column="2" >
             <class>QPushButton</class>
             <property stdset="1">
                 <name>name</name>
                 <string>Remove the selected database</string>
             </property>
         </widget>
-        <spacer row="3"  column="1" >
+        <spacer row="3"  column="2"  rowspan="2"  colspan="1" >
             <property>
                 <name>name</name>
                 <cstring>Spacer5</cstring>
                 </size>
             </property>
         </spacer>
-        <widget row="5"  column="0" >
+        <widget row="5"  column="0"  rowspan="1"  colspan="2" >
             <class>QComboBox</class>
             <property stdset="1">
                 <name>name</name>
                 <string>Chose a style file</string>
             </property>
         </widget>
-        <widget row="5"  column="1" >
+        <widget row="5"  column="2" >
             <class>QPushButton</class>
             <property stdset="1">
                 <name>name</name>
                 <string>Choose a style file</string>
             </property>
         </widget>
-        <widget row="6"  column="0" >
-            <class>QCheckBox</class>
-            <property stdset="1">
-                <name>name</name>
-                <cstring>bibtocCB</cstring>
-            </property>
-            <property stdset="1">
-                <name>text</name>
-                <string>Add bibliography to &amp;TOC</string>
-            </property>
-            <property>
-                <name>toolTip</name>
-                <string>Add bibliography to the table of contents</string>
-            </property>
-        </widget>
-        <spacer row="6"  column="1" >
+        <spacer row="6"  column="2"  rowspan="2"  colspan="1" >
             <property>
                 <name>name</name>
                 <cstring>Spacer6</cstring>
                 </size>
             </property>
         </spacer>
+        <widget row="6"  column="1" >
+            <class>QComboBox</class>
+            <item>
+                <property>
+                    <name>text</name>
+                    <string>all cited references</string>
+                </property>
+            </item>
+            <item>
+                <property>
+                    <name>text</name>
+                    <string>all uncited references</string>
+                </property>
+            </item>
+            <item>
+                <property>
+                    <name>text</name>
+                    <string>all references</string>
+                </property>
+            </item>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>btPrintCO</cstring>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>This bibliography section contains...</string>
+            </property>
+        </widget>
+        <widget row="6"  column="0" >
+            <class>QLabel</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>btPrintLA</cstring>
+            </property>
+            <property stdset="1">
+                <name>sizePolicy</name>
+                <sizepolicy>
+                    <hsizetype>1</hsizetype>
+                    <vsizetype>0</vsizetype>
+                </sizepolicy>
+            </property>
+            <property stdset="1">
+                <name>text</name>
+                <string>C&amp;ontent:</string>
+            </property>
+            <property>
+                <name>buddy</name>
+                <cstring>styleCB</cstring>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>This bibliography section contains...</string>
+            </property>
+        </widget>
+        <widget row="7"  column="0"  rowspan="1"  colspan="2" >
+            <class>QCheckBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>bibtocCB</cstring>
+            </property>
+            <property stdset="1">
+                <name>text</name>
+                <string>Add bibliography to &amp;TOC</string>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>Add bibliography to the table of contents</string>
+            </property>
+        </widget>
     </grid>
 </widget>
 <connections>
         <receiver>QBibtexDialogBase</receiver>
         <slot>change_adaptor()</slot>
     </connection>
+    <connection>
+        <sender>btPrintCO</sender>
+        <signal>activated(int)</signal>
+        <receiver>QBibtexDialogBase</receiver>
+        <slot>change_adaptor()</slot>
+    </connection>
     <connection>
         <sender>addBibPB</sender>
         <signal>clicked()</signal>
     <tabstop>styleCB</tabstop>
     <tabstop>stylePB</tabstop>
     <tabstop>bibtocCB</tabstop>
+    <tabstop>btPrintCO</tabstop>
     <tabstop>okPB</tabstop>
     <tabstop>closePB</tabstop>
 </tabstops>
index fca5762f09015bb59e04557df6abc274fc98e8ea..6fb67f15cae5154f08e86d3aee0369157f301d74 100644 (file)
@@ -1,5 +1,10 @@
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * FormBibtex.C:
+       * FormDocument.[Ch]:
+       * forms/form_bibtex.fd: bibtopic support.
+       * forms/form_document.fd: radio default/natbib/jurabib.
+       
        * FormPreferences.C:
        * forms/form_preferences.fd: customize bibtex call.
        
index 71416187e1356669392e783a7089bb184adb3c63..4f4e5f48795fac6c24e494a93bfa6b41e2710d6d 100644 (file)
@@ -66,6 +66,7 @@ void FormBibtex::build()
        bcview().addReadOnly(dialog_->button_rescan);
        bcview().addReadOnly(dialog_->input_style);
        bcview().addReadOnly(dialog_->check_bibtotoc);
+       bcview().addReadOnly(dialog_->choice_btprint);
 
        // trigger an input event for cut&paste with middle mouse button.
        setPrehandler(dialog_->input_database);
@@ -77,6 +78,11 @@ void FormBibtex::build()
        // callback for double click in browser
        fl_set_browser_dblclick_callback(dialog_->browser_styles,
                                         C_FormDialogView_InputCB, 2);
+                                        
+       fl_addto_choice(dialog_->choice_btprint,
+                       _(" all cited references "
+                         "| all uncited references "
+                         "| all references ").c_str());
 
        // set up the tooltips
        string str = _("The database you want to cite from. Insert it "
@@ -107,6 +113,9 @@ void FormBibtex::build()
                "the styles which are in directories where TeX finds them "
                "are listed!");
        tooltips().init(dialog_->button_rescan, str);
+       
+       str = _("The bibliography section contains...");
+       tooltips().init(dialog_->choice_btprint, str);
 }
 
 
@@ -177,8 +186,10 @@ void FormBibtex::update()
        string bibtotoc = "bibtotoc";
        string bibstyle = controller().params().getOptions();
 
+       bool const bibtopic = controller().usingBibtopic();
        bool const bibtotoc_exists = prefixIs(bibstyle, bibtotoc);
-       fl_set_button(dialog_->check_bibtotoc, bibtotoc_exists);
+       fl_set_button(dialog_->check_bibtotoc, bibtotoc_exists && !bibtopic);
+       setEnabled(dialog_->check_bibtotoc, !bibtopic);
        if (bibtotoc_exists) {
                if (contains(bibstyle, ',')) { // bibstyle exists?
                        bibstyle = split(bibstyle, bibtotoc, ',');
@@ -187,6 +198,16 @@ void FormBibtex::update()
                }
        }
        fl_set_input(dialog_->input_style, bibstyle.c_str());
+       
+       string btprint = controller().params().getSecOptions();
+       int btp = 1;
+       if (btprint == "btPrintNotCited")
+               btp = 2;
+       else if (btprint == "btPrintAll")
+               btp = 3;
+       
+       fl_set_choice(dialog_->choice_btprint, btp);
+       setEnabled(dialog_->choice_btprint, bibtopic);
 
        vector<string> styles;
        controller().getBibStyles(styles);
@@ -219,6 +240,7 @@ void FormBibtex::apply()
                // no database -> no bibtex-command and no options!
                controller().params().setContents("");
                controller().params().setOptions("");
+               controller().params().setSecOptions("");
                return;
        }
 
@@ -238,7 +260,30 @@ void FormBibtex::apply()
                controller().params().setOptions(bibtotoc + ',' + bibstyle);
 
        } else {
-               // At least one of addtotoc and bibstyle is empty. No harm to output both!
+               // At least one of addtotoc and bibstyle is empty. 
+               // No harm to output both!
                controller().params().setOptions(bibtotoc + bibstyle);
        }
+       
+       // bibtopic allows three kinds of sections:
+       // 1. sections that include all cited references of the database(s)
+       // 2. sec. that include all uncited references of the database(s)
+       // 3. sec. that include all references of the database(s), cited or not
+       if (controller().usingBibtopic()){
+               int btp = fl_get_choice(dialog_->choice_btprint);
+               switch (btp) {
+               case 1:
+                       controller().params().setSecOptions("btPrintCited");
+                       break;
+               case 2:
+                       controller().params().setSecOptions("btPrintNotCited");
+                       break;
+               case 3:
+                       controller().params().setSecOptions("btPrintAll");
+                       break;
+               }
+       }
+       
+       else
+               controller().params().setSecOptions("");
 }
index 7b5a55d7de5583f7b4b6a7ea173780bb9638513c..07bc5bb08623ba13fcbee093c537ab63354d922d 100644 (file)
@@ -70,6 +70,11 @@ bool const scalableTabfolders = false;
 bool const scalableTabfolders = true;
 #endif
 
+enum {
+       DEFCITE,
+       NATBIB,
+       JURABIB
+};
 
 } // namespace anon
 
@@ -298,17 +303,28 @@ void FormDocument::build()
        bcview().addReadOnly(options_->counter_secnumdepth);
        bcview().addReadOnly(options_->counter_tocdepth);
        bcview().addReadOnly(options_->choice_ams_math);
-       bcview().addReadOnly(options_->check_use_natbib);
-       bcview().addReadOnly(options_->check_use_jurabib);
+       bcview().addReadOnly(options_->radio_use_defcite);
+       bcview().addReadOnly(options_->radio_use_jurabib);
+       bcview().addReadOnly(options_->radio_use_natbib);
+       bcview().addReadOnly(options_->check_bibtopic);
        bcview().addReadOnly(options_->choice_citation_format);
        bcview().addReadOnly(options_->input_float_placement);
        bcview().addReadOnly(options_->choice_postscript_driver);
        
+       // add cite style radio buttons
+       citestyle_.init(options_->radio_use_defcite,   DEFCITE);
+       citestyle_.init(options_->radio_use_natbib,  NATBIB);
+       citestyle_.init(options_->radio_use_jurabib,  JURABIB);
+       
        // set up the tooltips for optionss form
-       string str = _("Use the natbib styles for natural sciences and arts");
-       tooltips().init(options_->check_use_natbib, str);
+       string str = _("Use LaTeX's default citation style");
+       tooltips().init(options_->radio_use_defcite, str);
+       str = _("Use the natbib styles for natural sciences and arts");
+       tooltips().init(options_->radio_use_natbib, str);
        str = _("Use the jurabib styles for law and humanities");
-       tooltips().init(options_->check_use_jurabib, str);
+       tooltips().init(options_->radio_use_jurabib, str);
+       str = _("Select this if you want to split your bibliography into sections");
+       tooltips().init(options_->check_bibtopic, str);
 
        // trigger an input event for cut&paste with middle mouse button.
        setPrehandler(options_->input_float_placement);
@@ -514,17 +530,11 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
                        fl_set_choice_text(class_->choice_skip_units,
                                           default_unit.c_str());
 
-       } else if (ob == options_->check_use_natbib) {
-               setEnabled(options_->choice_citation_format,
-                          fl_get_button(options_->check_use_natbib));
-               if (fl_get_button(options_->check_use_natbib))
-                       fl_set_button(options_->check_use_jurabib, 0);
-                          
-       } else if (ob == options_->check_use_jurabib) {
-               if (fl_get_button(options_->check_use_jurabib))
-                       fl_set_button(options_->check_use_natbib, 0);
+       } else if (ob == options_->radio_use_jurabib || 
+                  ob == options_->radio_use_defcite || 
+                  ob == options_->radio_use_natbib) {
                setEnabled(options_->choice_citation_format,
-                          fl_get_button(options_->check_use_natbib));
+                          fl_get_button(options_->radio_use_natbib));
 
        } else if (ob == branch_->browser_all_branches ||
                        ob == branch_->browser_selection ||
@@ -1013,10 +1023,11 @@ bool FormDocument::options_apply(BufferParams & params)
        params.graphicsDriver = getString(options_->choice_postscript_driver);
        params.use_amsmath = static_cast<BufferParams::AMS>(
                fl_get_choice(options_->choice_ams_math) - 1);
-       params.use_natbib  = fl_get_button(options_->check_use_natbib);
+       params.use_natbib  = fl_get_button(options_->radio_use_natbib);
        params.use_numerical_citations  =
                fl_get_choice(options_->choice_citation_format) - 1;
-       params.use_jurabib  = fl_get_button(options_->check_use_jurabib);
+       params.use_jurabib  = fl_get_button(options_->radio_use_jurabib);
+       params.use_bibtopic  = fl_get_button(options_->check_bibtopic);
 
        int tmpchar = int(fl_get_counter_value(options_->counter_secnumdepth));
        if (params.secnumdepth != tmpchar)
@@ -1182,11 +1193,12 @@ void FormDocument::options_update(BufferParams const & params)
        fl_set_choice_text(options_->choice_postscript_driver,
                           params.graphicsDriver.c_str());
        fl_set_choice(options_->choice_ams_math, params.use_amsmath + 1);
-       fl_set_button(options_->check_use_natbib,  params.use_natbib);
+       fl_set_button(options_->radio_use_natbib,  params.use_natbib);
        fl_set_choice(options_->choice_citation_format,
                      int(params.use_numerical_citations)+1);
        setEnabled(options_->choice_citation_format, params.use_natbib);
-       fl_set_button(options_->check_use_jurabib,  params.use_jurabib);
+       fl_set_button(options_->radio_use_jurabib,  params.use_jurabib);
+       fl_set_button(options_->check_bibtopic,  params.use_bibtopic);
        fl_set_counter_value(options_->counter_secnumdepth, params.secnumdepth);
        fl_set_counter_value(options_->counter_tocdepth, params.tocdepth);
        if (!params.float_placement.empty())
index 3cd5084a785f94334db724fc7530e1c7e60b9197..729043ac3213d348b25841b7a768abb31a712c06 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "FormBase.h"
 #include "BranchList.h"
+#include "RadioButtonGroup.h"
 
 #include <boost/scoped_ptr.hpp>
 
@@ -141,6 +142,9 @@ private:
        std::vector<std::string> lang_;
        /// Contains all legal branches for this doc
        BranchList branchlist_;
+       
+       /// citation style buttons
+       RadioButtonGroup citestyle_;
 };
 
 #endif
index 7065b4a9f195c8534a04f51d93a31986e6ddb56f..fc6292d8481ca5061c0a1919f6699ab57d67b92c 100644 (file)
@@ -10,13 +10,13 @@ SnapGrid: 5
 =============== FORM ===============
 Name: form_bibtex
 Width: 395
-Height: 235
-Number of Objects: 12
+Height: 255
+Number of Objects: 13
 
 --------------------
 class: FL_BOX
 type: FLAT_BOX
-box: 0 0 395 235
+box: 0 0 395 255
 boxtype: FL_FLAT_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -70,7 +70,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: RETURN_BUTTON
-box: 110 205 90 25
+box: 110 225 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -88,7 +88,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 300 205 90 25
+box: 300 225 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -142,7 +142,7 @@ argument: 0
 --------------------
 class: FL_CHECKBUTTON
 type: PUSH_BUTTON
-box: 5 165 180 25
+box: 5 190 180 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
@@ -160,7 +160,7 @@ argument: 0
 --------------------
 class: FL_BROWSER
 type: HOLD_BROWSER
-box: 245 50 145 145
+box: 245 50 145 165
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_TOP_LEFT
@@ -196,7 +196,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 205 205 90 25
+box: 205 225 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -214,7 +214,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 5 205 90 25
+box: 5 225 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -229,5 +229,23 @@ name: button_restore
 callback: C_FormDialogView_RestoreCB
 argument: 0
 
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 85 155 145 25
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Content:|#o
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: choice_btprint
+callback: C_FormDialogView_InputCB
+argument: 0
+
 ==============================
 create_the_forms
index b10f87be349c3ec9ee84b039232646d9cfb02a05..e696ee4693b361125a66b52c1c852f731c8f3a06 100644 (file)
@@ -1260,7 +1260,7 @@ argument: 0
 Name: form_document_options
 Width: 395
 Height: 315
-Number of Objects: 10
+Number of Objects: 12
 
 --------------------
 class: FL_BOX
@@ -1283,7 +1283,7 @@ argument:
 --------------------
 class: FL_INPUT
 type: NORMAL_INPUT
-box: 185 15 120 25
+box: 185 10 120 25
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_MCOL
 alignment: FL_ALIGN_LEFT
@@ -1301,7 +1301,7 @@ argument: 0
 --------------------
 class: FL_COUNTER
 type: SIMPLE_COUNTER
-box: 185 55 80 25
+box: 185 40 80 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_BLUE
 alignment: FL_ALIGN_LEFT
@@ -1323,7 +1323,7 @@ argument: 0
 --------------------
 class: FL_COUNTER
 type: SIMPLE_COUNTER
-box: 185 90 80 25
+box: 185 70 80 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_BLUE
 alignment: FL_ALIGN_LEFT
@@ -1345,7 +1345,7 @@ argument: 0
 --------------------
 class: FL_CHOICE
 type: NORMAL_CHOICE
-box: 185 125 140 25
+box: 185 100 140 25
 boxtype: FL_FRAME_BOX
 colors: FL_COL1 FL_BLACK
 alignment: FL_ALIGN_LEFT
@@ -1361,30 +1361,30 @@ callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
-class: FL_CHECKBUTTON
-type: PUSH_BUTTON
-box: 35 205 140 25
+class: FL_ROUND3DBUTTON
+type: RADIO_BUTTON
+box: 25 205 140 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
 style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
-label: Use Natbib|#N
+label: Natbib|#N
 shortcut: 
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
-name: check_use_natbib
+name: radio_use_natbib
 callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
 class: FL_CHOICE
 type: NORMAL_CHOICE
-box: 185 235 140 25
+box: 235 230 140 25
 boxtype: FL_FRAME_BOX
 colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
+alignment: FL_ALIGN_TOP_LEFT
 style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
@@ -1399,7 +1399,7 @@ argument: 0
 --------------------
 class: FL_CHOICE
 type: NORMAL_CHOICE
-box: 185 155 140 25
+box: 185 130 140 25
 boxtype: FL_FRAME_BOX
 colors: FL_COL1 FL_BLACK
 alignment: FL_ALIGN_LEFT
@@ -1417,7 +1417,7 @@ argument: 0
 --------------------
 class: FL_LABELFRAME
 type: ENGRAVED_FRAME
-box: 15 190 370 110
+box: 15 170 370 95
 boxtype: FL_NO_BOX
 colors: FL_BLACK FL_COL1
 alignment: FL_ALIGN_TOP_LEFT
@@ -1432,21 +1432,57 @@ name:
 callback: 
 argument: 
 
+--------------------
+class: FL_ROUND3DBUTTON
+type: RADIO_BUTTON
+box: 25 230 140 25
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Jurabib|#J
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: radio_use_jurabib
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_ROUND3DBUTTON
+type: RADIO_BUTTON
+box: 25 180 155 25
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Default (numerical)|#D
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: radio_use_defcite
+callback: C_FormBaseInputCB
+argument: 0
+
 --------------------
 class: FL_CHECKBUTTON
 type: PUSH_BUTTON
-box: 35 265 140 25
+box: 15 270 255 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
 style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
-label: Use Jurabib|#J
+label: Sectioned bibliography|#e
 shortcut: 
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
-name: check_use_jurabib
+name: check_bibtopic
 callback: C_FormBaseInputCB
 argument: 0
 
index a5bbf7d34c4b03d9d63a4827d900c2d32b684c4e..3b96314804100e25152cef3eeb3c64bb4fbef9f4 100644 (file)
@@ -1,5 +1,7 @@
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * insetbibtex.[Ch]: bibtopic support.
+       
        * insetfloat.[Ch]: add param \sideways {true|false}
        (support for sideways floats from rotating.sty).
 
index 6a7e97fdd8546f09d77a8c5f19c15b02afcc386c..b87735194853b2f1e3310b72d2ed9c8cc7b8aeee 100644 (file)
@@ -17,6 +17,7 @@
 #include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
+#include "LaTeXFeatures.h"
 #include "gettext.h"
 #include "metricsinfo.h"
 #include "outputparams.h"
@@ -93,13 +94,34 @@ string const InsetBibtex::getScreenLabel(Buffer const &) const
 int InsetBibtex::latex(Buffer const & buffer, ostream & os,
                       OutputParams const & runparams) const
 {
-       // changing the sequence of the commands
+       // the sequence of the commands:
        // 1. \bibliographystyle{style}
        // 2. \addcontentsline{...} - if option bibtotoc set
        // 3. \bibliography{database}
+       // and with bibtopic:
+       // 1. \bibliographystyle{style}
+       // 2. \begin{btSect}{database}
+       // 3. \btPrint{Cited|NotCited|All}
+       // 4. \end{btSect}
+       
+       // the database string
        string adb;
        string db_in = getContents();
        db_in = split(db_in, adb, ',');
+       // If we generate in a temp dir, we might need to give an
+       // absolute path there. This is a bit complicated since we can
+       // have a comma-separated list of bibliographies
+       string db_out;
+       while (!adb.empty()) {
+               if (!runparams.nice &&
+                   IsFileReadable(MakeAbsPath(adb, buffer.filePath())+".bib"))
+                        adb = os::external_path(MakeAbsPath(adb, 
+                               buffer.filePath()));
+               db_out += adb;
+               db_out += ',';
+               db_in = split(db_in, adb,',');
+       }
+       db_out = rtrim(db_out, ",");
 
        // Style-Options
        string style = getOptions(); // maybe empty! and with bibtotoc
@@ -110,18 +132,33 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
                        style = split(style, bibtotoc, ',');
                }
        }
+       
+       // line count
+       int i = 0;
 
        if (!runparams.nice
            && IsFileReadable(MakeAbsPath(style, buffer.filePath()) + ".bst")) {
                style = MakeAbsPath(style, buffer.filePath());
        }
 
-       if (!style.empty()) { // we want no \biblio...{}
+       if (!style.empty()) {
                os << "\\bibliographystyle{" << style << "}\n";
+               i += 1;
+       }
+       
+       if (buffer.params().use_bibtopic){
+               os << "\\begin{btSect}{" << db_out << "}\n";
+               string btprint = getSecOptions();
+               if (btprint.empty())
+                       // default
+                       btprint = "btPrintCited";
+               os << "\\" << btprint << "\n"
+                  << "\\end{btSect}\n";
+               i += 3;
        }
 
        // bibtotoc-Option
-       if (!bibtotoc.empty()) {
+       if (!bibtotoc.empty() && !buffer.params().use_bibtopic) {
                // maybe a problem when a textclass has no "art" as
                // part of its name, because it's than book.
                // For the "official" lyx-layouts it's no problem to support
@@ -145,22 +182,12 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
                }
        }
 
-       // database
-       // If we generate in a temp dir, we might need to give an
-       // absolute path there. This is a bit complicated since we can
-       // have a comma-separated list of bibliographies
-       string db_out;
-       while (!adb.empty()) {
-               if (!runparams.nice &&
-                   IsFileReadable(MakeAbsPath(adb, buffer.filePath())+".bib"))
-                        adb = os::external_path(MakeAbsPath(adb, buffer.filePath()));
-               db_out += adb;
-               db_out += ',';
-               db_in = split(db_in, adb,',');
+       if (!buffer.params().use_bibtopic){
+               os << "\\bibliography{" << db_out << "}\n";
+               i += 1;
        }
-       db_out = rtrim(db_out, ",");
-       os << "\\bibliography{" << db_out << "}\n";
-       return 2;
+       
+       return i;
 }
 
 
@@ -256,3 +283,11 @@ bool InsetBibtex::delDatabase(string const & db)
        }
        return true;
 }
+
+
+void InsetBibtex::validate(LaTeXFeatures & features) const
+{
+       if (features.bufferParams().use_bibtopic)
+               features.require("bibtopic");
+}
+
index cb6128226e54b850b48687950611720ece0ff35d..0a7cbf7093a71798a37cca582c9a118b35bb216a 100644 (file)
@@ -44,6 +44,8 @@ public:
        bool addDatabase(std::string const &);
        ///
        bool delDatabase(std::string const &);
+       ///
+       void validate(LaTeXFeatures &) const;
 protected:
        ///
        virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd);