commit cbfdca29e886dcb67358578c3a083de45bb8485b
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Wed Apr 23 16:53:23 2025 +0200
Fixup 122e60d7: avoid crash with XHTML export.
Since \int is a macro and the real symbol is \intop, give this as
symbol name in InsetMathExInt. Moreover, make this class more robust
to the int vs intop thing.
(cherry picked from commit 5c5b248356b73bd99d51af835c71f430bce41213)
---
src/mathed/InsetMathExInt.cpp | 10 +++++++---
src/mathed/MathExtern.cpp | 5 +++--
status.24x | 2 ++
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/mathed/InsetMathExInt.cpp b/src/mathed/InsetMathExInt.cpp
index 65ef5e78df..7217bc3e37 100644
--- a/src/mathed/InsetMathExInt.cpp
+++ b/src/mathed/InsetMathExInt.cpp
@@ -74,7 +74,11 @@ void InsetMathExInt::draw(PainterInfo &, int, int) const
void InsetMathExInt::maple(MapleStream & os) const
{
- os << symbol_ << '(';
+ if (symbol_ == "int" || symbol_ == "intop")
+ os << "int(";
+ else
+ os << symbol_ << '(';
+
if (!cell(0).empty())
os << cell(0);
else
@@ -88,7 +92,7 @@ void InsetMathExInt::maple(MapleStream & os) const
void InsetMathExInt::maxima(MaximaStream & os) const
{
- if (symbol_ == "int")
+ if (symbol_ == "int" || symbol_ == "intop")
os << "integrate(";
else
os << symbol_ << '(';
@@ -105,7 +109,7 @@ void InsetMathExInt::maxima(MaximaStream & os) const
void InsetMathExInt::mathematica(MathematicaStream & os) const
{
- if (symbol_ == "int")
+ if (symbol_ == "int" || symbol_ == "intop")
os << "Integrate[";
else if (symbol_ == "sum")
os << "Sum[";
diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp
index a31e00f738..41bdc6dea7 100644
--- a/src/mathed/MathExtern.cpp
+++ b/src/mathed/MathExtern.cpp
@@ -723,14 +723,15 @@ void extractIntegrals(MathData & ar, ExternalMath kind)
if (!testIntegral(*it))
continue;
- // core is part from behind the scripts to the 'd'
- auto p = lyx::make_unique<InsetMathExInt>(buf,
from_ascii("int"));
+ // \int is a macro nowadays (like in LaTeX), the symbol is
\intop.
+ auto p = lyx::make_unique<InsetMathExInt>(buf,
from_ascii("intop"));
// handle scripts if available
if (!testIntSymbol(*it)) {
p->cell(2) = (*it)->asScriptInset()->down();
p->cell(3) = (*it)->asScriptInset()->up();
}
+ // core is part from behind the scripts to the 'd'
p->cell(0) = MathData(buf, it + 1, jt);
// use the "thing" behind the 'd' as differential
diff --git a/status.24x b/status.24x
index 105d586479..d557fc80a0 100644
--- a/status.24x
+++ b/status.24x
@@ -93,6 +93,8 @@ What's new
- Include local layout files in LyX archive (bug 13149).
+- Fix handling of integrals with external computer algebra systems.
+
* USER INTERFACE
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs