[LyX/2.5.x] Fix #13247: CAS - displayed math to eqnarray

Pavel Sanda sanda at lyx.org
Mon Feb 23 21:42:18 UTC 2026


commit db2948d46d4bbcabc292336662dec509a95bd3e6
Author: Pavel Sanda <sanda at lyx.org>
Date:   Mon Feb 23 22:42:00 2026 +0100

    Fix #13247: CAS - displayed math to eqnarray
    
    Patch from Georg.
---
 src/mathed/InsetMathHull.cpp | 18 ++----------------
 status.25x                   |  3 +++
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index b9d76279af..33656e12f7 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1884,7 +1884,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
 	cur.idx() -= cur.idx() % ncols();
 	cur.pos() = 0;
 
-	if (getType() == hullSimple) {
+	if (getType() == hullSimple || getType() == hullEquation) {
 		size_type pos = cur.cell().find_last(eq);
 		MathData md(buffer_);
 		if (pos == cur.cell().size()) {
@@ -1892,7 +1892,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
 			lyxerr << "use whole cell: " << md << endl;
 		} else {
 			md = MathData(buffer_, cur.cell().begin() + pos + 1, cur.cell().end());
-			lyxerr << "use partial cell form pos: " << pos << endl;
+			lyxerr << "use partial cell from pos: " << pos << endl;
 		}
 		cur.cell().append(eq);
 		cur.cell().append(pipeThroughExtern(lang, extra, md));
@@ -1900,20 +1900,6 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
 		return;
 	}
 
-	if (getType() == hullEquation) {
-		lyxerr << "use equation inset" << endl;
-		mutate(hullEqnArray);
-		MathData & md = cur.cell();
-		lyxerr << "use cell: " << md << endl;
-		++cur.idx();
-		cur.cell() = eq;
-		++cur.idx();
-		cur.cell() = pipeThroughExtern(lang, extra, md);
-		// move to end of line
-		cur.pos() = cur.lastpos();
-		return;
-	}
-
 	{
 		lyxerr << "use eqnarray" << endl;
 		cur.idx() += 2 - cur.idx() % ncols();
diff --git a/status.25x b/status.25x
index 7ac494ecc4..b10200e8bf 100644
--- a/status.25x
+++ b/status.25x
@@ -56,6 +56,9 @@ What's new
 
 - Fix initial value of custom color dialog.
 
+- Fix computer algebra system bug: converting the displayed math
+  into eqnarray* environment (bug 13247).
+
 
 
 * INTERNALS


More information about the lyx-cvs mailing list