commit 9ccb59a56451fed77a02a2e57608af9c23199a55
Author: Enrico Forestieri <for...@lyx.org>
Date:   Sun Aug 3 18:26:33 2025 +0200

    Amend a956e049
    
    Move the check for unknown packages just before generating the
    document body, to really ensure that no additional feature is
    going to be required.
---
 src/Buffer.cpp       | 4 ++++
 src/BufferParams.cpp | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index bbf4dfe97b..65ad4a95a6 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2099,6 +2099,10 @@ Buffer::ExportStatus Buffer::writeLaTeXSource(otexstream 
& os,
                // but once required, we must keep use_japanese true.
                runparams.use_japanese |= features.isRequired("japanese");
 
+               // load last the unknown packages mentioned in the Require tag
+               // of layouts/custom insets
+               os << features.getUnknownPackages();
+
                if (!output_body) {
                        // Restore the parenthood if needed
                        if (!runparams.is_child)
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index d9e801e808..74e41f60f1 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -3071,10 +3071,6 @@ bool BufferParams::writeLaTeX(otexstream & os, 
LaTeXFeatures & features,
        if (features.isRequired("menukeys"))
                os << "\\usepackage{menukeys}\n";
 
-       // load last the unknown packages mentioned in the Require tag
-       // of layouts/custom insets
-       os << features.getUnknownPackages();
-
        docstring const i18npreamble =
                features.getTClassI18nPreamble(use_babel, use_polyglossia,
                                               use_minted);
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to