commit c6f287a933e2e60b9dca9a4df8c05568cd06aa4f
Author: Juergen Spitzmueller <[email protected]>
Date:   Sat Aug 9 16:15:55 2025 +0200

    tex2lyx: properly parse argument of \twocolumn (part of #8400)
---
 lib/syntax.default   |  1 -
 src/tex2lyx/text.cpp | 10 ++++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/syntax.default b/lib/syntax.default
index 33a869b3d7..5f3301f99f 100644
--- a/lib/syntax.default
+++ b/lib/syntax.default
@@ -715,7 +715,6 @@ $$
 \topfigrule
 \topfraction
 \ttdefault
-\twocolumn[]
 \updefault
 \usebox{}
 \usecounter{}
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 90954b7742..873fe320ad 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -2503,6 +2503,16 @@ void parse_environment(Parser & p, ostream & os, bool 
outer,
                        break;
                }
 
+               if (name == "twocolumn") {
+                       output_ert_inset(os, "\\twocolumn", parent_context);
+                       if (p.hasOpt()) {
+                               p.get_token(); // eat '['
+                               output_ert_inset(os, "[", parent_context);
+                               os << parse_text_snippet(p, FLAG_BRACK_LAST, 
outer, parent_context);
+                               output_ert_inset(os, "]", parent_context);
+                       }
+               }
+
                if (name == "lstlisting" || name == "minted") {
                        bool use_minted = name == "minted";
                        // with listings, we do not eat newlines here since
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to