commit 08b285966326523a10954cf6235d0c7b200c842f
Author: Georg Baum <[email protected]>
Date: Sat May 16 12:29:54 2015 +0200
Do not require esint for \int (bug 9498)
We also get a consistent look with amsmath, so require esint or amsmath.
When resolving alternatives, do also take into account whether the package
is available. For this to work, we also need to test for amsmath.sty (which
was surprisingly not yet done).
diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx
index e8cb027..9c1c2f6 100644
--- a/lib/chkconfig.ltx
+++ b/lib/chkconfig.ltx
@@ -272,6 +272,7 @@
\TestPackage{achicago}
\TestPackage{algorithm}
\TestPackage{algorithm2e}
+\TestPackage{amsmath}
\TestPackage{amstext}
\TestPackage{apacite}
\TestPackage{apalike}
diff --git a/lib/symbols b/lib/symbols
index cbd8307..89fc41a 100644
--- a/lib/symbols
+++ b/lib/symbols
@@ -995,7 +995,7 @@ tbond cmsy 180 186 mathord x
# If the wasysym integrals are really wanted then one has to load the package
# manually and disable automatic loading of amsmath and esint.
iffont esint
-int esint 001 0 mathop ∫ esint
+int esint 001 0 mathop ∫ esint|amsmath
intop esint 001 0 mathop ∫ esint
iint esint 003 0 mathop ∬ esint|amsmath
iintop esint 003 0 mathop ∬ esint
@@ -1021,7 +1021,7 @@ ointctrclockwiseop esint 023 0 mathop
∳ esint
ointclockwise esint 025 0 mathop ∲ esint
ointclockwiseop esint 025 0 mathop ∲ esint
else
-int cmex 82 242 mathop ∫ esint
+int cmex 82 242 mathop ∫ esint|amsmath
intop cmex 82 242 mathop ∫ esint
iint wasy 115 0 mathop ∬ esint|amsmath
iintop wasy 115 0 mathop &Int esint
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index dcfb44c..b4da005 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -1756,10 +1756,23 @@ void LaTeXFeatures::resolveAlternatives()
vector<string> const alternatives =
getVectorFromString(*it, "|");
vector<string>::const_iterator const end =
alternatives.end();
vector<string>::const_iterator ita =
alternatives.begin();
+ // Is any alternative already required? => use that
for (; ita != end; ++ita) {
if (isRequired(*ita))
break;
}
+ // Is any alternative available? => use the first one
+ // (bug 9498)
+ if (ita == end) {
+ for (ita = alternatives.begin(); ita != end;
++ita) {
+ if (isAvailable(*ita)) {
+ require(*ita);
+ break;
+ }
+ }
+ }
+ // This will not work, but not requiring something
+ // would be more confusing
if (ita == end)
require(alternatives.front());
features_.erase(it);