commit 5c5b248356b73bd99d51af835c71f430bce41213
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Wed Apr 23 16:53:23 2025 +0200

    Fixup 0ed78208: 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.
---
 src/mathed/InsetMathExInt.cpp | 10 +++++++---
 src/mathed/MathExtern.cpp     |  5 +++--
 2 files changed, 10 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 7546fdab55..301c4b1a69 100644
--- a/src/mathed/MathExtern.cpp
+++ b/src/mathed/MathExtern.cpp
@@ -720,14 +720,15 @@ void extractIntegrals(MathData & ar, ExternalMath kind)
                if (!testIntegral(*it))
                        continue;
 
-               // core is part from behind the scripts to the 'd'
-               auto p = make_unique<InsetMathExInt>(buf, from_ascii("int"));
+               // \int is a macro nowadays (like in LaTeX), the symbol is 
\intop.
+               auto p = 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
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to