commit c23f9c3a7de70e97881022e2695fc70f8b86daab
Author: Juergen Spitzmueller <[email protected]>
Date: Sun Aug 31 18:33:42 2025 +0200
Also convert labels and refs in mathed with comma (#13219)
This amends 24f66f5ae047 which only considered labels and refs
in texted
---
lib/lyx2lyx/lyx_2_5.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/lib/lyx2lyx/lyx_2_5.py b/lib/lyx2lyx/lyx_2_5.py
index 358d932888..06e02a662b 100644
--- a/lib/lyx2lyx/lyx_2_5.py
+++ b/lib/lyx2lyx/lyx_2_5.py
@@ -2706,6 +2706,29 @@ def convert_reflists(document):
document.body[k] = document.body[k].replace(",", ".")
i += 1
+ # Same for mathed
+ i = 0
+ regexp = re.compile(r"(.*\\)(label{|[a-zA-Z]*ref{)([^}]+\,[^}]+)(}.*)")
+ while True:
+ i = find_token(document.body, "\\begin_inset Formula", i)
+ if i == -1:
+ break
+ j = find_end_of_inset(document.body, i)
+ if j == -1:
+ document.warning("Can't find end of Formula inset at line %d!!" %
(i))
+ i += 1
+ continue
+
+ k = find_re(document.body, regexp, i, j)
+ if k != -1:
+ while True:
+ m = regexp.match(document.body[k])
+ if not m:
+ break
+ # replace comma by dot
+ document.body[k] = m.group(1) + m.group(2) +
m.group(3).replace(",", ".") + m.group(4)
+ i += 1
+
def revert_reflists(document):
"Reverts crossref lists and ranges to ERT"
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs