]> git.lyx.org Git - features.git/commitdiff
LaTeXFeatures.cpp: fix bug #8731
authorUwe Stöhr <uwestoehr@lyx.org>
Tue, 16 Jul 2013 21:16:09 +0000 (23:16 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Tue, 16 Jul 2013 21:16:09 +0000 (23:16 +0200)
- we must assure that the package mhchem is loaded before the package esint

src/LaTeXFeatures.cpp

index d23f8b0b47157c37e387415b41554a4a244d6038..d4074d6109a361bc4a9c580b3fe3e7a7c963b721 100644 (file)
@@ -936,8 +936,16 @@ string const LaTeXFeatures::getPackages() const
        if (mustProvide("setspace") && !isProvided("SetSpace"))
                packages << "\\usepackage{setspace}\n";
 
-       // esint must be after amsmath and wasysym, since it will redeclare
-       // inconsistent integral symbols
+       // we need to assure that mhchem is loaded before esint
+       // because esint must be loaded AFTER amslatex and mhchem loads amlatex
+       // (this info is from the author of mhchem from June 2013)
+       if (mustProvide("mhchem") &&
+           params_.use_package("mhchem") != BufferParams::package_off)
+               packages << "\\PassOptionsToPackage{version=3}{mhchem}\n"
+                           "\\usepackage{mhchem}\n";
+
+       // esint must be after amsmath (and packages requiring amsmath, like mhchem)
+       // and wasysym, since it will redeclare inconsistent integral symbols
        if (mustProvide("esint") &&
            params_.use_package("esint") != BufferParams::package_off)
                packages << "\\usepackage{esint}\n";
@@ -999,11 +1007,6 @@ string const LaTeXFeatures::getPackages() const
                packages << "\\PassOptionsToPackage{normalem}{ulem}\n"
                            "\\usepackage{ulem}\n";
 
-       if (mustProvide("mhchem") &&
-           params_.use_package("mhchem") != BufferParams::package_off)
-               packages << "\\PassOptionsToPackage{version=3}{mhchem}\n"
-                           "\\usepackage{mhchem}\n";
-
        if (mustProvide("nomencl")) {
                // Make it work with the new and old version of the package,
                // but don't use the compatibility option since it is