commit f5e2f34447ebc6df58bbcfa8c584c29a985c051d
Author: Enrico Forestieri <[email protected]>
Date: Sun Aug 3 00:42:07 2025 +0200
Revert "Account for unknown required packages"
This reverts commit 35aa4bda311f0bde3293192e353a2401c4bf970a.
Better patch on the way.
---
src/LaTeXFeatures.cpp | 19 +++++++------------
src/LaTeXFeatures.h | 2 --
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index bccc79ef64..3670dc26d7 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -775,11 +775,7 @@ bool LaTeXFeatures::isProvided(string const & name) const
bool LaTeXFeatures::mustProvide(string const & name) const
{
- if (isRequired(name) && !isProvided(name)) {
- features_loaded_.insert(name);
- return true;
- }
- return false;
+ return isRequired(name) && !isProvided(name);
}
@@ -1309,6 +1305,12 @@ string const LaTeXFeatures::getPackages() const
{
ostringstream packages;
+ // FIXME: currently, we can only load packages and macros known
+ // to LyX.
+ // However, with the Require tag of layouts/custom insets,
+ // also unknown packages can be requested. They are silently
+ // swallowed now. We should change this eventually.
+
// Simple hooks to add things before or after a given "simple"
// feature. Useful if loading order matters.
map<string, string> before_simplefeature_;
@@ -1610,13 +1612,6 @@ string const LaTeXFeatures::getPackages() const
packages << "\\usepackage{microtype}\n";
}
- // Account for unknown packages mentioned in the Require tag
- // of layouts/custom insets
- for (string const & name : features_) {
- if (features_loaded_.find(name) == features_loaded_.end())
- packages << "\\usepackage{" << name << "}\n";
- }
-
return packages.str();
}
diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h
index 2909a89e94..2d6fce25ca 100644
--- a/src/LaTeXFeatures.h
+++ b/src/LaTeXFeatures.h
@@ -224,8 +224,6 @@ private:
Features features_;
/// Features that are provided
Features provides_;
- /// Already accounted for features
- mutable Features features_loaded_;
/// Static preamble bits, from external templates, or anywhere else
typedef std::list<TexString> SnippetList;
///
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs