Am Samstag, dem 22.11.2025 um 14:50 +0100 schrieb Jürgen Spitzmüller:
> The attached patch would fix this, but there are probably more cases
> like this (maybe the geometry case has the same cause), so I wonder
> if the problem should rather be fixed in getUnknownPackages() which
> should really only load _unknown_ packages, not all required packages
> not loaded so far.
Here's a better patch.
--
Jürgen
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index b854a4f4c7..da905cb057 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -2084,16 +2084,17 @@ string const LaTeXFeatures::loadAMSPackages() const
{
ostringstream tmp;
- if (mustProvide("amsmath")
- && params_.use_package("amsmath") != BufferParams::package_off) {
+ bool const amsmath = mustProvide("amsmath")
+ && params_.use_package("amsmath") != BufferParams::package_off;
+ if (amsmath)
tmp << "\\usepackage{amsmath}\n";
- } else {
- // amsbsy and amstext are already provided by amsmath
- if (mustProvide("amsbsy"))
- tmp << "\\usepackage{amsbsy}\n";
- if (mustProvide("amstext"))
- tmp << "\\usepackage{amstext}\n";
- }
+ // amsbsy and amstext are already provided by amsmath
+ // we need to check with mustProvide here to
+ // register the packages in features_loaded_
+ if (mustProvide("amsbsy") && !amsmath)
+ tmp << "\\usepackage{amsbsy}\n";
+ if (mustProvide("amstext") && !amsmath)
+ tmp << "\\usepackage{amstext}\n";
if (mustProvide("amsthm"))
tmp << "\\usepackage{amsthm}\n";
--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel