commit ee084e182dac4687bec7abd58ed2cb3e4696de7c
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun May 4 11:29:19 2025 +0200

    tex2lyx: update detection of theorems to new layout format
---
 src/tex2lyx/tex2lyx.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp
index 663c0bb2e7..01c5078c48 100644
--- a/src/tex2lyx/tex2lyx.cpp
+++ b/src/tex2lyx/tex2lyx.cpp
@@ -374,6 +374,21 @@ bool checkModule(string const & name, bool command)
                if (layout) {
                        found_style = true;
                        dpre = layout->preamble();
+                       if (dpre.empty() && !layout->thmName().empty()) {
+                               odocstringstream thmdef;
+                               if (layout->thmCounter() == "none")
+                                       thmdef << "\\newtheorem*{" << 
from_ascii(layout->thmName())
+                                              << "}{\\protect\\" << 
from_ascii(layout->thmLaTeXName()) << "}";
+                               else {
+                                       thmdef << "\\newtheorem{" << 
from_ascii(layout->thmName()) << "}";
+                                       if (!layout->thmCounter().empty())
+                                               thmdef << "[" << 
from_ascii(layout->thmCounter()) << "]";
+                                       thmdef << "{\\protect\\" << 
from_ascii(layout->thmLaTeXName()) << "}";
+                                       if (!layout->thmParentCounter().empty())
+                                               thmdef << "[" << 
from_ascii(layout->thmParentCounter()) << "]";
+                               }
+                               dpre = thmdef.str();
+                       }
                        std::set<std::string> const & lreqs = 
layout->required();
                        if (!lreqs.empty())
                                cmd_reqs.insert(lreqs.begin(), lreqs.end());
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to