]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.C
avoid to update when navigating
[lyx.git] / src / LaTeXFeatures.C
index b70b7decc3bd2c30121f78351f05b251fbbb4ae7..9cbbc3288c564c9e76c60aa34443f15740d92782 100644 (file)
@@ -42,8 +42,8 @@ using std::ostringstream;
 using std::set;
 
 
-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)
 {}
 
 
@@ -189,7 +189,10 @@ char const * simplefeatures[] = {
        "prettyref",
        "float",
        "wasy",
-       "dvipost"
+       "dvipost",
+       "fancybox",
+       "calc",
+       "jurabib"
 };
 
 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
@@ -296,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";
@@ -304,6 +307,12 @@ string const LaTeXFeatures::getPackages() const
                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();
 }
 
@@ -355,8 +364,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"))
@@ -370,6 +377,9 @@ string const LaTeXFeatures::getMacros() const
        if (isRequired("lyxgreyedout"))
                macros << lyxgreyedout_def;
 
+       if (isRequired("lyxdot"))
+               macros << lyxdot_def << '\n';
+
        // floats
        getFloatDefinitions(macros);
 
@@ -407,6 +417,13 @@ string const LaTeXFeatures::getTClassPreamble() const
                tcpreamble << tclass[*cit]->preamble();
        }
 
+       CharStyles::iterator cs = tclass.charstyles().begin();
+       CharStyles::iterator csend = tclass.charstyles().end();
+       for (; cs != csend; ++cs) {
+               if (isRequired(cs->name))
+                       tcpreamble << cs->preamble;
+       }
+
        return tcpreamble.str();
 }
 
@@ -451,7 +468,13 @@ void LaTeXFeatures::showStruct() const {
 
 Buffer const & LaTeXFeatures::buffer() const
 {
-       return buffer_;
+       return *buffer_;
+}
+
+
+void LaTeXFeatures::setBuffer(Buffer const & buffer)
+{
+       buffer_ = &buffer;
 }