+2003-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * FORMAT: document jurabib.
+
+2003-02-23 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * FORMAT: document change to format 230.
+
2003-12-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* FORMAT: document change to format 229.
2004-02-23 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* format incremented to 230.
+
* Support for a second optional argument in insetcommand.
currently, citation uses this to support natbibs second
optional argument \cite[before][after]{key}.
I think there's nothing to convert upwards. Downwards, the
- commands need to be converted to ERT I suppose.
+ commands with 2 optional args need to be converted to ERT.
+
+ * Support for jurabib (param \use_jurabib [1|0], default is 0).
+ When converting downwards, \usepackage{jurabib} has to be added
+ to the preamble and, if babel is used, \usepackage{babel} before
+ (jurabib fails if babel is called afterwards). If the natbib commands
+ are used together with jurabib, they have to be converted to ERT too.
2003-12-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * dco/LaTeXConfig.lyx.in: document jurabib.
+
2004-02-23 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* examples/ro_splash.lyx: move this file from the docs (where it
#LyX 1.4.0cvs created this file. For more info see http://www.lyx.org/
-\lyxformat 229
+\lyxformat 230
\textclass article
\language english
\inputencoding default
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
+\use_jurabib 0
\paperorientation portrait
\secnumdepth 2
\tocdepth 3
\begin_layout Subsection
+jurabib
+\end_layout
+
+\begin_layout Description
+
+Found: @chk_jurabib@
+\end_layout
+
+\begin_layout Description
+
+CTAN:
+\family typewriter
+macros/latex/contrib/jurabib/
+\end_layout
+
+\begin_layout Description
+
+Notes: The package
+\family typewriter
+jura
+\family sans
+bib
+\family default
+
+\color None
+(
+\begin_inset LatexCommand \url{http://www.jurabib.org}
+
+\end_inset
+
+)
+\color default
+ can be used as an alternative to
+\family sans
+natbib
+\family default
+, to get flexible bibliographic styles with LyX.
+ It supports cite styles which are common in human sciences and law studies,
+ footcites, ibidems, and more.
+ You'll need to have jurabib version 0.6 at least.
+\end_layout
+
+\begin_layout Subsection
+
natbib
\end_layout
natbib
\family default
is needed by LyX to produce a flexible interface to most of the available
- bibliographic styles.
+ bibliographic styles
+\family typewriter
+
+\family default
+(you can also use
+\family sans
+jurabib
+\family default
+ instead).
\end_layout
\begin_layout Subsection
+2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * LaTeXFeatures.C:
+ * bufferparams.[Ch]: add jurabib support and param.
+
+ * LaTeX.C: add FIXME/comment.
+
2004-03-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* buffer.C: increment file format to 230.
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 ";
tmp += OnlyFilename(ChangeExtension(it->aux_file, string()));
Systemcall one;
"wasy",
"dvipost",
"fancybox",
- "calc"
+ "calc",
+ "jurabib"
};
int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
use_amsmath = AMS_AUTO;
use_natbib = false;
use_numerical_citations = false;
+ use_jurabib = false;
tracking_changes = false;
secnumdepth = 3;
tocdepth = 3;
} else if (token == "\\use_numerical_citations") {
lex.nextToken();
use_numerical_citations = lex.getInteger();
+ } else if (token == "\\use_jurabib") {
+ lex.nextToken();
+ use_jurabib = lex.getInteger();
} else if (token == "\\tracking_changes") {
lex.nextToken();
tracking_changes = lex.getInteger();
<< "\n\\use_amsmath " << use_amsmath
<< "\n\\use_natbib " << use_natbib
<< "\n\\use_numerical_citations " << use_numerical_citations
+ << "\n\\use_jurabib " << use_jurabib
<< "\n\\paperorientation " << string_orientation[orientation]
<< '\n';
texrow.newline();
}
+ // If we use jurabib, we have to call babel here.
+ if (use_babel && features.isRequired("jurabib")) {
+ os << babelCall(language_options.str())
+ << '\n'
+ << features.getBabelOptions();
+ texrow.newline();
+ }
+
// Now insert the LyX specific LaTeX commands...
// The optional packages;
lyxpreamble += bullets_def + "}\n\n";
// We try to load babel late, in case it interferes
- // with other packages.
- if (use_babel) {
- string tmp = lyxrc.language_package;
- if (!lyxrc.language_global_options
- && tmp == "\\usepackage{babel}")
- tmp = string("\\usepackage[") +
- language_options.str() +
- "]{babel}";
- lyxpreamble += tmp + "\n";
+ // with other packages.
+ // Jurabib has to be called after babel, though.
+ if (use_babel && !features.isRequired("jurabib")) {
+ lyxpreamble += babelCall(language_options.str()) + '\n';
lyxpreamble += features.getBabelOptions();
}
result += ' ' + lyxrc.print_landscape_flag;
return result;
}
+
+
+string const BufferParams::babelCall(string const & lang_opts) const
+{
+ string tmp = lyxrc.language_package;
+ if (!lyxrc.language_global_options && tmp == "\\usepackage{babel}")
+ tmp = string("\\usepackage[") + lang_opts + "]{babel}";
+ return tmp;
+}
bool use_natbib;
///
bool use_numerical_citations;
+ ///
+ bool use_jurabib;
/// revision tracking for this buffer ?
bool tracking_changes;
/// Time ago we agreed that this was a buffer property [ale990407]
std::string const dvips_options() const;
///
std::string const paperSizeName() const;
+ ///
+ std::string const babelCall(std::string const & lang_opts) const;
private:
/** Use the Pimpl idiom to hide those member variables that would otherwise
+2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * biblio.[Ch]:
+ * ControlCitation.[Ch]: add jurabib support.
+
2004-02-21 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* ControlPrint.C, ControlSendto.C: use always a temp dir
vector<pair<string, string> > blist;
kernel().buffer().fillWithBibKeys(blist);
+ bool use_styles = (usingNatbib() || usingJurabib());
+
typedef std::map<string, string>::value_type InfoMapValue;
-
+
for (vector<pair<string,string> >::size_type i = 0;
i < blist.size(); ++i) {
bibkeysInfo_.insert(InfoMapValue(blist[i].first,
}
if (citeStyles_.empty())
- citeStyles_ = biblio::getCiteStyles(usingNatbib());
+ citeStyles_ = biblio::getCiteStyles(usingNatbib(), usingJurabib());
else {
- if ((usingNatbib() && citeStyles_.size() == 1) ||
- (!usingNatbib() && citeStyles_.size() != 1))
- citeStyles_ = biblio::getCiteStyles(usingNatbib());
+ if ((use_styles && citeStyles_.size() == 1) ||
+ (!use_styles && citeStyles_.size() != 1))
+ citeStyles_ = biblio::getCiteStyles(usingNatbib(),
+ usingJurabib());
}
return true;
}
+bool ControlCitation::usingJurabib() const
+{
+ return kernel().buffer().params().use_jurabib;
+}
+
+
vector<string> const ControlCitation::getCiteStrings(string const & key) const
{
vector<string> styles;
vector<biblio::CiteStyle> const cs =
- biblio::getCiteStyles(usingNatbib());
+ biblio::getCiteStyles(usingNatbib(), usingJurabib());
if (kernel().buffer().params().use_numerical_citations)
styles = biblio::getNumericalStrings(key, bibkeysInfo_, cs);
///
bool usingNatbib() const;
+ ///
+ bool usingJurabib() const;
/// Possible citations based on this key
std::vector<std::string> const getCiteStrings(std::string const & key) const;
- /// available CiteStyle-s (depends on availability of Natbib
+ /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
static std::vector<biblio::CiteStyle> const & getCiteStyles() {
return citeStyles_;
}
}
-vector<CiteStyle> const getCiteStyles(bool usingNatbib)
+vector<CiteStyle> const getCiteStyles(bool usingNatbib, bool usingJurabib)
{
unsigned int nStyles = 1;
unsigned int start = 0;
nStyles = nCiteStyles - 1;
start = 1;
}
+ if (usingJurabib)
+ nStyles = nCiteStyles;
vector<CiteStyle> styles(nStyles);
switch (styles[i]) {
case CITE:
+ // jurabib only: Author/Annotator
+ // (i.e. the "before" field, 2nd opt arg)
+ str = author + "/<" + _("before") + '>';
+ break;
+
case CITET:
str = author + " (" + year + ')';
break;
std::string const getCiteCommand(CiteStyle, bool full, bool forceUCase);
/// Returns a vector of available Citation styles.
-std::vector<CiteStyle> const getCiteStyles(bool usingNatbib);
+std::vector<CiteStyle> const getCiteStyles(bool usingNatbib, bool usingJurabib);
/**
"Translates" the available Citation Styles into strings for this key.
+2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * QCitation.C:
+ * QDocument.C:
+ * QDocumentDialog.C:
+ * ui/BiblioModuleBase.ui: support jurabib.
+
2004-03-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* QCitation.C:
vector<string> const & sty = controller().getCiteStrings(key);
- bool const natbib = controller().usingNatbib();
- dialog_->citationStyleCO->setEnabled(!sty.empty() && natbib);
- dialog_->citationStyleLA->setEnabled(!sty.empty() && natbib);
+ bool const use_styles = (controller().usingNatbib() ||
+ controller().usingJurabib());
+ dialog_->citationStyleCO->setEnabled(!sty.empty() && use_styles);
+ dialog_->citationStyleLA->setEnabled(!sty.empty() && use_styles);
for (vector<string>::const_iterator it = sty.begin();
it != sty.end(); ++it) {
dialog_->fulllistCB->setEnabled(natbib);
dialog_->forceuppercaseCB->setEnabled(natbib);
- dialog_->textBeforeED->setEnabled(natbib);
+ dialog_->textBeforeED->setEnabled(natbib ||
+ controller().usingJurabib());
string const & command = controller().params().getCmdName();
// biblio
params.use_natbib =
- dialog_->biblioModule->natbibCB->isChecked();
+ dialog_->biblioModule->citeNatbibRB->isChecked();
params.use_numerical_citations =
dialog_->biblioModule->citeStyleCO->currentItem();
+ params.use_jurabib =
+ dialog_->biblioModule->citeJurabibRB->isChecked();
// language & quotes
if (dialog_->langModule->defaultencodingCB->isChecked()) {
dialog_->preambleModule->preambleMLE->setText(preamble);
// biblio
- dialog_->biblioModule->natbibCB->setChecked(
+ dialog_->biblioModule->citeNatbibRB->setChecked(
+ !params.use_natbib && !params.use_jurabib);
+ dialog_->biblioModule->citeNatbibRB->setChecked(
params.use_natbib);
dialog_->biblioModule->citeStyleCO->setCurrentItem(
params.use_numerical_citations ? 1 : 0);
+ dialog_->biblioModule->citeJurabibRB->setChecked(
+ params.use_jurabib);
// language & quotes
int const pos = int(findPos(lang_,
// preamble
connect(preambleModule->preambleMLE, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
// biblio
- connect(biblioModule->natbibCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
+ connect(biblioModule->citeDefaultRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
+ 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()));
// 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>450</width>
+ <width>426</width>
<height>376</height>
</rect>
</property>
<name>caption</name>
<string>Form1</string>
</property>
- <vbox>
+ <grid>
<property stdset="1">
<name>margin</name>
<number>11</number>
<name>spacing</name>
<number>6</number>
</property>
- <widget>
- <class>QLayoutWidget</class>
+ <widget row="0" column="0" >
+ <class>QButtonGroup</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout4</cstring>
+ <cstring>CiteStyleBG</cstring>
</property>
- <hbox>
+ <property stdset="1">
+ <name>title</name>
+ <string>Cite Style</string>
+ </property>
+ <grid>
<property stdset="1">
<name>margin</name>
- <number>0</number>
+ <number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
- <widget>
+ <widget row="2" column="0" >
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>citeJurabibRB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Jurabib</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Use the jurabib styles for law and humanities</string>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>citeNatbibRB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Natbib</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Use the natbib styles for natural sciences and arts</string>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>citeDefaultRB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Default (numerical)</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Use BibTeX's default numerical styles</string>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout3</cstring>
+ <cstring>Layout2</cstring>
</property>
- <vbox>
+ <hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
<number>6</number>
</property>
<widget>
- <class>QCheckBox</class>
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>natbibCB</cstring>
+ <cstring>citationStyleL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
- <string>Use &NatBib</string>
+ <string>Natbib &style:</string>
</property>
<property>
- <name>toolTip</name>
- <string>Use the LaTeX natbib package</string>
+ <name>buddy</name>
+ <cstring>citeStyleCO</cstring>
</property>
</widget>
<widget>
- <class>QLayoutWidget</class>
+ <class>QComboBox</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout2</cstring>
+ <cstring>citeStyleCO</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
</property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>citationStyleL</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>false</bool>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Cite &style:</string>
- </property>
- <property>
- <name>buddy</name>
- <cstring>citeStyleCO</cstring>
- </property>
- </widget>
- <widget>
- <class>QComboBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>citeStyleCO</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>false</bool>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- </sizepolicy>
- </property>
- </widget>
- </hbox>
</widget>
- </vbox>
+ </hbox>
</widget>
- <spacer>
- <property>
- <name>name</name>
- <cstring>Spacer1</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Minimum</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </hbox>
+ </grid>
</widget>
- <spacer>
+ <spacer row="1" column="0" >
<property>
<name>name</name>
<cstring>Spacer2</cstring>
</size>
</property>
</spacer>
- </vbox>
+ </grid>
</widget>
<connections>
<connection>
- <sender>natbibCB</sender>
+ <sender>citeNatbibRB</sender>
<signal>toggled(bool)</signal>
<receiver>citationStyleL</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
- <sender>natbibCB</sender>
+ <sender>citeNatbibRB</sender>
<signal>toggled(bool)</signal>
<receiver>citeStyleCO</receiver>
<slot>setEnabled(bool)</slot>
+2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * FormCitation.C:
+ * FormDocument.C:
+ * forms/form_document.fd: support jurabib.
+
2004-03-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* FormCitation.C: Support second \cite option.
bool const natbib = controller().usingNatbib();
setEnabled(dialog_->check_full_author_list, natbib);
setEnabled(dialog_->check_force_uppercase, natbib);
- setEnabled(dialog_->choice_style, natbib);
- setEnabled(dialog_->input_before, natbib);
+ setEnabled(dialog_->choice_style, natbib || controller().usingJurabib());
+ setEnabled(dialog_->input_before, natbib || controller().usingJurabib());
// No keys have been selected yet, so...
fl_clear_browser(dialog_->browser_info);
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_->choice_citation_format);
bcview().addReadOnly(options_->input_float_placement);
bcview().addReadOnly(options_->choice_postscript_driver);
+
+ // 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);
+ str = _("Use the jurabib styles for law and humanities");
+ tooltips().init(options_->check_use_jurabib, str);
// trigger an input event for cut&paste with middle mouse button.
setPrehandler(options_->input_float_placement);
bcview().addReadOnly(branch_->browser_all_branches);
// set up the tooltips for branches form
- string str = _("Enter the name of a new branch.");
+ str = _("Enter the name of a new branch.");
tooltips().init(branch_->input_all_branches, str);
str = _("Add a new branch to the document.");
tooltips().init(branch_->button_add_branch, 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);
+ setEnabled(options_->choice_citation_format,
+ fl_get_button(options_->check_use_natbib));
} else if (ob == branch_->browser_all_branches ||
ob == branch_->browser_selection ||
params.use_natbib = fl_get_button(options_->check_use_natbib);
params.use_numerical_citations =
fl_get_choice(options_->choice_citation_format) - 1;
+ params.use_jurabib = fl_get_button(options_->check_use_jurabib);
int tmpchar = int(fl_get_counter_value(options_->counter_secnumdepth));
if (params.secnumdepth != tmpchar)
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_counter_value(options_->counter_secnumdepth, params.secnumdepth);
fl_set_counter_value(options_->counter_tocdepth, params.tocdepth);
if (!params.float_placement.empty())
=============== FORM ===============
Name: form_document_options
Width: 395
-Height: 325
-Number of Objects: 8
+Height: 315
+Number of Objects: 10
--------------------
class: FL_BOX
type: FLAT_BOX
-box: 0 0 395 325
+box: 0 0 395 315
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 185 130 140 25
+box: 185 125 140 25
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
-box: 185 220 140 25
+box: 35 205 140 25
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 185 260 140 25
+box: 185 235 140 25
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Citation style:|#i
+label: Natbib style:|#i
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 185 170 140 25
+box: 185 155 140 25
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
callback: C_FormBaseInputCB
argument: 0
+--------------------
+class: FL_LABELFRAME
+type: ENGRAVED_FRAME
+box: 15 190 370 110
+boxtype: FL_NO_BOX
+colors: FL_BLACK FL_COL1
+alignment: FL_ALIGN_TOP_LEFT
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Cite Styles
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback:
+argument:
+
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 35 265 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 Jurabib|#J
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: check_use_jurabib
+callback: C_FormBaseInputCB
+argument: 0
+
=============== FORM ===============
Name: form_document_bullet
Width: 395
+2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * insetcite.[Ch]: support jurabib.
+
2004-03-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* insetcite.C: Support second \cite option.
string const getNatbibLabel(Buffer const & buffer,
string const & citeType, string const & keyList,
string const & before, string const & after,
- bool numerical)
+ bool numerical, bool jura)
{
// Only start the process off after the buffer is loaded from file.
if (!buffer.fully_loaded())
// CITEAUTHOR: author
// CITEYEAR: year
// CITEYEARPAR: (year)
+ // jurabib supports these plus
+ // CITE: author/<before field>
// We don't currently use the full or forceUCase fields.
// bool const forceUCase = citeType[0] == 'C';
cite_type == "citealp" ||
cite_type == "citeyearpar")
before_str = before + ' ';
+ // In CITE (jurabib), the "before" string is used to attach
+ // the annotator (of legal texts) to the author(s) of the
+ // first reference.
+ else if (cite_type == "cite")
+ before_str = '/' + before;
}
string after_str;
if (author.empty() || year.empty())
return string();
+ // authors1/<before>; ... ;
+ // authors_last, <after>
+ if (cite_type == "cite" && jura) {
+ if (it == keys.begin())
+ label += author + before_str + sep_str;
+ else
+ label += author + sep_str;
+
// (authors1 (<before> year); ... ;
// authors_last (<before> year, <after>)
- if (cite_type == "citet") {
+ } else if (cite_type == "citet") {
string const tmp = numerical ? '#' + *it : year;
- label += author + op_str + before_str + tmp +
+ if (!jura)
+ label += author + op_str + before_str + tmp +
+ cp + sep_str;
+ else
+ label += before_str + author + op_str + tmp +
cp + sep_str;
// author, year; author, year; ...
// authors_last <before> year, <after>)
} else if (cite_type == "citealt") {
string const tmp = numerical ? '#' + *it : year;
- label += author + ' ' + before_str + tmp + sep_str;
+ if (!jura)
+ label += author + ' ' + before_str + tmp + sep_str;
+ else
+ label += before_str + author + ' ' + tmp + sep_str;
// author; author; ...
} else if (cite_type == "citeauthor") {
string const after = getOptions();
string label;
- if (buffer.params().use_natbib) {
+ if (buffer.params().use_natbib || buffer.params().use_jurabib) {
string cmd = getCmdName();
- if (cmd == "cite") {
+ if (buffer.params().use_natbib && cmd == "cite") {
// We may be "upgrading" from an older LyX version.
// If, however, we use "cite" because the necessary
// author/year info is not present in the biblio
}
label = getNatbibLabel(buffer, cmd, getContents(),
before, after,
- buffer.params().use_numerical_citations);
+ buffer.params().use_numerical_citations,
+ buffer.params().use_jurabib);
}
// Fallback to fail-safe
style = Cache::NATBIB_AY;
}
}
+
+ if (buffer.params().use_jurabib)
+ style = Cache::JURABIB;
return style;
}
os << "\\";
if (buffer.params().use_natbib)
os << getCmdName();
- else
+ else if (buffer.params().use_jurabib) {
+ // jurabib does not (yet) support "force upper case"
+ // and "full author name". Fallback.
+ string cmd = getCmdName();
+ if (cmd[0] == 'C')
+ cmd[0] = 'c';
+ size_t n = cmd.size() - 1;
+ if (cmd[n] == '*')
+ cmd = cmd.substr(0,n);
+ os << cmd;
+ } else
os << "cite";
string const before = getSecOptions();
string const after = getOptions();
- if (!before.empty() && buffer.params().use_natbib)
+ if (!before.empty()
+ && (buffer.params().use_natbib || buffer.params().use_jurabib))
os << '[' << before << "][" << after << ']';
else if (!after.empty())
os << '[' << after << ']';
{
if (features.bufferParams().use_natbib)
features.require("natbib");
+ else if (features.bufferParams().use_jurabib)
+ features.require("jurabib");
}
///
NATBIB_AY,
///
- NATBIB_NUM
+ NATBIB_NUM,
+ ///
+ JURABIB
};
///
Cache() : style(BASIC) {}