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.
+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
#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
\use_natbib 0
\use_numerical_citations 0
\use_jurabib 0
+\use_bibtopic 0
\paperorientation portrait
\secnumdepth 2
\tocdepth 3
\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
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
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>
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]
--- /dev/null
+# 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
--- /dev/null
+# 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
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.
}
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();
}
namespace {
-const int LYX_FORMAT = 231;
+const int LYX_FORMAT = 232;
} // namespace anon
use_natbib = false;
use_numerical_citations = false;
use_jurabib = false;
+ use_bibtopic = false;
tracking_changes = false;
secnumdepth = 3;
tocdepth = 3;
} 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();
<< "\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';
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]
+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:
#include "ControlBibtex.h"
+#include "buffer.h"
+#include "bufferparams.h"
+
#include "lyxrc.h"
#include "helper_funcs.h"
#include "tex_helpers.h"
{
rescanTexStyles();
}
+
+
+bool ControlBibtex::usingBibtopic() const
+{
+ return kernel().buffer().params().use_bibtopic;
+}
/// 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;
};
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.
*
* \author John Levon
* \author Herbert Voß
+ * \author Jürgen Spitzmüller
*
* Full author contact details are available in file CREDITS.
*/
void QBibtex::update_contents()
{
+ bool bibtopic = controller().usingBibtopic();
+
dialog_->databaseLB->clear();
string bibs(controller().params().getContents());
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);
// 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("");
}
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()) {
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);
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_,
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()));
<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&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>
<rect>
<x>0</x>
<y>0</y>
- <width>306</width>
- <height>279</height>
+ <width>298</width>
+ <height>313</height>
</rect>
</property>
<property stdset="1">
<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>
<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 &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&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 &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>
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.
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);
// 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 "
"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);
}
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, ',');
}
}
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);
// no database -> no bibtex-command and no options!
controller().params().setContents("");
controller().params().setOptions("");
+ controller().params().setSecOptions("");
return;
}
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("");
}
bool const scalableTabfolders = true;
#endif
+enum {
+ DEFCITE,
+ NATBIB,
+ JURABIB
+};
} // namespace anon
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);
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 ||
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)
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())
#include "FormBase.h"
#include "BranchList.h"
+#include "RadioButtonGroup.h"
#include <boost/scoped_ptr.hpp>
std::vector<std::string> lang_;
/// Contains all legal branches for this doc
BranchList branchlist_;
+
+ /// citation style buttons
+ RadioButtonGroup citestyle_;
};
#endif
=============== 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
--------------------
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
--------------------
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
--------------------
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
--------------------
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
--------------------
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
--------------------
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
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
Name: form_document_options
Width: 395
Height: 315
-Number of Objects: 10
+Number of Objects: 12
--------------------
class: FL_BOX
--------------------
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
--------------------
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
--------------------
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
--------------------
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
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
--------------------
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
--------------------
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
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
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).
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
+#include "LaTeXFeatures.h"
#include "gettext.h"
#include "metricsinfo.h"
#include "outputparams.h"
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
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
}
}
- // 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;
}
}
return true;
}
+
+
+void InsetBibtex::validate(LaTeXFeatures & features) const
+{
+ if (features.bufferParams().use_bibtopic)
+ features.require("bibtopic");
+}
+
bool addDatabase(std::string const &);
///
bool delDatabase(std::string const &);
+ ///
+ void validate(LaTeXFeatures &) const;
protected:
///
virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd);