#include <boost/array.hpp>
-#include "support/std_sstream.h"
+#include <sstream>
namespace support = lyx::support;
using lyx::support::bformat;
using std::ostringstream;
using std::pair;
+namespace biblio = lyx::biblio;
+
struct BufferParams::Impl
{
orientation = ORIENTATION_PORTRAIT;
use_geometry = false;
use_amsmath = AMS_AUTO;
- use_natbib = false;
- use_numerical_citations = false;
- use_jurabib = false;
+ cite_engine = biblio::ENGINE_BASIC;
+ use_bibtopic = false;
tracking_changes = false;
secnumdepth = 3;
tocdepth = 3;
lex.nextToken();
use_amsmath = static_cast<AMS>(
lex.getInteger());
- } else if (token == "\\use_natbib") {
- lex.nextToken();
- use_natbib = lex.getInteger();
- } else if (token == "\\use_numerical_citations") {
+ } else if (token == "\\cite_engine") {
lex.nextToken();
- use_numerical_citations = lex.getInteger();
- } else if (token == "\\use_jurabib") {
+ string const engine = lex.getString();
+
+ cite_engine = biblio::ENGINE_BASIC;
+ if (engine == "natbib_numerical")
+ cite_engine = biblio::ENGINE_NATBIB_NUMERICAL;
+ else if (engine == "natbib_authoryear")
+ cite_engine = biblio::ENGINE_NATBIB_AUTHORYEAR;
+ else if (engine == "jurabib")
+ cite_engine = biblio::ENGINE_JURABIB;
+
+ } else if (token == "\\use_bibtopic") {
lex.nextToken();
- use_jurabib = lex.getInteger();
+ use_bibtopic = lex.getInteger();
} else if (token == "\\tracking_changes") {
lex.nextToken();
tracking_changes = lex.getInteger();
// Update also the LColor table:
if (color == "none")
color = lcolor.getX11Name(LColor::background);
- lcolor.setColor(lcolor.getFromLyXName(branch), color);
+ lcolor.setColor(branch, color);
+
}
}
} else if (token == "\\author") {
spacing().writeFile(os);
+ string cite_engine_str = "basic";
+ switch (cite_engine) {
+ case biblio::ENGINE_BASIC:
+ break;
+ case biblio::ENGINE_NATBIB_NUMERICAL:
+ cite_engine_str = "natbib_numerical";
+ break;
+ case biblio::ENGINE_NATBIB_AUTHORYEAR:
+ cite_engine_str = "natbib_authoryear";
+ break;
+ case biblio::ENGINE_JURABIB:
+ cite_engine_str = "jurabib";
+ break;
+ }
+
os << "\\papersize " << string_papersize[papersize2]
<< "\n\\paperpackage " << string_paperpackages[paperpackage]
<< "\n\\use_geometry " << use_geometry
<< "\n\\use_amsmath " << use_amsmath
- << "\n\\use_natbib " << use_natbib
- << "\n\\use_numerical_citations " << use_numerical_citations
- << "\n\\use_jurabib " << use_jurabib
+ << "\n\\cite_engine " << cite_engine_str
+ << "\n\\use_bibtopic " << use_bibtopic
<< "\n\\paperorientation " << string_orientation[orientation]
<< '\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.
+ // with other packages.
// Jurabib has to be called after babel, though.
if (use_babel && !features.isRequired("jurabib")) {
lyxpreamble += babelCall(language_options.str()) + '\n';