]> git.lyx.org Git - lyx.git/commitdiff
Amend 2987530434105
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 18 Feb 2023 16:04:43 +0000 (17:04 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 18 Feb 2023 16:04:43 +0000 (17:04 +0100)
This is more readable (and fixes a thinko)

src/BufferParams.cpp

index e702b182f064a445ff75777c39e4f0d3bd50481e..71e4bae1b190bf27377613c1d6a13cc2d7b26c50 100644 (file)
@@ -1923,10 +1923,16 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
                // Babel (as of 2017/11/03) loads fontspec itself
                // However, it does so only if a non-default font is requested via \babelfont
                // Thus load fontspec if this is not the case and we need fontspec features
+               bool const babel_needfontspec =
+                               !features.isAvailableAtLeastFrom("babel", 2017, 11, 3)
+                               || (fontsRoman() == "default"
+                                   && fontsSans() == "default"
+                                   && fontsTypewriter() == "default"
+                                   // these need fontspec features
+                                   && (features.isRequired("textquotesinglep")
+                                       || features.isRequired("textquotedblp")));
                if (!features.isProvided("fontspec")
-                   && !(features.useBabel() && features.isAvailableAtLeastFrom("babel", 2017, 11, 3)
-                       && (fontsRoman() != "default" || fontsSans() != "default" || fontsTypewriter() != "default")
-                       && !features.isRequired("textquotesinglep") && !features.isRequired("textquotedoublep")))
+                   && (!features.useBabel() || babel_needfontspec))
                        os << "\\usepackage{fontspec}\n";
                if (features.mustProvide("unicode-math")
                    && features.isAvailable("unicode-math"))