From 158571ea004e11aa08a7c8ef46c787e0aa674e23 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Tue, 16 Jul 2013 23:16:09 +0200 Subject: [PATCH] LaTeXFeatures.cpp: fix bug #8731 - we must assure that the package mhchem is loaded before the package esint --- src/LaTeXFeatures.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index d23f8b0b47..d4074d6109 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -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 -- 2.39.2