commit e152b7f22f5f40461f653ea6845a545eb036e23d
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Nov 23 10:18:18 2025 +0100

    Do not load amstext if amsmath is loaded
    
    This was done by getUnknownPackages() since those packages
    have not been correctly registered
---
 src/LaTeXFeatures.cpp | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

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-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to