diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index f5e44f005e..c53988c996 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -43,6 +43,7 @@ #include "graphics/PreviewImage.h" #include "graphics/PreviewLoader.h" +#include "frontends/alert.h" #include "frontends/Painter.h" #include "support/lassert.h" @@ -1195,6 +1196,15 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func) // return; //} + // only inline, display or eqnarray math is allowed + if (getType() > hullEqnArray) { + frontend::Alert::warning(_("Bad math environment"), + _("Computation cannot be performed for AMS " + "math environments.\nChange the math " + "formula type and try again.")); + return; + } + MathData eq; eq.push_back(MathAtom(new InsetMathChar('=')));