commit efef533d91a4e2929f37b615b2fc1eddfc5617da
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Mon Jul 18 00:45:01 2022 +0200

    Fix forcing of text class for LaTeX snippets
    
    When the input document is not a full document, make sure that the -c
    is taken into account.
---
 src/tex2lyx/Preamble.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 3588086..7b69bc4 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -2174,17 +2174,17 @@ void Preamble::parse(Parser & p, string const & 
forceclass,
        if (detectEncoding && !is_full_document)
                return;
 
+       // Force textclass if the user wanted it
+       if (!forceclass.empty()) {
+               setTextClass(forceclass, tc);
+               class_set = true;
+       }
+
        while (is_full_document && p.good()) {
                if (detectEncoding && h_inputencoding != "auto-legacy" &&
                    h_inputencoding != "auto-legacy-plain")
                        return;
 
-               // Force textclass if the user wanted it
-               if (!forceclass.empty()) {
-                       setTextClass(forceclass, tc);
-                       class_set = true;
-               }
-
                Token const & t = p.get_token();
 
 #ifdef FILEDEBUG
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to