]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.C
fix reading the author field.
[lyx.git] / src / LaTeXFeatures.C
index 85754e12d0342439dfd3c6d95a5b026c7d0cfe90..67fcb20535e824dbc1fa4f2820f6573341b2b0b6 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)
-       : buffer_(b), params_(p)
+
+LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p, bool n)
+       : buffer_(&b), params_(p), nice_(n)
 {}
 
 
@@ -191,7 +193,7 @@ char const * simplefeatures[] = {
        "wasy",
        "dvipost",
        "fancybox",
-       "calc"
+       "calc",
 };
 
 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
@@ -298,7 +300,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";
@@ -306,6 +308,17 @@ 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")) {
+               packages << "\\usepackage[dot]{bibtopic}\n";
+       }
+
        return packages.str();
 }
 
@@ -357,8 +370,6 @@ string const LaTeXFeatures::getMacros() const
                macros << mathcircumflex_def << '\n';
 
        // other
-       if (isRequired("NeedLyXMinipageIndent"))
-               macros << minipageindent_def;
        if (isRequired("ParagraphLeftIndent"))
                macros << paragraphleftindent_def;
        if (isRequired("NeedLyXFootnoteCode"))
@@ -372,6 +383,9 @@ string const LaTeXFeatures::getMacros() const
        if (isRequired("lyxgreyedout"))
                macros << lyxgreyedout_def;
 
+       if (isRequired("lyxdot"))
+               macros << lyxdot_def << '\n';
+
        // floats
        getFloatDefinitions(macros);
 
@@ -415,7 +429,7 @@ string const LaTeXFeatures::getTClassPreamble() const
                if (isRequired(cs->name))
                        tcpreamble << cs->preamble;
        }
-       
+
        return tcpreamble.str();
 }
 
@@ -460,7 +474,13 @@ void LaTeXFeatures::showStruct() const {
 
 Buffer const & LaTeXFeatures::buffer() const
 {
-       return buffer_;
+       return *buffer_;
+}
+
+
+void LaTeXFeatures::setBuffer(Buffer const & buffer)
+{
+       buffer_ = &buffer;
 }