commit 4652dcef4fb81ce4997513f226068b732937608d
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri Aug 8 13:09:48 2025 +0200

    tex2lyx: import fancyvrb environments properly (as ERT) (#7648)
---
 src/tex2lyx/text.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 6ac3ac0fec..aa466fe4a6 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -2796,6 +2796,20 @@ void parse_environment(Parser & p, ostream & os, bool 
outer,
                        break;
                }
 
+               // FIXME Remove when we support fancyvrb natively
+               if (preamble.isPackageUsed("fancyvrb")
+                   && (unstarred_name == "Verbatim" || unstarred_name == 
"BVerbatim"
+                       || unstarred_name == "LVerbatim")) {
+                       // We do not natively support this, but in order to 
handle it,
+                       // we need to import the whole environment as ERT 
(#7648)
+                       output_ert_inset(os, "\\begin{" + name + "}", 
parent_context);
+                       output_ert_inset(os, p.ertEnvironment(name),
+                                  parent_context);
+                       p.skip_spaces();
+                       output_ert_inset(os, "\\end{" + name + "}\n", 
parent_context);
+                       break;
+               }
+
                parse_unknown_environment(p, name, os, FLAG_END, outer, 
parent_context);
                break;
        }// end of loop
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to