commit 2bbd4256fc9e0d59295ebf06af3ce3638be91b31
Author: Richard Kimberly Heck <[email protected]>
Date:   Tue Jul 29 11:23:51 2025 -0400

    Update format for plimsoll symbol
---
 development/FORMAT     |  3 +++
 lib/lyx2lyx/lyx_2_5.py | 30 +++++++++++++++++++++++++++++-
 src/version.h          |  4 ++--
 3 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/development/FORMAT b/development/FORMAT
index b704978ee5..1d9594c64c 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -7,6 +7,9 @@ changes happened in particular if possible. A good example 
would be
 
 -----------------------
 
+2025-07-29 Richard Kimberly Heck <[email protected]>
+       * Format incremented to 642: Add plimsoll symbol and package
+
 2025-07-05 Jürgen Spitzmüller <[email protected]>
        * Format incremented to 641: \justification can now also take the
          value "default" (next to "true" and "false"); "default" is the new
diff --git a/lib/lyx2lyx/lyx_2_5.py b/lib/lyx2lyx/lyx_2_5.py
index b111371d9d..f680a0f839 100644
--- a/lib/lyx2lyx/lyx_2_5.py
+++ b/lib/lyx2lyx/lyx_2_5.py
@@ -3181,18 +3181,44 @@ def revert_prettyref_l7n(document):
     if i != -1:
         document.header[i] = "\\crossref_package prettyref"
 
+
 def revert_justification_pref(document):
     """Revert justification pref setting"""
     i = find_token(document.header, "\\justification default", 0)
     if i != -1:
         document.header[i] = "\\justification true"
 
+
 def convert_justification_pref(document):
     """Convert justification pref setting"""
     i = find_token(document.header, "\\justification true", 0)
     if i != -1:
         document.header[i] = "\\justification default"
 
+
+def revert_plimsoll(document):
+    """Add plimsoll package when that is used"""
+    document.warning("Starting...")
+    i = 0
+    while True:
+        i = find_token(document.body, "\\begin_inset Formula")
+        if i == -1:
+            return
+        document.warning(str(i))
+        j = find_end_of_inset(document.body, i)
+        if j == -1:
+            document.warning("Malformed LyX document: Could not find end of 
URL inset.")
+            i += 1
+            continue
+        k = find_substring(document.body, "\\plimsoll", i, j)
+        if k == -1:
+            i = j
+            continue
+        document.warning("adding...")
+        add_to_preamble(document, ["\\usepackage{plimsoll}"])
+        return
+
+
 ##
 # Conversion hub
 #
@@ -3219,11 +3245,13 @@ convert = [
     [638, []],
     [639, [convert_theorem_local_def]],
     [640, []],
-    [641, [convert_justification_pref]]
+    [641, [convert_justification_pref]],
+    [642, []]
 ]
 
 
 revert = [
+    [641, [revert_plimsoll]],
     [640, [revert_justification_pref]],
     [639, [revert_prettyref_l7n]],
     [638, [revert_theorem_local_def]],
diff --git a/src/version.h b/src/version.h
index dd69b60fcb..0fa51765c7 100644
--- a/src/version.h
+++ b/src/version.h
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 641 // spitz: justification2pref
-#define LYX_FORMAT_TEX2LYX 641
+#define LYX_FORMAT_LYX 642 // spitz: justification2pref
+#define LYX_FORMAT_TEX2LYX 642
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to