]> git.lyx.org Git - features.git/commitdiff
customize bibtex call (bug 720)
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 29 Mar 2004 12:11:53 +0000 (12:11 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 29 Mar 2004 12:11:53 +0000 (12:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8559 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/LaTeX.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/QPrefs.C
src/frontends/qt2/QPrefsDialog.C
src/frontends/qt2/ui/QPrefLatexModule.ui
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/forms/form_preferences.fd
src/lyxrc.C
src/lyxrc.h

index 5e27f6f39f28154c0804d0680449115e67e876fd..4e0b80731a7eb40a0ae981ac8f9a04a84ce06c73 100644 (file)
@@ -1,5 +1,8 @@
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * lyxrc.[Ch]: add lyxrc bibtex_command
+       * LaTeX.C: use rc.bibtex_command instead of hardcoded string.
+       
        * buffer.C: increment file format to 231.
 
 2004-03-28  Alfredo Braunstein  <abraunst@lyx.org>
index 6640b7fb7d0eb3b91f1cf2dfbbbb243d272f7de5..4a54f6e4926031963924f3a011003f50bc13882b 100644 (file)
@@ -17,6 +17,7 @@
 #include "LaTeX.h"
 #include "bufferlist.h"
 #include "gettext.h"
+#include "lyxrc.h"
 #include "debug.h"
 #include "DepTable.h"
 #include "support/filetools.h"
@@ -70,13 +71,11 @@ using std::vector;
 //   BufferList::updateIncludedTeXfiles, this should either
 //   be done before calling LaTeX::funcs or in a completely
 //   different way.
-// - the bibtex command options should be supported.
 // - the makeindex style files should be taken care of with
 //   the dependency mechanism.
 // - makeindex commandline options should be supported
 // - somewhere support viewing of bibtex and makeindex log files.
 // - we should perhaps also scan the bibtex log file
-// - we should perhaps also scan the bibtex log file
 
 extern BufferList bufferlist;
 
@@ -528,11 +527,7 @@ bool LaTeX::runBibTeX(vector<Aux_Info> const & bibtex_info)
                        continue;
                result = true;
 
-               // FIXME: the bibtex call should not be hardcoded. bibtex has 
-               // options (--min-crossrefs is useful) and there are also 
-               // alternatives (bibtex8, bibulus, mlbibtex, clbibtex etc.). 
-               // Move to converters? (JSpitzm)
-               string tmp = "bibtex ";
+               string tmp = lyxrc.bibtex_command + " ";
                tmp += OnlyFilename(ChangeExtension(it->aux_file, string()));
                Systemcall one;
                one.startscript(Systemcall::Wait, tmp);
index 0d6ce8b28065eac108e9ae00e25f58445df7132b..87cef54e6274cf053cbee1baa91d3f57589474b1 100644 (file)
@@ -1,5 +1,9 @@
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * QPrefs.C:
+       * QPrefsDialog.C:
+       * ui/QPrefsLaTeXModule.ui: customize bibtex call.
+       
        * QFloat.C:
        * QFloatDialog.C:
        * floatplacement.[Ch]: add support for sidewaysfloats
index 3c8c1072e4f59883ac89a9e1d5ace2604d00d3cb..4f9fd856c79455105f782f2662a970ff90a7e7f8 100644 (file)
@@ -161,6 +161,7 @@ void QPrefs::apply()
 
        rc.fontenc = fromqstr(latexmod->latexEncodingED->text());
        rc.chktex_command = fromqstr(latexmod->latexChecktexED->text());
+       rc.bibtex_command = fromqstr(latexmod->latexBibtexED->text());
        rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
        rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
        rc.default_papersize =
@@ -472,6 +473,7 @@ void QPrefs::update_contents()
 
        latexmod->latexEncodingED->setText(toqstr(rc.fontenc));
        latexmod->latexChecktexED->setText(toqstr(rc.chktex_command));
+       latexmod->latexBibtexED->setText(toqstr(rc.bibtex_command));
        latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
        latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
        latexmod->latexPaperSizeCO->setCurrentItem(rc.default_papersize);
index 169c9afb9d907f27103f8c61e8f107f0e495d6b2..4f20c39fbf25bf2327a0b93079f2f24a9eedfd80 100644 (file)
@@ -202,6 +202,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
        connect(dateModule->DateED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
        connect(latexModule->latexEncodingED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
        connect(latexModule->latexChecktexED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
+       connect(latexModule->latexBibtexED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
        connect(latexModule->latexAutoresetCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
        connect(latexModule->latexDviPaperED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
        connect(latexModule->latexPaperSizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
index 64134a2e7ea0740bb9f7937cfe5ed4a886c77979..982fe96e693d93000dda8baa42223bf7afb5f7e6 100644 (file)
@@ -13,7 +13,7 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>376</width>
+            <width>372</width>
             <height>237</height>
         </rect>
     </property>
@@ -21,7 +21,7 @@
         <name>caption</name>
         <string>LaTeX settings</string>
     </property>
-    <vbox>
+    <grid>
         <property stdset="1">
             <name>margin</name>
             <number>11</number>
@@ -30,7 +30,7 @@
             <name>spacing</name>
             <number>6</number>
         </property>
-        <widget>
+        <widget row="0"  column="0" >
             <class>QLayoutWidget</class>
             <property stdset="1">
                 <name>name</name>
                 </spacer>
             </hbox>
         </widget>
-        <widget>
+        <widget row="1"  column="0" >
             <class>QCheckBox</class>
             <property stdset="1">
                 <name>name</name>
                 <string>Set class options to default on class change</string>
             </property>
         </widget>
-        <widget>
+        <spacer row="3"  column="0" >
+            <property>
+                <name>name</name>
+                <cstring>Spacer3</cstring>
+            </property>
+            <property stdset="1">
+                <name>orientation</name>
+                <enum>Vertical</enum>
+            </property>
+            <property stdset="1">
+                <name>sizeType</name>
+                <enum>Expanding</enum>
+            </property>
+            <property>
+                <name>sizeHint</name>
+                <size>
+                    <width>20</width>
+                    <height>20</height>
+                </size>
+            </property>
+        </spacer>
+        <widget row="2"  column="0" >
             <class>QGroupBox</class>
             <property stdset="1">
                 <name>name</name>
                     <name>spacing</name>
                     <number>6</number>
                 </property>
-                <widget row="0"  column="0" >
+                <widget row="2"  column="0" >
                     <class>QLabel</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>latexChecktexLA</cstring>
+                        <cstring>latexDviPaperLA</cstring>
                     </property>
                     <property stdset="1">
                         <name>text</name>
-                        <string>Chec&amp;kTeX command:</string>
+                        <string>DVI viewer paper size options:</string>
                     </property>
                     <property>
                         <name>buddy</name>
+                        <cstring>latexDviPaperED</cstring>
+                    </property>
+                </widget>
+                <widget row="2"  column="1" >
+                    <class>QLineEdit</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>latexDviPaperED</cstring>
+                    </property>
+                    <property>
+                        <name>toolTip</name>
+                        <string>Optional paper size flag (-paper) for some DVI viewers</string>
+                    </property>
+                </widget>
+                <widget row="0"  column="1" >
+                    <class>QLineEdit</class>
+                    <property stdset="1">
+                        <name>name</name>
                         <cstring>latexChecktexED</cstring>
                     </property>
+                    <property>
+                        <name>toolTip</name>
+                        <string>CheckTeX start options and flags</string>
+                    </property>
                 </widget>
-                <widget row="1"  column="0" >
+                <widget row="0"  column="0" >
                     <class>QLabel</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>latexDviPaperLA</cstring>
+                        <cstring>latexChecktexLA</cstring>
                     </property>
                     <property stdset="1">
                         <name>text</name>
-                        <string>DVI viewer paper size options:</string>
+                        <string>Chec&amp;kTeX command:</string>
                     </property>
                     <property>
                         <name>buddy</name>
-                        <cstring>latexDviPaperED</cstring>
+                        <cstring>latexChecktexED</cstring>
                     </property>
                 </widget>
                 <widget row="1"  column="1" >
                     <class>QLineEdit</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>latexDviPaperED</cstring>
+                        <cstring>latexBibtexED</cstring>
                     </property>
                     <property>
                         <name>toolTip</name>
-                        <string>Optional paper size flag (-paper) for some DVI viewers</string>
+                        <string>BibTeX command and options</string>
                     </property>
                 </widget>
-                <widget row="0"  column="1" >
-                    <class>QLineEdit</class>
+                <widget row="1"  column="0" >
+                    <class>QLabel</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>latexChecktexED</cstring>
+                        <cstring>latexChecktexLA_2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;BibTeX command:</string>
                     </property>
                     <property>
-                        <name>toolTip</name>
-                        <string>CheckTeX start options and flags</string>
+                        <name>buddy</name>
+                        <cstring>latexChecktexED</cstring>
                     </property>
                 </widget>
             </grid>
         </widget>
-        <spacer>
-            <property>
-                <name>name</name>
-                <cstring>Spacer3</cstring>
-            </property>
-            <property stdset="1">
-                <name>orientation</name>
-                <enum>Vertical</enum>
-            </property>
-            <property stdset="1">
-                <name>sizeType</name>
-                <enum>Expanding</enum>
-            </property>
-            <property>
-                <name>sizeHint</name>
-                <size>
-                    <width>20</width>
-                    <height>20</height>
-                </size>
-            </property>
-        </spacer>
-    </vbox>
+    </grid>
 </widget>
 <tabstops>
     <tabstop>latexEncodingED</tabstop>
index 57cc59170d6c02d1d5e9c0efac2c9bddc564e3f8..fca5762f09015bb59e04557df6abc274fc98e8ea 100644 (file)
@@ -1,5 +1,8 @@
 2004-03-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * FormPreferences.C:
+       * forms/form_preferences.fd: customize bibtex call.
+       
        * FormFloat.C:
        * forms/form_float.fd:
        add support for sidewaysfloats
index db10c7371eb01f89e805eadc63e3e96cfbfd279b..564629b5c4680646f19318534b1ba9a91c2132a1 100644 (file)
@@ -1737,6 +1737,7 @@ void FormPreferences::OutputsMisc::apply(LyXRC & rc) const
 
        rc.ascii_roff_command = fl_get_input(dialog_->input_ascii_roff);
        rc.chktex_command = fl_get_input(dialog_->input_checktex);
+       rc.bibtex_command = fl_get_input(dialog_->input_bibtex);
        rc.view_dvi_paper_option = fl_get_input(dialog_->input_paperoption);
        rc.auto_reset_options = fl_get_button(dialog_->check_autoreset_classopt);
 }
@@ -1802,6 +1803,8 @@ void FormPreferences::OutputsMisc::update(LyXRC const & rc)
                     rc.ascii_roff_command.c_str());
        fl_set_input(dialog_->input_checktex,
                     rc.chktex_command.c_str());
+       fl_set_input(dialog_->input_bibtex,
+                    rc.bibtex_command.c_str());
        fl_set_input(dialog_->input_paperoption,
                     rc.view_dvi_paper_option.c_str());
        fl_set_button(dialog_->check_autoreset_classopt,
index a4c47e7a873ce90d52f95a0adbe14430f604d2db..be885d9a77b70b6cb730764ca15d48eddf7c33f4 100644 (file)
@@ -2750,7 +2750,7 @@ argument:
 Name: form_preferences_outputs_misc
 Width: 455
 Height: 375
-Number of Objects: 10
+Number of Objects: 11
 
 --------------------
 class: FL_BOX
@@ -2849,7 +2849,7 @@ argument: 0
 --------------------
 class: FL_LABELFRAME
 type: ENGRAVED_FRAME
-box: 10 190 435 135
+box: 10 190 435 165
 boxtype: FL_NO_BOX
 colors: FL_BLACK FL_COL1
 alignment: FL_ALIGN_TOP_LEFT
@@ -2885,7 +2885,7 @@ argument: 0
 --------------------
 class: FL_INPUT
 type: NORMAL_INPUT
-box: 145 245 285 30
+box: 145 240 285 30
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_MCOL
 alignment: FL_ALIGN_LEFT
@@ -2903,7 +2903,7 @@ argument: 0
 --------------------
 class: FL_INPUT
 type: NORMAL_INPUT
-box: 145 285 285 30
+box: 145 310 285 30
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_MCOL
 alignment: FL_ALIGN_LEFT
@@ -2936,5 +2936,23 @@ name: check_autoreset_classopt
 callback: C_FormBaseInputCB
 argument: 0
 
+--------------------
+class: FL_INPUT
+type: NORMAL_INPUT
+box: 145 275 285 30
+boxtype: FL_DOWN_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Bibtex:|#B
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: input_bibtex
+callback: C_FormBaseInputCB
+argument: 0
+
 ==============================
 create_the_forms
index 11110b040eb8cccfd34aefea31aab9b2f6158e17..eb3b2fe0b57547f1cf0e87e15939b72cfaf0c200 100644 (file)
@@ -65,6 +65,7 @@ keyword_item lyxrcTags[] = {
        { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
        { "\\autosave", LyXRC::RC_AUTOSAVE },
        { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
+       { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
        { "\\bind_file", LyXRC::RC_BINDFILE },
        { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
        { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
@@ -201,6 +202,7 @@ void LyXRC::setDefaults() {
        default_papersize = PAPER_USLETTER;
        custom_export_format = "ps";
        chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
+       bibtex_command = "bibtex";
        fontenc = "default";
        dpi = 75;
        // Because a screen typically is wider than a piece of paper:
@@ -555,6 +557,12 @@ int LyXRC::read(string const & filename)
                                chktex_command = lexrc.getString();
                        }
                        break;
+                       
+               case RC_BIBTEX_COMMAND:
+                       if (lexrc.next()) {
+                               bibtex_command = lexrc.getString();
+                       }
+                       break;
 
                case RC_SCREEN_DPI:
                        if (lexrc.next()) {
@@ -1161,6 +1169,10 @@ void LyXRC::output(ostream & os) const
                if (chktex_command != system_lyxrc.chktex_command) {
                        os << "\\chktex_command \"" << chktex_command << "\"\n";
                }
+       case RC_BIBTEX_COMMAND:
+               if (bibtex_command != system_lyxrc.bibtex_command) {
+                       os << "\\bibtex_command \"" << bibtex_command << "\"\n";
+               }
        case RC_KBMAP:
                if (use_kbmap != system_lyxrc.use_kbmap) {
                        os << "\\kbmap " << tostr(use_kbmap) << '\n';
@@ -1977,6 +1989,10 @@ string const LyXRC::getDescription(LyXRCTags tag)
        case RC_CHKTEX_COMMAND:
                str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
                break;
+               
+       case RC_BIBTEX_COMMAND:
+               str = _("Define the options of bibtex (cf. man bibtex) or select and alternative compiler (e.g. mlbibtex or bibulus).");
+               break;
 
        case RC_CURSOR_FOLLOWS_SCROLLBAR:
                str = _("LyX normally doesn't update the cursor position if you move the scrollbar. Set to true if you'd prefer to always have the cursor on screen.");
index 71894683e030766da7af49a4ab149ddc74ca9d4e..068549f7e600dc8d6d1763e123cc3f5a340a4b99 100644 (file)
@@ -98,6 +98,7 @@ enum LyXRCTags {
        RC_PERS_DICT,
        RC_ESC_CHARS,
        RC_CHKTEX_COMMAND,
+       RC_BIBTEX_COMMAND,
        RC_CURSOR_FOLLOWS_SCROLLBAR,
        RC_DIALOGS_ICONIFY_WITH_MAIN,
        RC_MAKE_BACKUP,
@@ -196,6 +197,8 @@ enum LyXRCTags {
        PAPER_SIZE default_papersize;
        /// command to run chktex incl. options
        std::string chktex_command;
+       /// command to run bibtex incl. options
+       std::string bibtex_command;
        ///
        std::string document_path;
        ///