]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Remove the unused default parameter of Buffer::doExport().
[lyx.git] / src / LaTeXFeatures.cpp
index 347a703ba89ee40e9af85dfbf1755adf62d99ebd..623204337496372b6b17e13de09b7c6f12c58c60 100644 (file)
@@ -599,7 +599,10 @@ char const * simplefeatures[] = {
        "ifsym",
        "marvosym",
        "txfonts",
+       "pxfonts",
+       "mathdesign",
        "mathrsfs",
+       "mathabx",
        "ascii",
        "url",
        "covington",
@@ -710,8 +713,9 @@ string const LaTeXFeatures::getPackages() const
 
        // if fontspec is used, AMS packages have to be loaded before
        // fontspec (in BufferParams)
-       if (!params_.useNonTeXFonts && !loadAMSPackages().empty())
-               packages << loadAMSPackages();
+       string const amsPackages = loadAMSPackages();
+       if (!params_.useNonTeXFonts && !amsPackages.empty())
+               packages << amsPackages;
 
        // fixltx2e must be loaded after amsthm, since amsthm produces an error with
        // the redefined \[ command (bug 7233). Load is as early as possible, since
@@ -779,7 +783,7 @@ string const LaTeXFeatures::getPackages() const
 
        // esint must be after amsmath and wasysym, since it will redeclare
        // inconsistent integral symbols
-       if ((mustProvide("esint") || mustProvide("esintoramsmath")) &&
+       if (mustProvide("esint") &&
            params_.use_esint != BufferParams::package_off)
                packages << "\\usepackage{esint}\n";
 
@@ -1062,12 +1066,8 @@ string const LaTeXFeatures::loadAMSPackages() const
        if (mustProvide("amsthm"))
                tmp << "\\usepackage{amsthm}\n";
 
-       // esint is preferred for esintoramsmath
-       if ((mustProvide("amsmath")
-            && params_.use_amsmath != BufferParams::package_off)
-           || (mustProvide("esintoramsmath")
-               && params_.use_esint == BufferParams::package_off
-               && params_.use_amsmath != BufferParams::package_off)) {
+       if (mustProvide("amsmath")
+           && params_.use_amsmath != BufferParams::package_off) {
                tmp << "\\usepackage{amsmath}\n";
        } else {
                // amsbsy and amstext are already provided by amsmath
@@ -1076,7 +1076,7 @@ string const LaTeXFeatures::loadAMSPackages() const
                if (mustProvide("amstext"))
                        tmp << "\\usepackage{amstext}\n";
        }
-       
+
        if (mustProvide("amssymb")
            || params_.use_amsmath == BufferParams::package_on)
                tmp << "\\usepackage{amssymb}\n";
@@ -1388,4 +1388,25 @@ void LaTeXFeatures::getFloatDefinitions(odocstream & os) const
 }
 
 
+void LaTeXFeatures::resolveAlternatives()
+{
+       for (Features::iterator it = features_.begin(); it != features_.end();) {
+               if (contains(*it, '|')) {
+                       vector<string> const alternatives = getVectorFromString(*it, "|");
+                       vector<string>::const_iterator const end = alternatives.end();
+                       vector<string>::const_iterator ita = alternatives.begin();
+                       for (; ita != end; ++ita) {
+                               if (isRequired(*ita))
+                                       break;
+                       }
+                       if (ita == end)
+                               require(alternatives.front());
+                       features_.erase(it);
+                       it = features_.begin();
+               } else
+                       ++it;
+       }
+}
+
+
 } // namespace lyx