]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.C
changelogs
[lyx.git] / src / LaTeXFeatures.C
index e7f52c7954a5a5f9efe912c85a8b65d85d9a0167..9545af96f45f58e16d8b4eca2682a5f3a35a23ed 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "support/filetools.h"
 
-#include "support/std_sstream.h"
+#include <sstream>
 
 using lyx::support::IsSGMLFilename;
 using lyx::support::MakeRelPath;
@@ -41,9 +41,11 @@ using std::ostream;
 using std::ostringstream;
 using std::set;
 
+namespace biblio = lyx::biblio;
+
 
 LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p, bool n)
-       : buffer_(b), params_(p), nice_(n)
+       : buffer_(&b), params_(p), nice_(n)
 {}
 
 
@@ -158,7 +160,6 @@ string LaTeXFeatures::getLanguages() const
             cit != UsedLanguages_.end();
             ++cit)
                languages << (*cit)->babel() << ',';
-
        return languages.str();
 }
 
@@ -192,7 +193,6 @@ char const * simplefeatures[] = {
        "dvipost",
        "fancybox",
        "calc",
-       "jurabib"
 };
 
 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
@@ -299,7 +299,7 @@ string const LaTeXFeatures::getPackages() const
        // natbib.sty
        if (isRequired("natbib") && ! tclass.provides(LyXTextClass::natbib)) {
                packages << "\\usepackage[";
-               if (params_.use_numerical_citations) {
+               if (params_.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL) {
                        packages << "numbers";
                } else {
                        packages << "authoryear";
@@ -307,6 +307,11 @@ string const LaTeXFeatures::getPackages() const
                packages << "]{natbib}\n";
        }
 
+       // jurabib -- we need version 0.6 at least.
+       if (isRequired("jurabib")) {
+               packages << "\\usepackage{jurabib}[2004/01/25]\n";
+       }
+
        // bibtopic -- the dot provides the aux file naming which
        // LyX can detect.
        if (isRequired("bibtopic")) {
@@ -377,6 +382,9 @@ string const LaTeXFeatures::getMacros() const
        if (isRequired("lyxgreyedout"))
                macros << lyxgreyedout_def;
 
+       if (isRequired("lyxdot"))
+               macros << lyxdot_def << '\n';
+
        // floats
        getFloatDefinitions(macros);
 
@@ -465,7 +473,13 @@ void LaTeXFeatures::showStruct() const {
 
 Buffer const & LaTeXFeatures::buffer() const
 {
-       return buffer_;
+       return *buffer_;
+}
+
+
+void LaTeXFeatures::setBuffer(Buffer const & buffer)
+{
+       buffer_ = &buffer;
 }