From 515a4f0fee444485ebb7f4f38d92b29c1c153943 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sun, 26 Oct 2014 13:44:42 +0100 Subject: [PATCH] LaTeXFeatures.cpp: fix bug #9266 also for branch mhchem loads amsmath and needs therefore be loaded after it but before packages that redefine commands of amsmath. We already take care of esint but not of wasysym --- src/LaTeXFeatures.cpp | 31 ++++++++++++++++--------------- status.21x | 3 +++ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 506af187c9..87280ad826 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -891,19 +891,7 @@ string const LaTeXFeatures::getPackages() const if (mustProvide("cancel") && params_.use_package("cancel") != BufferParams::package_off) packages << "\\usepackage{cancel}\n"; - // wasysym is a simple feature, but it must be after amsmath if both - // are used - // wasysym redefines some integrals (e.g. iint) from amsmath. That - // leads to inconsistent integrals. We only load this package if - // the document does not contain integrals (then isRequired("esint") - // is false) or if esint is used, since esint redefines all relevant - // integral symbols from wasysym and amsmath. - // See http://www.lyx.org/trac/ticket/1942 - if (mustProvide("wasysym") && - params_.use_package("wasysym") != BufferParams::package_off && - (params_.use_package("esint") != BufferParams::package_off || !isRequired("esint"))) - packages << "\\usepackage{wasysym}\n"; - + // accents must be loaded after amsmath if (mustProvide("accents") && params_.use_package("accents") != BufferParams::package_off) @@ -961,14 +949,27 @@ string const LaTeXFeatures::getPackages() const if (mustProvide("setspace") && !isProvided("SetSpace")) packages << "\\usepackage{setspace}\n"; - // we need to assure that mhchem is loaded before esint - // because esint must be loaded AFTER amslatex and mhchem loads amlatex + // we need to assure that mhchem is loaded before esint and every other + // package that redefines command of amsmath because 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"; + // wasysym is a simple feature, but it must be after amsmath if both + // are used + // wasysym redefines some integrals (e.g. iint) from amsmath. That + // leads to inconsistent integrals. We only load this package if + // the document does not contain integrals (then isRequired("esint") + // is false) or if esint is used, since esint redefines all relevant + // integral symbols from wasysym and amsmath. + // See http://www.lyx.org/trac/ticket/1942 + if (mustProvide("wasysym") && + params_.use_package("wasysym") != BufferParams::package_off && + (params_.use_package("esint") != BufferParams::package_off || !isRequired("esint"))) + packages << "\\usepackage{wasysym}\n"; + // esint must be after amsmath (and packages requiring amsmath, like mhchem) // and wasysym, since it will redeclare inconsistent integral symbols if (mustProvide("esint") && diff --git a/status.21x b/status.21x index f5917fe871..453c2a930b 100644 --- a/status.21x +++ b/status.21x @@ -65,6 +65,9 @@ What's new - Fix incorrect output of ampersands when multiple keys are given for a citation (bug 9296). +- Fix export of documents that use the LaTeX-packages mhchem and wasysym + (bug 9266). + * LYX2LYX -- 2.39.5